A global array that updates the current uses when changed.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

A global array that updates the current uses when changed.

Francis
Hello,
I have searched the archive and have not found an answer to this question - if I have missed it please direct me there.

I am trying to create a global array that will be used in numerous listPatterns that will update its instantiations when changed (In ChucK you just create a Global variable). A straight forward example would be...

~pitchset = [0,1,3,5,7,4];
Pbindef(\test, \instrument, \default, \degree, Pseq(~pitchset, inf)).play;
Pbindef(\test0, \instrument, \default, \degree, Prand(~pitchset, inf)).play;

and then all you need to do is change ~pitchset and all its uses are updated.

Thanks,
F
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: A global array that updates the current uses when changed.

madamdata
maybe what you're looking for is Pdefn?

Pdefn(\pitches, [0, 1, 3, 5, 7, 4]);

Pbind (
\degree, Pseq(Pdefn(\pitches))
).play;

If you redefine the Pdefn:

Pdefn(\pitches, [0, 3, 7, 10, 14])

all uses of that pattern should change.
Loading...