I am trying to map amplitude to a synth using a bus in order to smooth out the sine wave (remove high frequencies) based off of semi-random inputs from an outside source, but when I run this code, there is no sound.
s.boot;
(
SynthDef( \cello, {|rate = 440, amp = 0.2|
var signal;
signal = SinOsc.ar(rate, 0, amp);
Out.ar([0,1], signal)}
).add;)
h = Synth( \cello, [ \rate, 440, \amp, 0 ] );
c = Bus.control(s, 2);
c.scope;
Task({
var counter, pyAmp, newAmp, oldAmp = 0;
counter = 0;
{counter < 1}.while ({
pyAmp = 3.0.rand;
(pyAmp).postln;
d = { XLine.ar(oldAmp, pyAmp, 0.1) }.play(outbus: c);
("and").postln;
(oldAmp).postln;
oldAmp = pyAmp;
h.map(\amp, d);
0.1.wait;
})
}).play;
)
You have at least a couple of problems.
Thirdly (but not harmful) there's no point running those XLine synths at audio rate, you may as well use XLine.kr not XLine.ar