A collection of noisy, fun, cool, geeky, techy, wired or just plain wierd stuff for your consideration!

Pbindef!!

I have written the different parts of my track to include a sequence of transpositions, but because of the way i have written the code it seems too repetitive to me. I wrote the parts to be 16 bars long, so that after 4 bars it could transpose and after 4 more bars it would transpose to a different key and so on. This repeats through the whole track, so i felt that it was too formulaic and the key changes lose their impact after hearing the same pattern over and over. I wanted to add \ctranspose into the sequencing section of code, so that all parts in that ‘section’ would transpose :

e.g.
Ppar([Pdef(\cellopreintro)],1)
++
Ppar([Pdef(\glocksolo),Pdef(\glocksolo1),Pdef(\harps4intro),Pdef(\vox4intro),Pdef(\cello4intro),\ctranspose, -1],1)//TRANSPOSED SECTION
++
Ppar([Pdef(\cello),Pdef(\harps),Pdef(\timpani),Pdef(\kit),Pdef(\glock),Pdef(\break),Pdef(\harp2),Pdef(\kit1)],1)
++
etc.

I tried and failed, I have as yet been unable to figure out how to do this. Julio has shown me how to use a Pbindef to add parameters to a Pdef without having to write the code out in full. This will enable me to trigger any transpositions manually, although i would still like to find a way of automating this in the way described above.

Pbindefs work by referencing our original Pdef, and then stating additional parameters to add to it.
e.g.
Pdef(\harps,
(Pbind ( \type, \midi, \midiout, m,\chan, 0,
\scale, [ 0, 3, 7, 12, 15, 20, 22,]-24,
\degree, Pseq([ 2,3,6,5,4,7]-1, 4),
\dur, Prand([Pstutter(2,Pseq([12/8,2/8, 2/8]/2, 4)), Pseq([12/8,2/8, 2/8], 4),],1),
\db, -3,
\mtranspose, Pdef(\transposition)
)
)).play;//ORIGINAL PDEF

Pbindef(\harps, \ctranspose, -5); //THIS WILL USE ALL THE PREVIOUSLY EVALUATED CODE FOR PDEF(\HARPS) BUT ALSO ADD TRANSPOSITION

Note that once the Pbindef has been evaluated it changes the stored Pdef, so to change it back you will have to evaluate a new Pbindef stating the original values.
So it seems the Pbindef is good for live on-the-fly coding, but not so good for use in event stream players. I will, however, continue to look into this dilemma and try to come up with a suitable solution.

(I hope this is clear, but if not then feel free to find me and pick my brains, sometimes these things are easier to explain face to face)

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s