Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. s.boot;
  2.  
  3. SynthDef(\justasine, {| freq = 440, gate = 0, cutoff = 1000,amp=0.25|
  4.     e = EnvGen.kr(Env.adsr(0.01,0.01,1,0.01),gate,doneAction:2);
  5.     x = Pulse.ar(freq,0.5,e*amp);
  6.     f = BLowPass4.ar(x,cutoff);
  7.     o = Mix([f]);
  8.     Out.ar(0,[o,o]);
  9. }).send(s);
  10.  
  11.  
  12. MIDIClient.init;
  13.  
  14. v = Voicer.new(12,\justasine, addAction:\addToHead);
  15. k = MIDIClient.sources.collect {|port,i|
  16.     VoicerMIDISocket.new(MIDIChannelIndex(port.postln,0),v);
  17. };
  18.  
  19. f = \cutoff.asSpec;
  20. // list of the symbols you can use for this is in ControlSpec:initClass
  21.  
  22. (
  23.     c = CCResponder({ |src,chan,num,value| a.set( \cutoff, f.map( value/127 ) ) },
  24.         nil, // any source
  25.         nil, // any channel
  26.         1, // CC number 80
  27.         nil // any value
  28.     )
  29. )v
  30.  
  31. s.freeAll;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement