Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: L115bertango (MUSC115)
name
code content
( SynthDef("am1", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, rel = 3; var carrier, modulator, env; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = SinOsc.ar(freq: freq, mul: env * modulator); Out.ar(0, carrier ! 2); }).add; SynthDef("am2", {arg freq = 440, modfreq = 2, amp = 0.2, att = 0.01, sus = 0.2, rel = 3, gate = 1, pos = 0; var carrier, modulator, env; env = Env.asr( attackTime: att, sustainLevel: sus, releaseTime: rel ).kr(doneAction: 2, gate: gate, mul: amp); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = SinOsc.ar(freq: freq, mul: env * modulator); Out.ar(0, Pan2.ar(carrier, pos)); }).add; SynthDef("fm1", {arg freq = 440, modfreq = 1.6, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.7; var carrier, modulator, freqdev, env; // i = d/m, so d = m*i freqdev = modfreq * modindex; modulator = Saw.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).add; SynthDef("fm2", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env, modfreq; // i = d/m, so d = m*i modindex = Line.kr(modindex, 1, att); modfreq = freq / 2; freqdev = modfreq * modindex; modulator = SinOsc.ar(freq: modfreq, mul: freqdev); carrier = SinOsc.ar(freq: freq + modulator); env = Env.asr( attackTime: att, sustainLevel: amp, releaseTime: rel ).kr(doneAction: 2, gate: gate); carrier = Pan2.ar(in: carrier, pos: pos, level: env); Out.ar(0, carrier * 0.5); }).add; ) ( ~bass1= Pbind( \instrument, "fm2", \scale, Scale.minor, \degree, Pseq([ Pseq([4,1,1],6), Pseq([5s,2s,6,7,6],2), Pseq([4,0,2],2), Pseq([4,1,1,2,1],2),1]), \ctranspose, -12, \dur, Pseq([ Pseq([1.5,1.5,1],6), Pseq([1.5,1,1/2,1/2,1/2],2), Pseq([1.5,1.5,1],2), Pseq([1.5,1,1/2,1/2,1/2],2)],1), \amp, 0.5, \legato, 0.1 ); ~bass2= Pbind( \instrument, "fm2", \scale, Scale.minor, \degree, Pseq([ Pseq([3,6,6],2), Pseq([2s,5s,5s,6,5s],2), Pseq([2s,5s,5s],2), Pseq([1,3s,3s,1],1),1]), \ctranspose, -24, \dur, Pseq([ Pseq([1.5,1.5,1],2), Pseq([1.5,1,1/2,1/2,1/2],2), Pseq([1.5,1.5,1],2), Pseq([1.5,1.5,1,1.5],1)],1), \amp, 0.5, \legato, 0.1 ); ~vio1= Pbind( \instrument, "am2", \scale, Scale.minor, \degree, Pseq([ Pseq([4,8,8],6), Pseq([5s,8,8],2), 5,8,8,7,8,8, Pseq([4,8,8],2) ],inf), \dur, Pseq([2,1,1], inf), \amp, 0.6, \rel, 0.5 ); ~melody1= Pbind( \instrument, "am1", \scale, Scale.dorian, \degree,Pseq([1,8,1,7,6,5,4,5,5,6,7,1,6,5,4,3s,4],1), \dur, Pseq([1,5.5,0.5,0.5,0.5,0.5,0.5,7,0.5,0.5,5.5,0.5,0.5,0.5,0.5,0.5,7],1), \amp, 0.5 ); ~melody2= Pbind( \instrument, "am1", \scale, Scale.dorian, \degree,Pseq([4,5,6,1,6,5,6,4,5,5,4,5,6,5,6,5,4,3s],inf), \dur, Pseq([0.5,0.5,5.5,0.5,0.5,0.5,0.5,0.5,8,5.5,0.5,0.5,0.5,0.25,0.25,0.25,0.25,7],1), \amp, 0.5 ); ~viodrop= Pbind( \instrument, "fm2", \scale, Scale.minor, \degree, Pseq([ Pn([4,6,8],6), Pn([5s,6,7s],6), Pn([0,2,4],12), Pn([3,6,8],6), Pn([5s,6,7s],6) ],2), \dur, Pseq([1,2,0.5,1,0.5,3],inf) ); ~bdrop=Pbind( \instrument, "fm1" , \scale, Scale.minor, \degree, Pseq([4,4,0,4,-1,2s],1), \ctranspose, -24, \dur, 8, ); ) ~melody1.play; ~melody2.play; ~bass1.play; ~bass2.play; ~vio1.play; ~viodrop.play; ~bdrop.play; ( t=TempoClock(155/60); Pspawner({ arg maestro; maestro.par(Ppar([~bass1,~vio1])); maestro.wait(15); maestro.seq(~melody1); maestro.par(~melody2); maestro.wait(1); maestro.seq(~bass2); maestro.suspendAll; maestro.wait(6); maestro.par(~melody1); maestro.wait(1); maestro.par(Ppar([~viodrop,~bdrop])); maestro.wait(31); maestro.seq(~melody2); }).play(t) ) s.makeWindow
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