MM – Coltrane’s Giant Steps

Generative project based on the famous Jazz song.

The backing keys and Sax/Piano solo chord inversions are randomly chosen as well as the drum hit times.

All properly shuffled for maximum swing.

All instruments are balanced and panned as close as possible to the original recording.

You’ll need the “ChordSymbol” extension for it to work.

Fixed CPU usage. No longer climbs up. Uses Max 50% Avg:30% from one core at 4.4Ghz from my 3900X

/////////////////////////////////////////////////////////////////////////////////////
// Generative project based on Coltrane's Giant Steps / 2020 - Matias Monteagudo.
/////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////
//Interface settings. Change / Comment out at will. You need to run the memory line, see below.
/////////////////////////////////////////////////////////////////////////////////////
(
// Server.supernova; (In development)
Server.local.options.device = "ASIO : ASIO PreSonus FireStudio";
Server.local.options.sampleRate=48000;
Server.local.options.hardwareBufferSize=128;
Server.local.options.memSize=131072‬‬; //We're gonna need more memory for this one. Evaluate this before booting. If not, you'll get a memory warning and a squeak sound.
s.waitForBoot;
s.scope;
s.freqscope;
s.plotTree;
)

/////////////////////////////////////////////////////////////////////////////////////
// Run each section separately.
/////////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////
// Reverb
/////////////////////////////////////////////////////////////////////////////////////
(
(
SynthDef(\verb, {
	|in, predelay=0.01, revtime=0.0001, lpf=7000,mix=0.5,amp=1,out=0|
	var dry,wet,temp,sig;
	dry = In.ar(in, 2);
	temp = In.ar(in, 2);
	wet=0;
	temp=DelayN.ar(temp, 0.2, predelay);
	32.do {temp=AllpassN.ar(temp, 0.05, {Rand(0.001,0.05)}!2,revtime);
		temp=LPF.ar(temp,lpf);
		wet=wet+temp;
	};
	sig=XFade2.ar(dry,wet,mix*2-1,amp);
	sig=CompanderD.ar(sig,0.2,1.0,1/12,0.05,0.1,2);
	sig=Limiter.ar(sig,0.9);
	Out.ar(out,sig);
}).add;
);

(
ServerTree.removeAll;
~revBus = Bus.audio(s,2);
~createReverb={~reverbSynth=Synth(\verb, [\mix,0.007, \in, ~revBus])};
ServerTree.add(~createReverb);
s.freeAll;
s.scope;
s.freqscope;
s.plotTree;
);
)


ServerTree.removeAll;

