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

Re: [sc-users] Freeing All Synths in an Array



Hey,

this is perfectly ok, but every item in the array is propably played in one separate channel, so you sohould mix it down to the appropriate number of channels you want it to be.

SynthDef(\thing, {
	var array=Array.fill(10, {SinOsc.ar(Rand(200, 2000)});
	
	Out.ar(0, array.sum / 10)) // mono
	Out.ar(0, array.clump(5).sum / 10)) // 5 channels

})


For more information, I would recommend reading SynthDef Help and e.g. "Presented in Living Stereo" of the "Getting Started With SC" tutorial by famous Scott Wilson.

lg
	Till


On 07.05.2009, at 11:22, Jeremy Zuckerman wrote:

thanks till! exactly what i need to know. similarly, if i want to make an array of ugens in a synthdef, how do i do that again??
eg
SynthDef(\thing, {
	array=Array.fill(10, {SinOsc.ar(Rand(200, 2000)});
	...

it seems that when i try this i only hear one SinOsc.  thanks again!
-j

On May 7, 2009, at 2:15 AM, LFSaw wrote:

Hey,

to free them you have to store them in an array:

var synths;
synths = 10.collect{Synth(\Sin))


synths.do(_.free)


hope that helps
	Till

On 07.05.2009, at 11:09, Jeremy Zuckerman wrote:

hello,

i apologize for the basic question. haven't used sc in a while and have gotten very rusty. how would i free an entire array of synths:

eg

var synth;
10.do{synth= Synth(\Sin))

trying to do something like synth.free...

many thanks!
-j

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/