« Return to Thread: Is it possible to Pbind arrays?

Re: Is it possible to Pbind arrays?

by eresina :: Rate this Message:

Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi,

well, that ...    ( 'instrument': dynklankexample, 'dur': 2, 'freqs': [ 150, 300, 600, 900 ] )
... works but doing channel expansion (4 events):

what I'd like to know is if, for an instrument that takes an array as an argument, it is possible to Pbind a new array to the event's key in a similar way that we would do it using "setn" to change a Synth node's argument array value.

SynthDef('dynklankexample', {| freqs (#[100, 200, 300, 400]) |
var env = Linen.kr(Trig1.kr(1, 2), 0.01, 0.001, 1.0, doneAction: 2);
SendTrig.kr(Impulse.kr(1), 1, freqs);
Out.ar(0, DynKlank.ar(`[freqs, nil, [1,1,1,1]], WhiteNoise.ar * env))
}).store;


This is what I get posted. Only the first frequency of the original array is replaced by each one of the intended new array on 4 different nodes.

[ 1210622778.8125, an OSCresponder, [ /tr, 1003, 1, 900 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1003, 1, 200 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1003, 1, 300 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1003, 1, 400 ] ]

[ 1210622778.8281, an OSCresponder, [ /tr, 1002, 1, 600 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1002, 1, 200 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1002, 1, 300 ] ]
[ 1210622778.8281, an OSCresponder, [ /tr, 1002, 1, 400 ] ]

[ 1210622778.8438, an OSCresponder, [ /tr, 1001, 1, 300 ] ]
[ 1210622778.8438, an OSCresponder, [ /tr, 1001, 1, 200 ] ]
[ 1210622778.8438, an OSCresponder, [ /tr, 1001, 1, 300 ] ]
[ 1210622778.8438, an OSCresponder, [ /tr, 1001, 1, 400 ] ]

[ 1210622778.8438, an OSCresponder, [ /tr, 1000, 1, 150 ] ]
[ 1210622778.8438, an OSCresponder, [ /tr, 1000, 1, 200 ] ]
[ 1210622778.8594, an OSCresponder, [ /tr, 1000, 1, 300 ] ]
[ 1210622778.8594, an OSCresponder, [ /tr, 1000, 1, 400 ] ]

So I wonder if it might be possible to bind arrayed values to an event's key.

Thanks,

er



Date: Mon, 12 May 2008 16:00:07 -0400
To: sc-users@...
From: jamshark70@...
Subject: Re: [sc-users] Is it possible to Pbind arrays?

On May 12, 2008, at 1:52 PM, Eduard Resina Bertran wrote:

Is there any way to Pbind a whole array as the value to an event's key?

I mean something like:

Pbind(
\instrument, \dynklankexample,
\freqs, `[150, 300, 600, 900],
\dur, 2).play;

That does associate the whole array with the freqs key:

p = Pbind(
\instrument, \dynklankexample,
\freqs, `[150, 300, 600, 900],
\dur, 2).asStream;

p.next(());

--> ( 'instrument': dynklankexample, 'dur': 2, 'freqs': [ 150, 300, 600, 900 ] )

So what isn't happening that should be in your case? Pbind is constructing the event properly according to the pattern's specification.

hjh


: H. James Harkins

: jamshark70@...

: http://www.dewdrop-world.net

.::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..:


"Come said the Muse,

Sing me a song no poet has yet chanted,

Sing me the universal."  -- Whitman




Sigue de cerca las últimas tendencias y lo que más rompe MSN Vídeo
_______________________________________________
sc-users mailing list
sc-users@...
http://lists.create.ucsb.edu/mailman/listinfo/sc-users

 « Return to Thread: Is it possible to Pbind arrays?

LightInTheBox - Buy quality products at wholesale price