How to play a midi sound from soundcipher i.e a string sound and prolong this sound

Hello there! I have a question: when i play a string sound pressing a key using soundcipher the sound has a lenght and after a while it starts to glitching. how can i play longer notes , string sound notes, and have them stop when i just release the sound key, but keeping the quality of the string sound without glitches?

Answers

  • If you post some code, we could see your approach and maybe we could reproduce your error. More importantly, people will be happy to make suggestions to improve it or offer different approaches.

    Kf

  • edited December 2016

    Ok here is a code that it is working. I put two different instruments, a string and a piano to be played when the keys 's' and 'k' are pressed respectively. The sounds are trigged but in the piano case it has a duration and decay, in the string case the duration is much longer. What i need is a way to shrten the string sound if i desire to play a short note. The piano sound it is ok What i want is to have the possibility to prolong or shorten sounds like strings , sinth bass, basses, if i press and release the trigger keys. I know some sound can not do that but like in a sintesizer some can and they are going to be sounding as long as i keep pressing the key.... thanks for any help!!! Here is the code:

    `import arb.soundcipher.*;
    
    
    SoundCipher sc = new SoundCipher(this);
    SoundCipher sc2 = new SoundCipher(this);
    
    void setup() {
      sc.instrument(49);
      sc2.instrument(00);
    }
    void keyPressed()
    {
      if (key == 's') sc.playNote(60, 100, 6);
      if (key == 'k') sc2.playNote(50, 100, 4);
    }
    
    // keep processing 'alive'
    void draw() {}`
    
  • Format your code above. Edit your post, select your code and hit ctrl+o. Ensure one empty line above and below your code block.

    Kf

Sign In or Register to comment.