|
I can't seem to embed other patterns within Pbjorklund - is that not supported?
I'd like to do things like: Pbjorklund(Pshuf([3,5,8,13], inf),16,inf) But I get... ERROR: Primitive '_BasicNew' failed. -- Bjorn (http://phrontist.org) |
|
Here is another example of something I'd like to do:
var high = Pbind( I bet this has something to do with patterns being stateless... I probably need to determine the \amp values a bar a time and insert them into a stream somehow... Plazy? On Tue, Mar 15, 2011 at 9:14 PM, Bjorn Westergard <[hidden email]> wrote: I can't seem to embed other patterns within Pbjorklund - is that not supported? -- Bjorn (http://phrontist.org) |
|
hi Bjorn,
i must say i cheated a bit when writing the pattern version of the Bjorklund class. the sourcecode is just ^Pseq(Bjorklund(k, n), repeats, offset); and that won't work with patterns as arguments as you've discovered. i'll try to rework and will let you know. meanwhile, below are two slightly ugly ways around your issues. first issue... ( var arr= Pshuf([3,5,8,13], inf).asStream; a= Pbind( \dur, 0.25, \degree, Pseq([0, 5], inf), \amp, Pn(Plazy({Pbjorklund(arr.next.postln, 16)})) ).play ) your second example makes less sense to me. are you sure you want to switch bjorklund's n every event? better to let it finish the n= 12 or n= 16 it was doing and then select a new n at random me thinks. like this... ( var high = Pbind( \div, Prand([0, 1],inf), \amp, Plazy({Pswitch([Pbjorklund(9,16), Pbjorklund(9,12)], Pkey(\div).trace(prefix: "ampindex "))}), \dur, 1/Pswitch([Pn(16, 16), Pn(12, 12)], Pkey(\div)).trace, \degree, Pseq([0,1,2,3],inf)+3 ).play; ) _f 16 mar 2011 kl. 02.57 skrev Bjorn Westergard: > Here is another example of something I'd like to do: > > var high = Pbind( > \instrument, \sinepluck, > \scale, scale, > \div, Prand([16,12],inf) > \amp, Pbjorklund(9,Pkey(\div)), > \dur, 1/(Pkey(\div)), > \degree, Prand([0,1,2,3],inf)+3 > ); > > I bet this has something to do with patterns being stateless... I > probably need to determine the \amp values a bar a time and insert > them into a stream somehow... Plazy? > > On Tue, Mar 15, 2011 at 9:14 PM, Bjorn Westergard <[hidden email]> > wrote: > I can't seem to embed other patterns within Pbjorklund - is that not > supported? > > I'd like to do things like: > > Pbjorklund(Pshuf([3,5,8,13], inf),16,inf) > > But I get... > > ERROR: Primitive '_BasicNew' failed. > Index not an Integer > > -- > Bjorn (http://phrontist.org) #| fredrikolofsson.com musicalfieldsforever.com |# _______________________________________________ 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/ |
|
right, i've now updated the Pbjorklund class to also take patterns as
arguments. please download again: http://www.fredrikolofsson.com/f0blog/?q=node/434 now your two examples can be written like this... ( a= Pbind( \dur, 0.25, \degree, Pseq([0, 5], inf), \amp, Pbjorklund(Pshuf([3,5,8,13], inf).trace, 16) ).play ) ( var high = Pbind( \div, Prand([Pn(16, 16), Pn(12, 12)],inf).trace, \amp, Pbjorklund(9,Pkey(\div)), \dur, 1/(Pkey(\div)), \degree, Pseq([0,1,2,3],inf)+3 ).play; ) thanks for noticing, _f 16 mar 2011 kl. 18.58 skrev Fredrik Olofsson: > hi Bjorn, > i must say i cheated a bit when writing the pattern version of the > Bjorklund class. the sourcecode is just ^Pseq(Bjorklund(k, n), > repeats, offset); and that won't work with patterns as arguments as > you've discovered. i'll try to rework and will let you know. > meanwhile, below are two slightly ugly ways around your issues. > > first issue... > ( > var arr= Pshuf([3,5,8,13], inf).asStream; > a= Pbind( > \dur, 0.25, > \degree, Pseq([0, 5], inf), > \amp, Pn(Plazy({Pbjorklund(arr.next.postln, 16)})) > ).play > ) > > > your second example makes less sense to me. are you sure you want > to switch bjorklund's n every event? better to let it finish the n= > 12 or n= 16 it was doing and then select a new n at random me > thinks. like this... > ( > var high = Pbind( > \div, Prand([0, 1],inf), > \amp, Plazy({Pswitch([Pbjorklund(9,16), Pbjorklund(9,12)], > Pkey(\div).trace(prefix: "ampindex "))}), > \dur, 1/Pswitch([Pn(16, 16), Pn(12, 12)], Pkey(\div)).trace, > \degree, Pseq([0,1,2,3],inf)+3 > ).play; > ) > > _f > > > 16 mar 2011 kl. 02.57 skrev Bjorn Westergard: > >> Here is another example of something I'd like to do: >> >> var high = Pbind( >> \instrument, \sinepluck, >> \scale, scale, >> \div, Prand([16,12],inf) >> \amp, Pbjorklund(9,Pkey(\div)), >> \dur, 1/(Pkey(\div)), >> \degree, Prand([0,1,2,3],inf)+3 >> ); >> >> I bet this has something to do with patterns being stateless... I >> probably need to determine the \amp values a bar a time and insert >> them into a stream somehow... Plazy? >> >> On Tue, Mar 15, 2011 at 9:14 PM, Bjorn Westergard >> <[hidden email]> wrote: >> I can't seem to embed other patterns within Pbjorklund - is that >> not supported? >> >> I'd like to do things like: >> >> Pbjorklund(Pshuf([3,5,8,13], inf),16,inf) >> >> But I get... >> >> ERROR: Primitive '_BasicNew' failed. >> Index not an Integer >> >> -- >> Bjorn (http://phrontist.org) #| fredrikolofsson.com musicalfieldsforever.com |# _______________________________________________ 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/ |
|
I actually figured out the Penvir solution myself and am happy to see that's a sensible way to do it.
Thanks for updating the class, and for having written it in the first place!
On Wed, Mar 16, 2011 at 3:51 PM, Fredrik Olofsson <[hidden email]> wrote: right, i've now updated the Pbjorklund class to also take patterns as arguments. -- Bjorn (http://phrontist.org) |
|
Here's a quick demo I did this morning:
http://www.phrontist.org/2011/03/the-bjorklund-algorithm/ On Wed, Mar 16, 2011 at 10:36 PM, Bjorn Westergard <[hidden email]> wrote: I actually figured out the Penvir solution myself and am happy to see that's a sensible way to do it. -- Bjorn (http://phrontist.org) |
|
At Sat, 19 Mar 2011 21:48:52 -0400,
Bjorn Westergard wrote: > > Here's a quick demo I did this morning: > > http://www.phrontist.org/2011/03/the-bjorklund-algorithm/ Excellent demo! Seems I will need to download Pbjorklund posthaste :) Fredrik: Quarkify? hjh ... snip... > On Wed, Mar 16, 2011 at 3:51 PM, Fredrik Olofsson <[hidden email]> wrote: > > right, i've now updated the Pbjorklund class to also take patterns as arguments. > please download again: http://www.fredrikolofsson.com/f0blog/?q=node/434 -- James Harkins /// dewdrop world [hidden email] http://www.dewdrop-world.net "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman blog: http://www.dewdrop-world.net/words audio clips: http://www.dewdrop-world.net/audio more audio: http://soundcloud.com/dewdrop_world/tracks _______________________________________________ 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/ |
|
20 mar 2011 kl. 03.59 skrev James Harkins:
nice demo Bjorn. _f
#| fredrikolofsson.com musicalfieldsforever.com |# |
|
Am 20.03.11 12:26, schrieb Fredrik Olofsson:
>> Fredrik: Quarkify? > > > alright. done. thanks so much :))) stefan _______________________________________________ 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/ |
| Powered by Nabble | See how NAML generates this page |
