On December 3, 2015 6:23:28 AM marcelo conduru <marcelomc2011@xxxxxxxxx> wrote:
What I mean with repetition is: Pseq([ ], this); In my example was the
number 4 - looping three times Pwhite.
delta = Pseq([Pseq([Pwhite(0.1, 0.3, 9)], 4)]);
To put a lag before the loop (or repetition) I did: Pseq([Pseq([Pwhite(0.1,
0.3, 9), 2], 2)]); 2 sec. and than, again. It's working.
What I need now is different lags for more repetitions.
I'm not sure what is a better word to use here, but "lag" in events refers to delaying the sound of one event only. I was confused by this. Maybe it's that you want different durations of rests? Or phrases consisting of several short notes followed by one long note?
Like this:
Pseq([Pseq([Pwhite(0.1, 0.3, 9), Pswitch([2, 1.5], Pseq([0, 1])], 3)]);
So what I expect is before the first loop, 2 sec. Before the second, 1.5.
I was also confused because you're saying the long note comes "before," but in your pattern, it's written after. No matter, really, but it made it a bit harder for me to figure out what you meant. So I didn't answer right away.
So if I read you right, you want:
Pseq([
... short durs: the whole pattern...,
... a single long dur taken from another stream...
], inf)
If you just write the long-note pattern in the second spot, then you'll get several long notes in a row, which is not right.
You could write a one-value pattern for the long note, such as Pwhite(5, 9, 1), but then each long value will have no knowledge of the previous one. That may be ok in some cases, but not all.
If you do want a stream of long values that keeps its state, you do need asStream here. Then you just need something that will take only one value from the stream before giving up control. That is Pfin. See the chapter of the practical guide to patterns on repetition and constraint patterns.
Pseq([
... short durs: the whole pattern...,
Pfin(1, longDurPattern.asStream)
], inf)
Note that you cannot leave out asStream inside the Pfin. If you omit it, then longDurPattern will reset every time. This is for the case where you don't want it to reset.
You shouldn't need a Prout this way.
hjh
Sent with AquaMail for Android
http://www.aqua-mail.com
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/