/////////////////////////////////////////////////////////////////////////////////////
// Synths
/////////////////////////////////////////////////////////////////////////////////////
(
(
SynthDef(\keys, {
	|gate=1,freq=200,vel=1,atk=0.01,dec=10,sus=0,rel=0.6,cur= -30, op1mul=0.1,op2mul=0.1,op3mul=0.1,op4mul=0.1|
	var env,op1,op2,op3,op4,sig;
	env=EnvGen.kr(Env.adsr(atk,dec,sus,rel,curve:cur),gate,doneAction:3);
	op1=SinOsc.ar(freq*4,mul:vel/2+op1mul);
	op2=SinOsc.ar(freq*3,op1,vel/2+op2mul);
	op3=SinOsc.ar(freq*2,op2,vel/2+op3mul);
	op4=SinOsc.ar(freq+NRand(-2,2,3),op3,vel);
	sig={DelayN.ar(op4,0.2,Rand(0.03,0.06))}!8;
	sig=RHPF.ar(sig,350,1,0.8);
	sig=LeakDC.ar(sig,mul:0.4);
	sig=Splay.ar(sig,0.5,1.3,-0.4);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\melody, {
	|gate=1,freq=200,vel=1,atk=0.01,dec=10,sus=0,rel=1,cur= -30, op1mul=0.1,op2mul=0.1,op3mul=0.1,op4mul=0.1|
	var env,op1,op2,op3,op4,sig;
	env=EnvGen.kr(Env.adsr(atk,dec,sus,rel,curve:cur),gate,doneAction:3);
	op1=SinOsc.ar(freq*6,mul:vel/2+op1mul);
	op2=SinOsc.ar(freq*3,op1,vel/2+op2mul);
	op3=SinOsc.ar(freq*2,op2,vel/2+op3mul);
	op4=WhiteNoise.ar(env*0.1)+SinOsc.ar(freq.lag(0.05)+SinOsc.ar(5,mul:Line.ar(0,60,1,1))*Line.ar(Rand(0.6,1),2,Rand(0.01,0.05),0.5),op3,vel);
	sig=LeakDC.ar(op4,mul:0.3);
	sig=Splay.ar(sig,0.4,0.7,-0.4);
	sig=RLPF.ar(sig,4000,0.2);
	sig=RHPF.ar(sig,300,0.2);
	sig=BPeakEQ.ar(sig,700,0.2,15,0.8);
	sig=sig;
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\melodyB, {
	|gate=1,freq=200,vel=1,atk=0.01,dec=10,sus=0,rel=1,cur= -30, op1mul=0.1,op2mul=0.1,op3mul=0.1,op4mul=0.1|
	var env,op1,op2,op3,op4,sig;
	env=EnvGen.kr(Env.adsr(atk,dec,sus,rel,curve:cur),gate,doneAction:3);
	op1=SinOsc.ar(freq*6,mul:vel/2+op1mul);
	op2=SinOsc.ar(freq*3,op1,vel/2+op2mul);
	op3=SinOsc.ar(freq*2,op2,vel/2+op3mul);
	op4=WhiteNoise.ar(env*0.08)+SinOsc.ar(freq.lag(0.2)+SinOsc.ar(5,mul:Line.ar(0,60,1,1))*Line.ar(Rand(0.0006,1),2,Rand(0.0001,0.005),0.5),op3,vel);
	sig=LeakDC.ar(op4,mul:0.3);
	sig=Splay.ar(sig,0.4,0.7,-0.4);
	sig=RLPF.ar(sig,4000,0.2);
	sig=RHPF.ar(sig,300,0.2);
	sig=BPeakEQ.ar(sig,700,0.2,15,0.8);
	sig=sig;
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\bass, {
	|gate=1,freq=200,vel=1,atk=0.01,dec=10,sus=0,rel=1,cur= -30, op1mul=0.1,op2mul=0.1,op3mul=0.1,op4mul=0.1|
	var env,op1,op2,op3,op4,sig;
	env=EnvGen.kr(Env.adsr(atk,dec,sus,rel,curve:cur),gate,doneAction:3);
	op1=SinOsc.ar(freq*4,mul:vel/2+op1mul);
	op2=SinOsc.ar(freq*3,op1,vel/2+op2mul);
	op3=SinOsc.ar(freq*2,op2,vel/2+op3mul);
	op4=SinOsc.ar(freq+NRand(-2,2,3),op3,vel);
	sig={DelayN.ar(op4,0.2,Rand(0.03,0.06))}!8;
	sig=LeakDC.ar(sig,mul:0.5);
	sig=Splay.ar(sig,0.5,1.2,0.3);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\ride, {
	|gate=1, vel=0.3|
	var env, sig;
	env=EnvGen.kr(Env.adsr(0.001,0.005,0.03,0.2,vel,-40),gate,doneAction:3);
	sig=WhiteNoise.ar();
	sig=BPF.ar(sig,{Rand(100,37000)}!64,0.016,3.5);
	sig=Splay.ar(sig,1,1,0.4);
	sig=BPeakEQ.ar(sig,4000,0.7,20,0.5);
	sig=LeakDC.ar(sig);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\hat, {
	|gate=1, vel=0.3|
	var env, sig;
	env=EnvGen.kr(Env.adsr(0.03,0.4,0,1,vel,-8),gate,doneAction:3);
	sig=WhiteNoise.ar();
	sig=BPF.ar(sig,{Rand(100,37000)}!64,0.016,3.5);
	sig=Splay.ar(sig,1,0.5,0.4);
	sig=BPeakEQ.ar(sig,4000,0.3,20,0.5);
	sig=LeakDC.ar(sig);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\crash, {
	|gate=1, vel=0.3|
	var env, sig;
	env=EnvGen.kr(Env.adsr(0.01,10,0.3,10,vel,-20),gate,doneAction:3);
	sig=WhiteNoise.ar();
	sig=BPF.ar(sig,{Rand(500,37000)}!16,0.5,1.5);
	sig=Splay.ar(sig,1,1,0.1);
	sig=BPeakEQ.ar(sig,600,0.8,20,0.2);
	sig=LeakDC.ar(sig);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\snare, {
	|gate=1, vel=0.3|
	var env, sig;
	env=EnvGen.kr(Env.adsr(0.001,0.005,1,0.6,vel,-10),gate,doneAction:3);
	sig=WhiteNoise.ar();
	sig=BPF.ar(sig,{Rand(200,1200)}!8,0.2,3.5);
	sig=Splay.ar(sig,1,1,0.3);
	sig=BPeakEQ.ar(sig,150,0.15,32,1);
	sig=BPeakEQ.ar(sig,200,0.15,22,1);
	sig=LeakDC.ar(sig);
	Out.ar(~revBus, sig*env);
}).add;
);

(
SynthDef(\kick, {
	|gate=1, vel=0.3|
	var env, sig;
	env=EnvGen.kr(Env.adsr(0.0001,0.005,1,0.5,vel,-8),gate,doneAction:3);
	sig=WhiteNoise.ar();
	sig=BPF.ar(sig,{Rand(20,40)}!42,0.1,6);
	sig=Splay.ar(sig,1,1,0.1);
	sig=BPeakEQ.ar(sig,70,0.15,32,1);
	sig=BPeakEQ.ar(sig,150,0.15,22,4);
	sig=RLPF.ar(sig,2000);
	sig=RHPF.ar(sig,50,1);
	sig=LeakDC.ar(sig);
	Out.ar(~revBus, sig*env);
}).add;
);
)

/////////////////////////////////////////////////////////////////////////////////////

// Song

/////////////////////////////////////////////////////////////////////////////////////
(
TempoClock.tempo= 143 / 120;
/////////////////////////////////////////////////////////////////////////////////////
//Swing
/////////////////////////////////////////////////////////////////////////////////////
(
~swingify = Prout({ |ev|
	var now, nextTime = 0, thisShouldSwing, nextShouldSwing = false, adjust;
	while { ev.notNil } {
		// current time is what was "next" last time
		now = nextTime;
		nextTime = now + ev.delta;
		thisShouldSwing = nextShouldSwing;
		nextShouldSwing = ((nextTime absdif: nextTime.round(ev[\swingBase])) <= (ev[\swingThreshold] ? 0)) and: {
			(nextTime / ev[\swingBase]).round.asInteger.odd
		};
		adjust = ev[\swingBase] * ev[\swingAmount];
		// an odd number here means we're on an off-beat
		if(thisShouldSwing) {
			ev[\timingOffset] = (ev[\timingOffset] ? 0) + adjust;
			// if next note will not swing, this note needs to be shortened
			if(nextShouldSwing.not) {
				ev[\sustain] = ev.use { ~sustain.value } - adjust;
			};
		} {
			// if next note will swing, this note needs to be lengthened
			if(nextShouldSwing) {
				ev[\sustain] = ev.use { ~sustain.value } + adjust;
			};
		};
		ev = ev.yield;
	};
});
);

/////////////////////////////////////////////////////////////////////////////////////

// Patterns

/////////////////////////////////////////////////////////////////////////////////////
// Chords
/////////////////////////////////////////////////////////////////////////////////////
x=Array.fill(4, {rrand(0.1, 1.0)}).normalizeSum; //Creates an array of 4 floats and the total sum is always 1. Used as weights on the chords and solos. (Thank you Codefinger)

//First variation

(
~keys1.stop;
~keys1=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \keys, \scale, Scale.chromatic, \octave,4,
				\dur, Pseq([1/2,1/2,1/2,1/4,5/4,1/2,1/2,1/2,1/2,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/4,3/4],inf),
				\legato, Prand([1/1,1/2,1/4],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([\Bmajor7_B,\Bmajor7_Ds,\Bmajor7_Fs,\Bmajor7_As],x,1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x,1),
					Pwrand([\Gmajor7_G,\Gmajor7_As,\Gmajor7_B,\Gmajor7_E],x, 1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Aminor7_A,\Aminor7_C,\Aminor7_E,\Aminor7_G],x, 1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x, 1),

					Pwrand([\Gmajor7_G,\Gmajor7_As,\Gmajor7_B,\Gmajor7_E],x, 1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Gbdom7_Gb,\Gbdom7_Bb,\Gbdom7_Db,\Gbdom7_Fb],x,1),
					Pwrand([\Bmajor7_B,\Bmajor7_Ds,\Bmajor7_Fs,\Bmajor7_As],x,1),
					Pwrand([\Fminor7_F,\Fminor7_Ab,\Fminor7_C,\Fminor7_E],x,1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),

					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Aminor7_A,\Aminor7_C,\Aminor7_E,\Aminor7_G],x, 1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x, 1),
					Pwrand([\Gmajor7_G,\Gmajor7_As,\Gmajor7_B,\Gmajor7_E],x, 1),
					Pwrand([\Csminor7_Cs,\Csminor7_E,\Csminor7_Gs,\Csminor7_B],x,1),
					Pwrand([\Fsdom7_F,\Fsdom7_As,\Fsdom7_Cs,\Fsdom7_E],x,1),
					Pwrand([\Bmajor7_B,\Bmajor7_Ds,\Bmajor7_Fs,\Bmajor7_As],x,1),

					Pwrand([\Fminor7_F,\Fminor7_Ab,\Fminor7_C,\Fminor7_E],x,1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Csminor7_Cs,\Csminor7_E,\Csminor7_Gs,\Csminor7_B],x,1),
					Pwrand([\Fsdom7_F,\Fsdom7_As,\Fsdom7_Cs,\Fsdom7_E],x,1),

				]),1),

				\vel, Pwhite(0.3,0.5,inf),
				\op1mul, Prand([0.1,0.5],inf),
				\op2mul, Prand([0.1,0.5],inf),
				\op3mul, Prand([0.1,0.5],inf),
			),
			(swingBase: 0.25, swingAmount: 0.7)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
]);
);

