Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Fm7_moog_1
name
code content
( SynthDef(\fm7_moog_1, { arg note = 60,out_bus=0,amp=0.5,sustain = 0.5,release = 0.5,cutoff = 10000,rq = 1,pan = 0,lfo_speed = 5,lfo_amp = 0; var ctls, mods, chans,out,pitch,gate, coars1= 1 ,fine_1= 1.995 ,detun1= 39 ,noteBlok1= 0 , coars2= 0.5 ,fine_2= 1.0 ,detun2= 14 ,noteBlok2= 1 , coars3= 1 ,fine_3= 1.047 ,detun3= 39 ,noteBlok3= 0 , coars4= 0.5 ,fine_4= 1.0 ,detun4= 1 ,noteBlok4= 1 , coars5= 0.5 ,fine_5= 1.0 ,detun5= 14 ,noteBlok5= 1 , coars6= 2 ,fine_6= 1.0 ,detun6= 1 ,noteBlok6= 1 , envAmp1,envAmp2,envAmp3,envAmp4,envAmp5,envAmp6,env1, envEnv1,envEnv2,envEnv3,envEnv4,envEnv5,envEnv6,envAmp,envEnv,lfo; gate = Trig1.kr(1, sustain); envEnv1 = Env.new([0.0002 ,1.0 ,1.0 ,1.0 ,0.0002], [0.0309 ,0.0 ,0.0 ,3.2796], [3.0 ,-3.0 ,-3.0 ,-3.0],3); envAmp1 = EnvGen.kr(envEnv1,gate,doneAction: 0); envEnv2 = Env.new([0.0001 ,0.2296 ,0.3535 ,0.2296 ,0.0001], [0.0836 ,0.185 ,3.9328 ,5.4112], [3.0 ,3.0 ,-3.0 ,-3.0],3); envAmp2 = EnvGen.kr(envEnv2,gate,doneAction: 0); envEnv3 = Env.new([0.0002 ,1.0 ,0.8414 ,0.6494 ,0.0002], [0.0348 ,0.0632 ,0.4163 ,2.8341], [3.0 ,-3.0 ,-3.0 ,-3.0],3); envAmp3 = EnvGen.kr(envEnv3,gate,doneAction: 0); envEnv4 = Env.new([0.0 ,0.1059 ,0.2304 ,0.1496 ,0.0], [0.008 ,0.2794 ,1.8094 ,3.7047], [3.0 ,3.0 ,-3.0 ,-3.0],3); envAmp4 = EnvGen.kr(envEnv4,gate,doneAction: 0); envEnv5 = Env.new([0.0 ,0.0244 ,0.0531 ,0.0376 ,0.0], [0.0045 ,0.1397 ,1.8094 ,2.7788], [3.0 ,3.0 ,-3.0 ,-3.0],3); envAmp5 = EnvGen.kr(envEnv5,gate,doneAction: 0); envEnv6 = Env.new([0.0002 ,0.4597 ,1.0 ,0.6494 ,0.0002], [0.0136 ,0.6447 ,1.8094 ,9.5991], [3.0 ,3.0 ,-3.0 ,-3.0],3); envAmp6 = EnvGen.kr(envEnv6,gate,doneAction: 0); envEnv = Env.new([0,1,1,0], [0.0001,sustain,release],[0,0,0]); envAmp = EnvGen.kr(envEnv,gate,doneAction:2); lfo = LFTri.kr(lfo_speed); lfo = LinLin.ar(lfo, 0, 1, lfo_amp.neg.midiratio , lfo_amp.midiratio); pitch = note.midicps; ctls = [ [coars1 * fine_1 * ((pitch * noteBlok1) + ((detun1-7)/32))* lfo, 0, envAmp1], [coars2 * fine_2 * ((pitch * noteBlok2) + ((detun2-7)/32))* lfo , 0, envAmp2], [coars3 * fine_3 * ((pitch * noteBlok3) + ((detun3-7)/32))* lfo , 0, envAmp3], [coars4 * fine_4 * ((pitch * noteBlok4) + ((detun4-7)/32))* lfo , 0, envAmp4], [coars5 * fine_5 * ((pitch * noteBlok5) + ((detun5-7)/32))* lfo , 0, envAmp5], [coars6 * fine_6 * ((pitch * noteBlok6) + ((detun6-7)/32))* lfo, 0, envAmp6] ]; mods = [ [0, 12.5664, 0, 0, 0, 0], [0, 1.704, 0, 0, 0, 0], [0, 0, 0, 12.5664, 12.5664, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12.5664], [0, 0, 0, 0, 0, 0] ]; chans = [0, 1, 2, 3, 4, 5]; out = FM7.ar(ctls, mods).slice(chans) * -12.dbamp; out = Mix.new([ (out[0] * 1), (out[1] * 0), (out[2] * 1), (out[3] * 0), (out[4] * 0), (out[5] * 0), ]); out = RLPF.ar(out,cutoff,rq); Out.ar(out_bus,Pan2.ar(out,pan,amp)); }).add; ) Synth(\fm7_moog_1,[\sustain,3,\release,3,\amp,0.5,\lfo_speed,5,\lfo_amp,0.05]); ( u = (( Pdef(\ss, Pbind( \instrument, \fm7_moog_1, \note,Prand(#[[0, -5], [0, -7], [0, -3], [0, 4]], inf) + Pxrand(#[48,50,52,53,55,57,59,60,62,64,65,67,69],inf), \amp,0.25, \cutoff,Pwhite(300,5000,inf), \rq,0.15, \sustain,4, \lfo_amp,0, \release,3, \pan,Pwhite(-0.8,0.8,inf), \dur,3 ))).play; ) ) u.stop;
code description
use markdown for formating
category tags
comma separated, i.g. "wild, siren" (do not enter default SC class names, please)
ancestor(s)
comma separated identificators, i.g. "1-C,1-1,1-4M,1-x"
Private?
the code will be accessible by direct url and not visible in public activity
signup to submit public code without captcha
comment of change