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

[sc-users] Re: pattern: changing array while looping



The way I did this previously was by calling a function at the end of a
pattern to check what needed to be in the array. I found its timing to be
acceptable (even when running over 100 pbinds simultaneously), and it's a
native function, so there's no dallying with fragile quarks. The function is
called Pswitch, and a relevant Pbind looks like this:

  Pbind(
        \type, \set,
        \id, controlStructure.at(\instruments)[index].nodeID,
        \args, #[\freq,\amp,\t_trig],
        \t_trig, 1,
        \index, index,
        \currentPattern, controlStructure.at(\patternValues)[index],
        \freq, (Pswitch(patternStructure.at(\notePseqs),indexFunction) +
controlStructure.at(\noteOffset)[index] ).midicps,
        \dur,   Pswitch(patternStructure.at(\durPseqs),indexFollower) *
controlStructure.at(\tempoOffset)[index],
        \amp,  amplitudeFunction *
(1/controlStructure.at(\patternValues).size) //evenly distribute volume
       
     ).play(mainClock,quant:1);

See a draft of my version of "In C" I posted here to check how it works in
context:
http://ghfdrvtsyup.net/proxxxy/sc/20100102-inc2.sc


-- 
View this message in context: http://new-supercollider-mailing-lists-forums-use-these.2681727.n2.nabble.com/pattern-changing-array-while-looping-tp5559779p5561505.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.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/