//Second variation

(
~keys2.stop;
~keys2=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \keys, \scale, Scale.chromatic, \octave,4,
				\dur, Pseq([1/2,1/2,1/2,1/4,7/16,13/16,1/2,1/2,1/2,1/2,1/2,1/4,7/16,13/16,1/2,1/4,5/4,1/2,1/4,7/16,13/16,1/2,1/4,5/4,1/2,1/4,7/16,13/16,1/4,3/4],inf),
				\legato, Prand([1/8,1/8],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([\Bmajor7_B,\Bmajor7_Ds,\Bmajor7_Fs,\Bmajor7_As],x,1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x,1),
					Pwrand([\Gmajor7_G,\Gmajor7_As,\Gmajor7_B,\Gmajor7_E],x, 1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					\Ebmajor7_G.asNotes,
					\Ebmajor7_G.asNotes,
					Pwrand([\Aminor7_A,\Aminor7_C,\Aminor7_E,\Aminor7_G],x, 1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x, 1),

					Pwrand([\Gmajor7_G,\Gmajor7_As,\Gmajor7_B,\Gmajor7_E],x, 1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Gbdom7_Gb,\Gbdom7_Bb,\Gbdom7_Db,\Gbdom7_Fb],x,1),
					\Bmajor7_Ds.asNotes,
					\Bmajor7_Ds.asNotes,
					Pwrand([\Fminor7_F,\Fminor7_Ab,\Fminor7_C,\Fminor7_E],x,1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),

					Pwrand([\Ebmajor7_Eb,\Ebmajor7_G,\Ebmajor7_Bb,\Ebmajor7_D],x, 1),
					Pwrand([\Aminor7_A,\Aminor7_C,\Aminor7_E,\Aminor7_G],x, 1),
					Pwrand([\Ddom7_D,\Ddom7_Fs,\Ddom7_A,\Ddom7_C],x, 1),
					\Gmajor7_As.asNotes,
					\Gmajor7_As.asNotes,
					Pwrand([\Csminor7_Cs,\Csminor7_E,\Csminor7_Gs,\Csminor7_B],x,1),
					Pwrand([\Fsdom7_F,\Fsdom7_As,\Fsdom7_Cs,\Fsdom7_E],x,1),
					Pwrand([\Bmajor7_B,\Bmajor7_Ds,\Bmajor7_Fs,\Bmajor7_As],x,1),

					Pwrand([\Fminor7_F,\Fminor7_Ab,\Fminor7_C,\Fminor7_E],x,1),
					Pwrand([\Bbdom7_Bb,\Bbdom7_D,\Bbdom7_F,\Bbdom7_A],x, 1),
					\Ebmajor7_G.asNotes,
					\Ebmajor7_G.asNotes,
					Pwrand([\Csminor7_Cs,\Csminor7_E,\Csminor7_Gs,\Csminor7_B],x,1),
					Pwrand([\Fsdom7_F,\Fsdom7_As,\Fsdom7_Cs,\Fsdom7_E],x,1),

				]),1),

				\vel, Pwhite(0.3,0.5,inf),
				\op1mul, Prand([0.1,0.5],inf),
				\op2mul, Prand([0.1,0.5],inf),
				\op3mul, Prand([0.1,0.5],inf),
			),
			(swingBase: 0.25, swingAmount: 0.7)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
]);
);

