flies
Joined: May 20, 2008 Posts: 33 Location: NJ
|
Posted: Wed Sep 02, 2009 3:50 pm Post subject:
flies' noob questions Subject description: attenuate and play an audio bus |
 |
|
so, unless ppl think this is a bad idea, i'm going to bundle all my noob questions together. this may make them less searchable but it won't clog the board with my mess.
here's my current problem: i want to send the output of a two synths to one bus, and attenuate that bus, then send the attenuated sum to speakers.
here's what i've got (working off of the busses tutorial)
Code: | s.reboot;
(
SynthDef("tutorial-Infreq", { arg inBus, outBus, freqOffset = 0;
// this will add freqOffset to whatever is read in from the bus
Out.ar(outBus, SinOsc.ar(In.kr(inBus) + freqOffset, 0, 0.5));
}).send(s);
SynthDef("tutorial-Outfreq", {
arg centerFreq = 400, modFreq = centerFreq/2, modAmount = 0.025, bus;
Out.kr(bus, SinOsc.kr(modFreq, 0, centerFreq*modAmount, centerFreq));
}).send(s);
b = Bus.control(s,1);
c = Bus.audio(s,1);
)
(
f = 1000;
x = Synth.new("tutorial-Outfreq", [\bus, b,\modFreq,f, \modAmount,2]);
y = Synth.after(x, "tutorial-Infreq", [\inBus, b,\outBus, c]);
z = Synth.after(x, "tutorial-Infreq", [\inBus, b,\outBus, c, \freqOffset, 200]);
)
x.free; y.free; z.free;
b.free; |
so, now i have this bus c, and i want to attenuate it then output it. how do i do that? [/code] |
|
dewdrop_world

Joined: Aug 28, 2006 Posts: 858 Location: Guangzhou, China
Audio files: 4
|
Posted: Fri Sep 04, 2009 9:15 am Post subject:
|
 |
|
Attenuation = multiplication by a (positive) number less than 1.0
So you can use In.ar to read the signal from c, then multiply it, then Out.ar to bus 0 (main hardware output bus).
Or, if you want the mono signal to output in stereo:
Code: | Out.ar(0, (signal * attenuation) ! 2) |
!2 duplicates the 1-channel signal into 2 channels.
James _________________ ddw online: http://www.dewdrop-world.net
sc3 online: http://supercollider.sourceforge.net |
|