Discussion:
Pseq([array that's changed on every repeat])
Ali Rustamov
2014-09-29 08:57:06 UTC
Permalink
Here is the code:

(
~seq = [4,2,7,2];

Pbind(
\dur, Pseq(
(~seq * Array.fill(~seq.size,{rrand(0.8,1.2)})).normalizeSum * ~seq.sum
,
inf
),
\degree, Pseq([0,1,2,4], inf)
).play
)


In this example
( ~seq * Array.fill(~seq.size,{rrand(0.8,1.2)}) ).normalizeSum * ~seq.sum
is calculates once and it's result is then repeated

How can I get it calculated every time before next repeat?

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Kuivila, Ronald
2014-09-29 12:50:39 UTC
Permalink
Hi,
The most general way to do this (i.e., you can adapt it to lots of other purposes) is to use a Prout,
build the pattern, and use embedInStream to have it run:

Prout({ | ev |
var seq = [1,2,3,4];
loop{
ev = Pseq( (seq * Array.fill(seq.size,{rrand(0.8,1.2)})).normalizeSum * seq.sum).embedInStream;
})

// holding onto the event with the ev variable is irrelevant in this example, but might
// be necessary is you embed a more elaborate pattern

RJK

___________________________________
From: owner-sc-users-lSHO60Uw44Cwa9SdKMSz+***@public.gmane.org [owner-sc-users-lSHO60Uw44Cwa9SdKMSz+***@public.gmane.org] on behalf of Ali Rustamov [alikthename-***@public.gmane.org]
Sent: Monday, September 29, 2014 4:57 AM
To: sc-users-lSHO60Uw44Cwa9SdKMSz+***@public.gmane.org
Subject: [sc-users] Pseq([array that's changed on every repeat])

Here is the code:

(
~seq = [4,2,7,2];

Pbind(
\dur, Pseq(
(~seq * Array.fill(~seq.size,{rrand(0.8,1.2)})).normalizeSum * ~seq.sum
,
inf
),
\degree, Pseq([0,1,2,4], inf)
).play
)


In this example
( ~seq * Array.fill(~seq.size,{rrand(0.8,1.2)}) ).normalizeSum * ~seq.sum
is calculates once and it's result is then repeated

How can I get it calculated every time before next repeat?

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Ali Rustamov
2014-09-29 17:02:09 UTC
Permalink
Thanks a lot Ronald, I didn't know about embedInStream method and was
getting silence
Post by Kuivila, Ronald
Hi,
The most general way to do this (i.e., you can adapt it to lots of other purposes) is to use a Prout,
Prout({ | ev |
var seq = [1,2,3,4];
loop{
ev = Pseq( (seq * Array.fill(seq.size,{rrand(0.8,1.2)})).normalizeSum * seq.sum).embedInStream;
})
// holding onto the event with the ev variable is irrelevant in this example, but might
// be necessary is you embed a more elaborate pattern
RJK
___________________________________
Sent: Monday, September 29, 2014 4:57 AM
Subject: [sc-users] Pseq([array that's changed on every repeat])
(
~seq = [4,2,7,2];
Pbind(
\dur, Pseq(
(~seq * Array.fill(~seq.size,{rrand(0.8,1.2)})).normalizeSum * ~seq.sum
,
inf
),
\degree, Pseq([0,1,2,4], inf)
).play
)
In this example
( ~seq * Array.fill(~seq.size,{rrand(0.8,1.2)}) ).normalizeSum * ~seq.sum
is calculates once and it's result is then repeated
How can I get it calculated every time before next repeat?
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Daniel Mayer
2014-09-29 17:50:45 UTC
Permalink
Another typical construct is Pn plus Plazy.
The Plazy gets a Function to generate the pattern(s) to be used.
In your example the Function would be independant from the rest
of the Pbind, so it can be written outside.

~seq = [4,2,7,2];

// Pseq defaults to repeats = 1

f = { Pseq(({ rrand(0.8, 1.2) } ! (~seq.size) * ~seq).normalizeSum * ~seq.sum) }



// shorter durations, 5 cycles

Pbind(
\dur, Pn(Plazy(f), 5)/10,
\degree, Pseq([0,1,2,4], inf)
).trace.play



Greetings

Daniel

-----------------------------
www.daniel-mayer.at
-----------------------------




_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/

Loading...