
(
SynthDef(\BlockSynth,
 {
 	|tone1 = 5, noiseVol = 0.005, filterStart = 300, filterEnd = 1000, speed = 1, overlap = 1.5, atk=5, globAmp = 0.02
 	 frq1 = 1, frq5 = 0, frq3 = 0, frq7 = 0, frq9 = 0, frq11 = 0, frq13 = 0
 	 amp1 = 0, amp5 = 0, amp3 = 0, amp7 = 0, amp9 = 0, amp11 = 0, amp13 = 0|
 	 
 	var w1 = RLPF.ar(Blip.ar(frq1,tone1,amp1*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w2 = RLPF.ar(Blip.ar(frq5,tone1,amp5*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w3 = RLPF.ar(Blip.ar(frq3,tone1,amp3*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w4 = RLPF.ar(Blip.ar(frq7,tone1,amp7*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w5 = RLPF.ar(Blip.ar(frq9,tone1,amp9*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w6 = RLPF.ar(Blip.ar(frq11,tone1,amp11*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	var w7 = RLPF.ar(Blip.ar(frq13,tone1,amp13*globAmp) + PinkNoise.ar(noiseVol), Line.kr(filterStart,filterEnd,3),0.4)
 	* EnvGen.kr(Env.perc(speed/atk, speed*overlap, 20), doneAction:2);
 	
 	Out.ar(0, w1 ! 2);
 	Out.ar(0, w2 ! 2);
 	Out.ar(0, w3 ! 2);
 	Out.ar(0, w4 ! 2);
 	Out.ar(0, w5 ! 2);
 	Out.ar(0, w6 ! 2);
 	Out.ar(0, w7 ! 2);
 }).send(s);

SynthDef(\BuildingsSynth, 
  {arg freq = 440, dec = 0.35; 
  var sin = SinOsc.ar(freq, 0, 0.5) * EnvGen.kr(Env.perc(0.01, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);

SynthDef(
	\growSynth,
	{ | freq = 1800 |
	var wave = LPF.ar(Pulse.ar(freq,0.10,0.30), 300);
	var noise = PinkNoise.ar(0.02);
	Out.ar(0, wave ! 2);
	Out.ar(0, noise ! 2);
	}).send(s);

SynthDef(
	\hitSynth,
	{ | freq = 440, amp = 0.25, sus = 1.0 |
		// Wave form will be a sine wave with frequency 'freq', volume 'amp, and sustain 'sus'
		// doneAction:2 means the envelope will automatically free the synth after finishing.
	var wave = SinOsc.ar(freq, 0, amp) * EnvGen.kr(Env.perc(0, sus), doneAction:2);
		// Generate output waveform
	Out.ar(0, wave ! 2); // wave ! 2 means [wave,wave], same as stereo.
	}).send(s);

// Loopobj

SynthDef(\DropsSynth, 
  {arg freq = 440, dec = 0.35; 
  var sin = SinOsc.ar(freq, 0, 0.5) * EnvGen.kr(Env.perc(0.01, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);
  
SynthDef(\loopsine, 
  {arg freq = 440, dec = 0.35; 
  var sin = SinOsc.ar(freq, 0, 0.35) * EnvGen.kr(Env.perc(0.01, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);
  
SynthDef(\pad, 
  {arg freq = 440, att = 0.5, dec = 0.5; 
  var sin = SinOsc.ar(freq, 0, 0.20) * EnvGen.kr(Env.perc(att, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);
  
SynthDef(\ting, 
  {arg freq = 440, dec = 1.2; 
  var sin = SinOsc.ar(freq, 0, 0.45) * EnvGen.kr(Env.perc(0.01, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);

SynthDef(\ring, 
  {arg freq = 440, dec = 1.2; 
  var sin = SinOsc.ar(freq, 0, 0.25) * EnvGen.kr(Env.perc(0.01, dec), doneAction: 2); 
  Out.ar(0, sin ! 2);}).send(s);
  
// Spore
SynthDef(\SporeSynth,
	{ 	|basefreq = 500, basepulse = 0.5, 	w1f = 1.0, w1p = 1.0, w1a = 0.0, 
										w2f = 1.0, w2p = 1.0, w2a = 0.0, 
										w3f = 1.0, w3p = 1.0, w3a = 0.0, 
										w4f = 1.0, w4p = 1.0, w4a = 0.0, 
										w5f = 1.0, w5p = 1.0, w5a = 0.0, 
										w6f = 1.0, w6p = 1.0, w6a = 0.0, 
										w7f = 1.0, w7p = 1.0, w7a = 0.0, 
										w8f = 1.0, w8p = 1.0, w8a = 0.0| 
		var w1 = Pulse.ar(basefreq*w1f, w1p*basepulse, w1a);
		var w2 = Pulse.ar(basefreq*w2f, w2p*basepulse, w2a);
		var w3 = Pulse.ar(basefreq*w3f, w3p*basepulse, w3a);
		var w4 = Pulse.ar(basefreq*w4f, w4p*basepulse, w4a);
		var w5 = Pulse.ar(basefreq*w5f, w5p*basepulse, w5a);
		var w6 = Pulse.ar(basefreq*w6f, w6p*basepulse, w6a);
		var w7 = Pulse.ar(basefreq*w7f, w7p*basepulse, w7a);
		var w8 = Pulse.ar(basefreq*w8f, w8p*basepulse, w8a);
		Out.ar(0, w1);
		Out.ar(1, w2);
		Out.ar(0, w3);
		Out.ar(1, w4);
		Out.ar(0, w5);
		Out.ar(1, w6);
		Out.ar(0, w7);
		Out.ar(1, w8);
	}).send(s);

SynthDef(
	\triSynth,
	{ | freq = 440, amp = 0.2, sus = 1.0 |
		// Wave form will be a sine wave with frequency 'freq', volume 'amp, and sustain 'sus'
		// doneAction:2 means the envelope will automatically free the synth after finishing.
	var wave = SinOsc.ar(freq, 0, amp) * EnvGen.kr(Env.perc(0, sus), doneAction:2);
		// Generate output waveform
	Out.ar(0, wave ! 2); // wave ! 2 means [wave,wave], same as stereo.
	}).send(s);

SynthDef(
	\spinnerSynth,
	{
		| freq = 600.0, speed = 1.0 |
		var wave = SinOsc.ar(freq, 0, SinOsc.kr(speed, 0, 0.5, 0));
		Out.ar(0, wave ! 2);
	}).send(s);
)