Guest User

Untitled

a guest
Apr 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1.  
  2. s.boot;
  3.  
  4. // now in stereo
  5.  
  6. ~audiobus = Bus.audio(s,2); // two channels
  7. ~controlbus = Bus.control(s);
  8.  
  9. SynthDef( \soundsource, { Out.ar( ~audiobus.index, [WhiteNoise.ar,SinOsc.ar] ) } ).play;
  10.  
  11. SynthDef( \controlsource, { Out.kr( ~controlbus.index, SinOsc.kr( 3 ).range(0,1) ) } ).play;
  12.  
  13. (
  14. SynthDef( \combined, {
  15. var soundin = In.ar( ~audiobus.index, 2 ); // so soundin is an array of two channels now
  16. var controlin = In.kr( ~controlbus.index );
  17.  
  18. // amplitude modulate the white noise with the incoming control signal
  19. var result = soundin * controlin;
  20.  
  21. // multiply by 0.1 so it's not too loud
  22. Out.ar( 0, result * 0.1 );
  23.  
  24. } ).play(addAction:\addToTail);
  25. // the addToTail is important here -- need to have the combined process after
  26. // the audio source and control are generated; otherwise the busses will be zero
  27. // when they're read since they only get filled later on in the dsp chain.
  28. )
Add Comment
Please, Sign In to add comment