[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Volume in synths



Something like this (I didn't test it) works:

filePlayer = Synth("filePlayer", [1,1, 0, bufnum, 0, 1]);

slider = SCSlider(w, Rect(20, 140, 200, 30));
slider.action = {arg slider;
	filePlayer.set(\vol, slider.value.postln);
};

To set a slider's value on startup use:

slider.valueAction = 0.5;

or something like that.

Sam


On May 16, 2006, at 2:15 PM, Garyfitz123 wrote:


Hi, I am creating a patch at the minute and i want to control the volume of a
fileplayer using a slider. this is my synth def:


SynthDef("fileplayer", { arg rate=1, mono, vol=0, buffer, pan, loop;
var file, files, filem;
files = PlayBuf.ar(2, buffer, rate, loop:1);
filem = Pan2.ar(PlayBuf.ar(1, buffer, rate, loop:1), pan);
files = Balance2.ar(files[0], files[1], pan:0);
file = Select.ar(mono, [files, filem]);
Out.ar(0, file);
}).writeDefFile;

What do i need to do so that i can control the volume using a slider?

Also, is there any way of giving a slider a default value?
--
View this message in context: http://www.nabble.com/Volume-in- synths-t1630544.html#a4416897
Sent from the Supercollider - User forum at Nabble.com.

_______________________________________________
sc-users mailing list
sc-users@xxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-users