Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s.boot;
- // now in stereo
- ~audiobus = Bus.audio(s,2); // two channels
- ~controlbus = Bus.control(s);
- SynthDef( \soundsource, { Out.ar( ~audiobus.index, [WhiteNoise.ar,SinOsc.ar] ) } ).play;
- SynthDef( \controlsource, { Out.kr( ~controlbus.index, SinOsc.kr( 3 ).range(0,1) ) } ).play;
- (
- SynthDef( \combined, {
- var soundin = In.ar( ~audiobus.index, 2 ); // so soundin is an array of two channels now
- var controlin = In.kr( ~controlbus.index );
- // amplitude modulate the white noise with the incoming control signal
- var result = soundin * controlin;
- // multiply by 0.1 so it's not too loud
- Out.ar( 0, result * 0.1 );
- } ).play(addAction:\addToTail);
- // the addToTail is important here -- need to have the combined process after
- // the audio source and control are generated; otherwise the busses will be zero
- // when they're read since they only get filled later on in the dsp chain.
- )
Add Comment
Please, Sign In to add comment