/////////////////////////////////////////////////////////////////////////////////////
// Main theme
/////////////////////////////////////////////////////////////////////////////////////
(
~melody1.stop;
~melody1=Ppar([
	Pseq([
		Pchain(
			~swingify,
			PmonoArtic(\melody, \scale, Scale.chromatic, \octave,5,
				\dur, Pseq([1/2,1/2,1/2,1/4,5/4,1/2,1/2,1/2,1/2,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/2,1/4,5/4,1/4,3/4],2),
				\legato, Prand([1/1.2,1/1.5],inf),
				\degree, Pseq([6,2,-1,-5,-2,-1,-3,2,-2,-5,-9,-6,-5,-7,-2,-1,-3,2,3,1,6,7,7,10,6,6],2),
				\vel, Pseq([0.3,0.35,0.3,0.35],inf),
				\op1mul, Pwhite(1,2,inf),
				\op2mul, Pwhite(1,2,inf),
				\op3mul, Pexprand(0.8,1,inf),
				\atk, Pexprand(0.07, 1,inf),
				\dec, 0.2,
				\sus, 0.2
			),
			(swingBase: 0.25, swingAmount: 0.7)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

/////////////////////////////////////////////////////////////////////////////////////
// Improv Sax solo
/////////////////////////////////////////////////////////////////////////////////////

//First variation

(
~melody2a.stop;
~melody2a=Ppar([
	Pseq([
		Pchain(
			~swingify,
			PmonoArtic(\melodyB, \scale, Scale.chromatic, \octave,5,
				\dur, Pwrand([
					Pseq([1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8],1),
					Pseq([1/4,1/16,1/16,1/8],1),
					Pseq([1/8,1/16,1/16,1/4],1)
				],
				[0.6,0.2,0.2],inf),

				\legato, Prand([1/1.2,1/1.3,1/1.5,1],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x,1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),

					Pwrand([Pseq(\Gmajor7_G.asNotes,1),Pseq(\Gmajor7_As.asNotes,1),Pseq(\Gmajor7_B.asNotes,1),Pseq(\Gmajor7_E.asNotes,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gbdom7_Gb.asNotes.reverse,1),Pseq(\Gbdom7_Bb.asNotes.reverse,1),Pseq(\Gbdom7_Db.asNotes.reverse,1),Pseq(\Gbdom7_Fb.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),

					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes,1),Pseq(\Csminor7_E.asNotes,1),Pseq(\Csminor7_Gs.asNotes,1),Pseq(\Csminor7_B.asNotes,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),

					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes.reverse,1),Pseq(\Csminor7_E.asNotes.reverse,1),Pseq(\Csminor7_Gs.asNotes.reverse,1),Pseq(\Csminor7_B.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),

				]),1),
				\vel, Pwrand([Pseq([0.2,0.2,0.25,0.25]*1.35,1), Pseq([0,0,0.2,0,0.2,0.3,0.2]*1.35,1), Pseq([0,0,0.2,0,0.2,0,0.2]*1.35,1),Pseq([0.2,0.2,0.2,0.3,0.2,0.2,0.2,0.3]*1.35,1)],[0.4,0.25,0.25,0.1],inf),
				\op1mul, Pexprand(1,2,inf),
				\op2mul, Pexprand(1,2,inf),
				\op3mul, Pexprand(0.4,2,inf),
				\atk, Pexprand(0.3, 1,inf),
				\dec, 0.2,
				\sus, 0.2
			),
			(swingBase: 0.125, swingAmount: 0.25)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

//Second variation

(
~melody2b.stop;
~melody2b=Ppar([
	Pseq([
		Pchain(
			~swingify,
			PmonoArtic(\melodyB, \scale, Scale.chromatic, \octave,5,
				\dur, Pwrand([
					Pseq([1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8],1),
					Pseq([1/4,1/16,1/16,1/8],1),
					Pseq([1/8,1/16,1/16,1/4],1),
					Pseq([1/16,3/8,1/32,1/32],1),
					Pseq([3/8,1/16,1/32,1/32],1),
					Pseq([1/16,1/32,1/32,3/8],1)
				],
				[0.1666,0.1666,0.1666,0.1666,0.1666,0.1666],inf),

				\legato, Prand([1/1.2,1/1.3,1/1.5,1],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x,1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),

					Pwrand([Pseq(\Gmajor7_G.asNotes,1),Pseq(\Gmajor7_As.asNotes,1),Pseq(\Gmajor7_B.asNotes,1),Pseq(\Gmajor7_E.asNotes,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gbdom7_Gb.asNotes.reverse,1),Pseq(\Gbdom7_Bb.asNotes.reverse,1),Pseq(\Gbdom7_Db.asNotes.reverse,1),Pseq(\Gbdom7_Fb.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),

					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes,1),Pseq(\Csminor7_E.asNotes,1),Pseq(\Csminor7_Gs.asNotes,1),Pseq(\Csminor7_B.asNotes,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),

					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes.reverse,1),Pseq(\Csminor7_E.asNotes.reverse,1),Pseq(\Csminor7_Gs.asNotes.reverse,1),Pseq(\Csminor7_B.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),

				]),1),
				\vel, Pwrand([Pseq([0.2,0.2,0.25,0.25]*1.35,1), Pseq([0,0,0.2,0,0.2,0.3,0.2]*1.35,1), Pseq([0,0,0.2,0,0.2,0,0.2]*1.35,1),Pseq([0.2,0.2,0.2,0.3,0.2,0.2,0.2,0.3]*1.35,1)],[0.4,0.25,0.25,0.1],inf),
				\op1mul, Pexprand(1,2,inf),
				\op2mul, Pexprand(1,2,inf),
				\op3mul, Pexprand(0.4,2,inf),
				\atk, Pexprand(0.3, 1,inf),
				\dec, 0.2,
				\sus, 0.2
			),
			(swingBase: 0.125, swingAmount: 0.25)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

//Third variation

(
~melody2c.stop;
~melody2c=Ppar([
	Pseq([
		Pchain(
			~swingify,
			PmonoArtic(\melodyB, \scale, Scale.chromatic, \octave,5,
				\dur, Pwrand([
					Pseq([1/4,1/16,1/16,1/8],1),
					Pseq([1/8,1/16,1/16,1/4],1),
					Pseq([1/16,3/8,1/32,1/32],1),
					Pseq([3/8,1/16,1/32,1/32],1),
					Pseq([1/16,1/32,1/32,3/8],1)
				],
				[0.2,0.2,0.2,0.2,0.2],inf),

				\legato, Prand([1/1.2,1/1.3,1/1.5,1],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x,1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),

					Pwrand([Pseq(\Gmajor7_G.asNotes,1),Pseq(\Gmajor7_As.asNotes,1),Pseq(\Gmajor7_B.asNotes,1),Pseq(\Gmajor7_E.asNotes,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gbdom7_Gb.asNotes.reverse,1),Pseq(\Gbdom7_Bb.asNotes.reverse,1),Pseq(\Gbdom7_Db.asNotes.reverse,1),Pseq(\Gbdom7_Fb.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),

					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes,1),Pseq(\Csminor7_E.asNotes,1),Pseq(\Csminor7_Gs.asNotes,1),Pseq(\Csminor7_B.asNotes,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),

					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes.reverse,1),Pseq(\Csminor7_E.asNotes.reverse,1),Pseq(\Csminor7_Gs.asNotes.reverse,1),Pseq(\Csminor7_B.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),

				]),1),
				\vel, Pwrand([Pseq([0.2,0.2,0.25,0.25]*1.35,1), Pseq([0,0,0.2,0,0.2,0.3,0.2]*1.35,1), Pseq([0,0,0.2,0,0.2,0,0.2]*1.35,1),Pseq([0.2,0.2,0.2,0.3,0.2,0.2,0.2,0.3]*1.35,1)],[0.4,0.25,0.25,0.1],inf),
				\op1mul, Pexprand(1,2,inf),
				\op2mul, Pexprand(1,2,inf),
				\op3mul, Pexprand(0.4,2,inf),
				\atk, Pexprand(0.3, 1,inf),
				\dec, 0.2,
				\sus, 0.2
			),
			(swingBase: 0.125, swingAmount: 0.25)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

/////////////////////////////////////////////////////////////////////////////////////
// Improv Piano solo
/////////////////////////////////////////////////////////////////////////////////////
(
~melody3.stop;
~melody3=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \keys, \scale, Scale.chromatic, \octave,5,
				\dur, Pwrand([
					Pseq([1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8,1/8],1),
					Pseq([1/4,1/16,1/16,1/8],1),
					Pseq([1/8,1/16,1/16,1/4],1)],
				[0.6,0.2,0.2],inf),


				\legato, Prand([2/1,1/1.2,1/1.3,1/1.5,1],inf),
				\degree, Pseq(ChordSymbol.degreeProgression([

					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x,1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),

					Pwrand([Pseq(\Gmajor7_G.asNotes,1),Pseq(\Gmajor7_As.asNotes,1),Pseq(\Gmajor7_B.asNotes,1),Pseq(\Gmajor7_E.asNotes,1)],x, 1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes.reverse,1),Pseq(\Ebmajor7_G.asNotes.reverse,1),Pseq(\Ebmajor7_Bb.asNotes.reverse,1),Pseq(\Ebmajor7_D.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gbdom7_Gb.asNotes.reverse,1),Pseq(\Gbdom7_Bb.asNotes.reverse,1),Pseq(\Gbdom7_Db.asNotes.reverse,1),Pseq(\Gbdom7_Fb.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),

					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Aminor7_A.asNotes,1),Pseq(\Aminor7_C.asNotes,1),Pseq(\Aminor7_E.asNotes,1),Pseq(\Aminor7_G.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ddom7_D.asNotes,1),Pseq(\Ddom7_Fs.asNotes,1),Pseq(\Ddom7_A.asNotes,1),Pseq(\Ddom7_C.asNotes,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Gmajor7_G.asNotes.reverse,1),Pseq(\Gmajor7_As.asNotes.reverse,1),Pseq(\Gmajor7_B.asNotes.reverse,1),Pseq(\Gmajor7_E.asNotes.reverse,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes,1),Pseq(\Csminor7_E.asNotes,1),Pseq(\Csminor7_Gs.asNotes,1),Pseq(\Csminor7_B.asNotes,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes,1),Pseq(\Bmajor7_Ds.asNotes,1),Pseq(\Bmajor7_Fs.asNotes,1),Pseq(\Bmajor7_As.asNotes,1)],x,1),
					Pwrand([Pseq(\Bmajor7_B.asNotes.reverse,1),Pseq(\Bmajor7_Ds.asNotes.reverse,1),Pseq(\Bmajor7_Fs.asNotes.reverse,1),Pseq(\Bmajor7_As.asNotes.reverse,1)],x,1),

					Pwrand([Pseq(\Fminor7_F.asNotes,1),Pseq(\Fminor7_Ab.asNotes,1),Pseq(\Fminor7_C.asNotes,1),Pseq(\Fminor7_E.asNotes,1)],x,1),
					Pwrand([Pseq(\Bbdom7_Bb.asNotes,1),Pseq(\Bbdom7_D.asNotes,1),Pseq(\Bbdom7_F.asNotes,1),Pseq(\Bbdom7_A.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Ebmajor7_Eb.asNotes,1),Pseq(\Ebmajor7_G.asNotes,1),Pseq(\Ebmajor7_Bb.asNotes,1),Pseq(\Ebmajor7_D.asNotes,1)],x, 1),
					Pwrand([Pseq(\Csminor7_Cs.asNotes.reverse,1),Pseq(\Csminor7_E.asNotes.reverse,1),Pseq(\Csminor7_Gs.asNotes.reverse,1),Pseq(\Csminor7_B.asNotes.reverse,1)],x,1),
					Pwrand([Pseq(\Fsdom7_F.asNotes.reverse,1),Pseq(\Fsdom7_As.asNotes.reverse,1),Pseq(\Fsdom7_Cs.asNotes.reverse,1),Pseq(\Fsdom7_E.asNotes.reverse,1)],x,1),

				]),1),
				\vel, Pwrand([Pseq([0.2,0.2,0.25,0.25]*2,1), Pseq([0,0,0.2,0,0.2,0.3,0.2]*1.5,1), Pseq([0,0,0.2,0,0.2,0,0.2]*2,1),Pseq([0.2,0.2,0.2,0.3,0.2,0.2,0.2,0.3]*2,1)],[0.4,0.25,0.25,0.1],inf),
				\op1mul, Prand([0.1,0.2],inf),
				\op2mul, Prand([0.1,0.5],inf),
				\op3mul, Prand([0.15,0.35],inf),
				\atk, 0.001,
			),
			(swingBase: 0.125, swingAmount: 0.25)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

/////////////////////////////////////////////////////////////////////////////////////
// Bass
/////////////////////////////////////////////////////////////////////////////////////
(
~bass.stop;
~bass=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \bass, \scale, Scale.chromatic, \octave,3,
				\dur, Pseq([
					1/2,1/2,1/2,3/8,3/8,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/2,1/2,1/2,3/8,3/8,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/2,1/2,1/2,3/8,3/8,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/2,1/2,1/2,3/8,3/8,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,


					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,


					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,


					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,

					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,
					1/4,1/4,1/4,1/4,1/4,1/4,1/4,1/4,


				],inf),
				\legato, Prand([1/1.3,1],inf),
				\degree,
				Pseq([
					11,9,7,-2,3,   3,1,0,-2,-4,-5,-3,
					7,5,3,1,-1,     6,11,6,5,7,8,10,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

					-1,9,7,-2,3,   -2,1,0,-2,-4,-5,-3,
					-5,5,3,1,-1,     6,11,6,5,7,8,10,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,


					11,8,9,8,7,-3,-2,2,    3,3,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,-3,-2,     6,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

					-1,10,9,8,7,6,1,2,   3, 2,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,1,-2,     -1,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,


					11,8,9,8,7,-3,-2,2,    3,3,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,-3,-2,     6,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

					-1,10,9,8,7,6,1,2,   3, 2,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,1,-2,     -1,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,


					11,8,9,8,7,-3,-2,2,    3,3,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,-3,-2,     6,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

					-1,10,9,8,7,6,1,2,   3, 2,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,1,-2,     -1,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,


					11,8,9,8,7,-3,-2,2,    3,3,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,-3,-2,     6,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

					-1,10,9,8,7,6,1,2,   3, 2,1,0,-2,-4,-5,-3,
					7,6,5,4,3,-2,1,-2,     -1,10,11,5,6,4,5,6,
					3,10,7,3,-3,2,4,6,     7,-5,7,-5,4,1,6,-6,
					-1,11,6,-1,-2,-1,1,2,   3,-2,-9,-2,6,1,-6,-6,

				],inf),

				\vel, Pseq([0.4,0.8],inf),
				\op1mul, Pexprand(0.1,0.2,inf),
				\op2mul, Pexprand(0.1,0.2,inf),
				\op3mul, Pexprand(0.1,0.2,inf),
				\atk, 0.01,
				\dec, 4,
				\sus, 0
			),
			(swingBase: 0.125, swingAmount: 0.2)
		),
		Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);


/////////////////////////////////////////////////////////////////////////////////////
// Ride
/////////////////////////////////////////////////////////////////////////////////////

//First variation

fork {
	~p1 = ParGroup.new;
	~ride1.stop;
	~ride1=Ppar([
		Pseq([
			Pchain(
				~swingify,
				Pbind(\instrument, \ride,
					\dur, Pseq([
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8],1),
					\legato, 4,
					\degree, 1,
					\vel, Prand([Pseq([0.6,0.3,0.2],1), Pseq([0.6,0.2,0.4],1), Pseq([1,0.5,0.7],1)],inf),
				),
				(swingBase: 0.125, swingAmount: 0.3)
			),
			Pfuncn({ q.stop; Event.silent(0) }, 1)
		])
	])
};

//Second variation.

fork {
	~p1b = ParGroup.new;
	~ride2.stop;
	~ride2=Ppar([
		Pseq([
			Pchain(
				~swingify,
				Pbind(\instrument, \ride,
					\dur, Pseq([
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,
						1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8,1/4,1/8,1/8],1),
					\legato, 1/2,
					\degree, 1,
					\vel, Prand([Pseq([0.6,0.3,0.2],1), Pseq([0.6,0.2,0.4],1), Pseq([1,0.5,0.7],1)],inf),
				),
				(swingBase: 0.125, swingAmount: 0.3)
			),
			Pfuncn({ q.stop; Event.silent(0) }, 1)
		])
	])
};

/////////////////////////////////////////////////////////////////////////////////////
// Hat
/////////////////////////////////////////////////////////////////////////////////////
(
~hat.stop;
~hat=Pbind(\instrument, \hat,
				\dur, 1/4,
				\legato, 1/2,
	\vel, Pseq([0,0.3],inf),
	\degree, 1,
			)
);

/////////////////////////////////////////////////////////////////////////////////////
// Crash
/////////////////////////////////////////////////////////////////////////////////////
fork {
    ~p2 = ParGroup.new;
~crash.stop;
~crash=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \crash, \legato,1/16,
				\dur,1/2,
				\vel, Pwrand([
					Pseq([0.2,0,0,0,        0.1,0.15,0.2,0.3,        0,0,0,0,                       0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0.1,0,0,0,                  0,0,0,0,                       0,0.2,0,0],1),
					Pseq([0.2,0,0,0,        0,0.2,0,0.1,               0,0,0,0,                       0.1,0,0,0],1),
					Pseq([0,0,0,0,           0,0.2,0,0,                 0,0.2,0,0,                     0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0,0,0,0,                    0,0,0,0,                        0,0.1,0,0.1],1),
					Pseq([0,0,0,0,          0,0,0.2,0,                  0,0,0,0,                        0,0,0.1,0],1),
					Pseq([0,0,0,0.2,        0,0,0,0,                    0.05,0.1,0.15,0.2,         0.2,0,0,0],1),
					Pseq([0,0,0,0,          0,0,0,0,                     0,0,0.2,0,                    0,0,0,0],1),
				],[0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125],inf)
			),
			(swingBase: 0.125, swingAmount: 0.3)
		),
	Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
};

/////////////////////////////////////////////////////////////////////////////////////
// Kick
/////////////////////////////////////////////////////////////////////////////////////
(
~kick.stop;
~kick=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \kick, \legato,1/2,
				\dur,1/8,
				\vel, Pwrand([
					Pseq([0.2,0,0,0,        0.1,0.15,0.2,0.3,        0,0,0,0,           0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0.1,0,0,0,                  0,0,0,0,           0,0.2,0,0],1),
					Pseq([0.2,0,0,0,        0,0.2,0,0.1,               0,0,0,0,           0.1,0,0,0],1),
					Pseq([0,0,0,0,           0,0.2,0,0,                 0,0.2,0,0,        0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0,0,0,0,                    0,0,0,0,           0,0.1,0,0.1],1),
					Pseq([0,0,0,0,          0,0,0.2,0,                 0,0,0,0,           0,0,0.1,0],1),
					Pseq([0,0,0,0.2,        0,0,0,0,                   0,0,0,0.1,        0.2,0,0,0],1),
					Pseq([0,0,0,0,          0,0,0,0,                    0,0,0.2,0,        0,0,0,0],1),
				],[0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125],inf)
			),
			(swingBase: 0.125, swingAmount: 0.3)
		),
	Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);

/////////////////////////////////////////////////////////////////////////////////////
// Snare
/////////////////////////////////////////////////////////////////////////////////////
(
~snare.stop;
~snare=Ppar([
	Pseq([
		Pchain(
			~swingify,
			Pbind(\instrument, \snare, \legato,1/2,
				\dur,1/8,
				\vel, Pwrand([
					Pseq([0.2,0,0,0,        0.1,0.15,0.2,0.3,        0,0,0,0,                      0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0.1,0,0,0,                 0,0,0,0,                       0,0.2,0,0],1),
					Pseq([0.2,0,0,0,        0,0.2,0,0.1,              0,0,0,0,                       0.1,0,0,0],1),
					Pseq([0,0,0,0,           0,0.2,0,0,                0,0.2,0,0,                     0,0,0,0.1],1),
					Pseq([0.2,0,0,0,        0,0,0,0,                   0,0,0,0,                        0,0.1,0,0.1],1),
					Pseq([0,0,0,0,          0,0,0.2,0,                 0,0,0,0,                        0,0,0.1,0],1),
					Pseq([0,0,0,0.2,        0,0,0,0,                  0.05,0.1,0.15,0.2,          0.2,0,0,0],1),
					Pseq([0,0,0,0,          0,0,0,0,                   0,0,0.2,0,                     0,0,0,0],1),
				],[0.125,0.125,0.125,0.125,0.125,0.125,0.125,0.125],inf)
			),
			(swingBase: 0.125, swingAmount: 0.3)
		),
	Pfuncn({ q.stop; Event.silent(0) }, 1)
	])
])
);
/////////////////////////////////////////////////////////////////////////////////////
// Song Sequence.
/////////////////////////////////////////////////////////////////////////////////////
(
Pseq([~melody1,~melody2a,~melody2b,~melody2c,~melody2a,~melody3,~melody3,~melody3,~melody3],inf).play(quant:1/8);
Pseq([~keys1,~keys1,~keys2,~keys2,~keys2,~keys2,~keys1,~keys2,~keys1,~keys2],inf).play(quant:1/8);
~bass.play(quant:1/8);
Pseq([~ride1,~ride1,~ride2,~ride2,~ride1,~ride1,~ride2,~ride2,~ride1,~ride2],inf).play(quant:1/8);
~hat.play(quant:1/8);
~crash.play(quant:1/8);
~kick.play(quant:1/8);
~snare.play(quant:1/8);
);
)
Author
418 PM
  • Platform:
  • Category: Composition
  • Revision: 1.4 More sax solo, ride, backing chord variations, more CPU optimization.
  • License: GNU General Public License family
  • Views: 659
  • Modified: 4 months ago
Chat about this patch on Discord!
Appreciate 5

Leave a Reply