{
   "description" : "SC recreation of Møffenzeef Mødular Stargazer drone synthesizer",
   "ancestor_list" : [],
   "author" : "kergener",
   "name" : "SCGAZER version 1.0",
   "is_private" : null,
   "id" : "1-5db",
   "code" : "// SCgazer versiøn 1.0.\r\n//\r\n// Møffenzeef Mødular Stargazer Drone Synth Emulation\r\n//\r\n// Description:\r\n//\r\n// STARGAZER is øne beast øf a drøne machine: dual wavetable øscillatør\r\n// with ninety arbitrary waveførms,\r\n// twø resønant løwpass filters, three wavetable LFØ's,\r\n// sample rate reductiøn, bit rate reductiøn,\r\n// amplitude mødulatiøn, and CMØS distørtiøn.\r\n// STARGAZER can handle the abuse it will inevitably take at gigs\r\n// and is røad ready før whatever horrible treatment lies ahead.\r\n// Stare intø the sky møuth agape while shredding\r\n// parallel dimensiøns with this hypnøtic vømitrøn.\r\n//\r\n// Website: https://www.moffenzeefmodular.com/stargazer\r\n//\r\n// This is an emulatiøn from what the website is describing.\r\n// I bet the hardware versiøn is much weirder and sø much more interesting.\r\n// If you like it gø buy it.\r\n//\r\n// This is definetly nøt a spønsøred emulatiøn.\r\n//\r\n// 25/04/2020\r\n// Bangkøk, Thailand\r\n// K.E.\r\n\r\n\r\n// Initialize randomly created waveforms\r\n\r\n(~wt = Array.fill(90, {\r\n\r\n\tvar numSegs = rrand (90, 20);\r\n\tEnv(\r\n\t\t(({rrand(0.0, 1.0)}!(numSegs-1))*[1, -1]).scramble,\r\n\t\t{rrand(1, 20)}!numSegs,\r\n\t\t'sine'\r\n\t\t// {rrand(-20,20)}!numSegs\r\n\t).asSignal(1024).asWavetable;\r\n});\r\n\r\n~vbuf = Buffer.allocConsecutive(90, s, 2048);\r\n~vbuf.do({\r\n\targ buf, i;\r\n\tbuf.loadCollection(~wt[i]);\r\n\r\n});)\r\n\r\n// Initialize the synth\r\n\r\n(SynthDef.new(\\stargazer, {\r\n\r\n\targ amp=1, out=0, pan=0.0, freq=440, gain=(-1.0), wave=0, sub=0, detune=1,\r\n\tmix=(-1.0), freq1=880, freq2=880, res1=0.0, res2=0.0, alias=44100, redux=24,\r\n\trate1 = 10, rate2 = 10, rate3 = 10, depth1 = 1, depth2 = 1, depth3 = 1,\r\n\tlfo1type1 = 0, \tlfo1type2 = 0, \tlfo1type3 = 0;\r\n\r\n\tvar sig, detuned, pitch, lfo1, lfo2, lfo3, filter1, filter2;\r\n\r\n\r\n\tlfo1=Select.kr(lfo1type1, [LFTri.kr(rate1), LFSaw.kr(rate1), LFPulse.kr(rate1)]);\r\n\tlfo2=Select.kr(lfo1type2, [LFTri.kr(rate2), LFSaw.kr(rate2), LFPulse.kr(rate2)]);\r\n\tlfo3=Select.kr(lfo1type3, [LFTri.kr(rate3), LFSaw.kr(rate3), LFPulse.kr(rate3)]);\r\n\tdetuned = Select.ar(sub, [VOsc.ar(wave, freq*detune), VOsc.ar(wave, (freq*0.5)*detune)]);\r\n\r\n\twave = ~vbuf[0].bufnum + wave;\r\n\tsig = VOsc.ar(wave, freq);\r\n\tsig = XFade2.ar(sig, detuned, mix);\r\n\tfilter1 = MoogLadder.ar(sig, freq1*lfo1.range(1, depth1), res1);\r\n\tsig = Decimator.ar(filter1, alias, redux);\r\n\tfilter2 = MoogLadder.ar(sig, freq2*lfo2.range(1, depth2), res2);\r\n\tsig = Splay.ar(filter2);\r\n\tsig = LeakDC.ar(sig);\r\n\tsig = XFade2.ar(sig, sig.clip, gain);\r\n\tsig=sig*amp*lfo3.range(1, depth3);\r\n\tsig = Limiter.ar(sig, 0.8);\r\n\r\n\tOut.ar(out, sig)\r\n\r\n}).add;)\r\n\r\n// Example\r\n\r\n(x=Synth(\\stargazer,\r\n\t[\r\n\t\t\\freq, 62.midicps, //Pitch\r\n\t\t\\wave, 9, //waveform selector 0 to 89 waveform\r\n\t\t\\detune, 1.midiratio, //detune parameter of the second oscillator\r\n\t\t\\sub, 1, // 1 takes detune one octave lower, 0 for using detune as it is\r\n\t\t\\mix, 0, // Mix for 2 oscillator. -1 is 1st oscillator and 1 for the 2nd oscillator only 0 is the middle\r\n\t\t\\freq1, 800, // Cutoff frequency for the 1st filter\r\n\t\t\\lfo1type1, 0, // LFO of 1st filter choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\t\\rate1, 10, // Rate of 1st LFO in Hz\r\n\t\t\\depth1, 1, // Depth of 1st LFO in Hz, 1 means no modulation, 0 is max\r\n\t\t\\alias, 44100, // Sample rate reduction in Hz\r\n\t\t\\redux, 24, // Bit rate reduction between 0-24 bits\r\n\t\t\\freq2, 800, // Cutoff frequency for the 2nd filter\r\n\t\t\\lfo1type2, 0, // LFO of 2nd filter choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\t\\rate2, 10, // Rate of 2nd LFO in Hz\r\n\t\t\\depth2, 1, // Depth of 2nd LFO in Hz, 1 means no modulation, 0 is max\r\n\t\t\\gain, -1, // Gain stage for distortion kinda effect -1 is clean, 1 is dirty\r\n\t\t\\lfo1type3, 0, // LFO of amplitude choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\t\\rate3, 10, // Rate of 3rd LFO in Hz\r\n\t\t\\depth3, 1, // Depth of 3rd LFO in Hz, 1 means no modulation, 0 is max\r\n\r\n]);)\r\n\r\n\r\n\r\n(x.set(\r\n\t\\freq, 55.midicps, //Pitch\r\n\t\\wave, 69, //waveform selector 0 to 89 waveform\r\n\t\\detune, 1.midiratio, //detune parameter of the second oscillator\r\n\t\\sub, 1, // 1 takes detune one octave lower, 0 for using detune as it is\r\n\t\\mix, 0, // Mix for 2 oscillator. -1 is 1st oscillator and 1 for the 2nd oscillator only 0 is the middle\r\n\t\\freq1, 1000, // Cutoff frequency for the 1st filter\r\n\t\\lfo1type1, 0, // LFO of 1st filter choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\\rate1, 1, // Rate of 1st LFO in Hz\r\n\t\\depth1, 1, // Depth of 1st LFO in Hz, 1 means no modulation, 0 is max\r\n\t\\alias, 44100/8, // Sample rate reduction in Hz\r\n\t\\redux, 8, // Bit rate reduction between 0-24 bits\r\n\t\\freq2, 600, // Cutoff frequency for the 2nd filter\r\n\t\\lfo1type2, 0, // LFO of 2nd filter choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\\rate2, 60, // Rate of 2nd LFO in Hz\r\n\t\\depth2, 0.3, // Depth of 2nd LFO in Hz, 1 means no modulation, 0 is max\r\n\t\\gain, -1, // Gain stage for distortion kinda effect -1 is clean, 1 is dirty\r\n\t\\lfo1type3, 2, // LFO of amplitude choose between 3 waveforms 0 for Triangle, 1 for Saw, 2 for Pulse\r\n\t\\rate3, 20, // Rate of 3rd LFO in Hz\r\n\t\\depth3, 1, // Depth of 3rd LFO in Hz, 1 means no modulation, 0 is max)\r\n))",
   "labels" : [
      "emulation",
      "drone",
      "synth",
      "wavetable"
   ]
}
