« Return to Thread: Score .sort problem?

Re: Score .sort problem?

by Josh Parmenter :: Rate this Message:

Reply to Author | View in Thread

Score.add expects a single OSC bundle... you are adding an array of bundles. You can iterate over them and add each one:

d = a.asScore(7.5);
x.do({arg me; d.add(me)})
d.sort;

or, since all of the \b_allocRead have the same time stamp, create a single bundle with it:

x = [0.0, [\b_allocRead ... ], [\b_allocRead ...]]

and add that to the Score.

Hope that helps.

Josh

On Apr 24, 2009, at 11:44 AM, Scott Worthington wrote:

(
x = [

[0.0, [\b_allocRead, 0, "/scsound/blackman.wav"]],
[0.0, [\b_allocRead, 1, "/scsound/blackmanHarris.wav"]],
[0.0, [\b_allocRead, 2, "/scsound/nuttall.wav"]],
[0.0, [\b_allocRead, 3, "/scsound/sinc.wav"]],
[0.0, [\b_allocRead, 4, "/Users/Scott/Compositions/PercElec/OperaGongs/cogong3-7.wav"]],
[0.0, [\b_allocRead, 5, "/Users/Scott/Compositions/PercElec/Bongos/bongo4-1.wav"]],
[0.0, [\b_allocRead, 6, "/Users/Scott/Compositions/PercElec/Bongos/bongo3-1.wav"]],
[0.0, [\b_allocRead, 7, "/Users/Scott/Compositions/PercElec/Bongos/bongo4-2.wav"]]

]
)

(
a =     Pbind(
    \instrument, \fileGran, 
    \sndbuf, 4, 
    \windowbuf, 2,
    \freq, Pseq([\rest, Pwhite(1,1)]),
    \delta, Pseq([1, Pwhite(0.005, 0.01, 730)]),
    \beg, Env([1000, 10000], [5]),
    \end, Pkey(\beg) + Env([100, 10000], [5]),
    \pan, Env([-1, 0.5, -0.5, 0.2, 1, 0], [5, 5, 5, 5, 6]),
    \trans, 1.8,
    \db, Env([-60, 0, -80], [3, 3])
    );
)


d = a.asScore(7.5);
d.add(x);
d.sort;

******************************************

/* Joshua D. Parmenter

http://www.realizedsound.net/josh/


“Every composer – at all times and in all cases – gives his own interpretation of how modern society is structured: whether actively or passively, consciously or unconsciously, he makes choices in this regard. He may be conservative or he may subject himself to continual renewal; or he may strive for a revolutionary, historical or social palingenesis." - Luigi Nono

*/

 « Return to Thread: Score .sort problem?