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

Re: [sc-users] Adding values from Pbind to List



Hi Uri,


On May 5, 2009, at 8:43 AM, Uri Sala wrote:

How can I collect the values produced inside a Pbind as they are produced?



You can .collect the Pbind:

(
~myPitches = List[];
~myDurs = List[];

Pbind(
	\midinote,Pwhite(40,60),
	\dur,Pwhite(0.25,0.5)
).collect{| event |
	~myPitches.add(event[\midinote]);
	~myDurs.add(event[\dur]);
	event
 }.play;
)

~myPitches
~myDurs

One thing: the collect function should return the event.



Cheers,

Sergio

--
Sergio Luque
www.sergioluque.com





_______________________________________________
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/