
// variation for piano webern op27 mvt3
// sustain ON - decay full

//~row0 = [3, 11, 10, 2, 1, 0, 6, 4, 7, 5, 9, 8];

~s3 = Scale.whole;
~s4 = Scale.chromatic;


TempoClock.default.tempo = 60/60;

~op =  Scale.new(#[3, 11, 10, 2, 1, 0, 6, 4, 7, 5, 9, 8], name: "op27_III");
~op1 =  Scale.new(#[4,5,1,3,0,2,8,9,10,6,7,11], name: "op27_I");

~vfp3 = Pseq(~row0, 4);
~vfp3_reverse = Pseq(~row0.reverse, 4);

~vfp2 = Pseq((0..11), 1);
~vfp2_reverse = Pseq((11..0), 1);

~fib =  Pseq([2,3.5,8,13,21], 4); // four interations of fibonnaci duration sequence
~fibr =  Pseq([2,3.5,8,13,21].reverse, 4); // counterpoint rhythmic inversion

// change from dur 8 to ~fib

Pbindef(\m_1, \dur, ~fib, \octave, 7, \scale,~op1, \degree,~vfp2, inf);
Pbindef(\m_2, \dur, ~fibr, \octave, 2, \scale,~op1, \degree,~vfp2_reverse, inf);

( Pdef(\m_1_CC,  Pbind( \type, \midi, \midicmd, \control, \midiout, ~m32_1,
	\ctlNum, 1, \control, Pexprand(77,127, inf) ,\dur, 1/16)).play(quant:4));

Pdef(\m_2_CC,  Pbind( \type, \midi, \midicmd, \control, \midiout, ~m32_2, \ctlNum, 1, \control, Pexprand(77,127, inf), \dur, 1/16 )).play(quant:4);


Pdef(\m_1).play(quant: 4);  Pdef(\m_1_CC).play(quant:4);  // TOP MOTHER
Pdef(\m_2).play(quant: 4);  Pdef(\m_2_CC).play(quant:4);  // BTM MOTHER NOTEON

Pdef(\m_1).stop; Pdef(\m_1_CC).stop;
Pdef(\m_2).stop; Pdef(\m_2_CC).stop;