Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Retro Racing - A2
name
code content
// ======================= // MUSC 115 Assigment 2 // ======================= // SynthDefs (AM and FM) // ======================= // Your name: Alex Heldt ( SynthDef("first", {arg freq = 440, modfreq = 3, amp = 0.3, att = 0.03, rel = 0.5; 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("lowguy", {arg freq = 220, modfreq = 1, amp = 0.5, att = 0.03, rel = 0.2; var carrier, modulator, env; env = Env.perc( attackTime: att, releaseTime: rel, level: amp ).kr(2); modulator = SinOsc.ar(modfreq).range(0, 1); carrier = Saw.ar(freq: freq, mul: env * modulator); Out.ar(0, carrier ! 2); }).add; SynthDef("mainbass", {arg freq = 440, modindex = 10, amp = 0.1, pos = 0, gate = 1, att = 0.01, rel = 0.3; var carrier, modulator, freqdev, env, modfreq; 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; SynthDef("snaredeff", {arg out = 0, amp = 0.1, sinfreq = 200, att = 0.01, rel = 0.2, ffreq = 2000, pan = 0; var env, snd1, snd2, sum; env = Env.perc(att, rel, amp).kr(doneAction: 2); snd1 = HPF.ar( in: WhiteNoise.ar, freq: ffreq, mul: env ); snd2 = SinOsc.ar(freq: sinfreq, mul: env); sum = snd1 + snd2; Out.ar(out, Pan2.ar(sum, pan)); }).add; SynthDef("kicka", {arg out = 0, amp = 0.3, sinfreq = 40, glissf = 0.9, att = 0.01, rel = 0.5, pan = 0; var env, snd, ramp; env = Env.perc(att, rel, amp).kr(doneAction: 2); ramp = XLine.kr( start: sinfreq, end: sinfreq * glissf, dur: rel ); snd = SinOsc.ar(freq: ramp, mul: env); snd = Pan2.ar(snd, pan); Out.ar(out, snd); }).add; SynthDef("ams1", {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); freq = freq * LFNoise2.kr([2, 1/2, 1/3, 1/4, 1]).range(0.98, 1.01); carrier = Pulse.ar(freq: freq, mul: env * modulator); carrier = Mix.ar(carrier); carrier = LPF.ar(carrier, Line.kr(10000, 1000, att)); Out.ar(0, Pan2.ar(carrier, pos)); }).add; ) ( ~firstsynth = Pbind( \instrument, "first", \midinote, Pseq([80], 64), \dur, Pseq([(1/8)], inf), \amp, Pwhite(0.15, 0.2), \att, 0.1, \rel, 3, \modfreq, Pseq([12, 9, 7, 5, 3], inf), \pos, 0 ); ~bassthingy = Pbind( \instrument, "lowguy", \midinote, Pseq([40], 64), \dur, Pseq([(1/8)], inf), \amp, Pwhite(0.05, 0.1), \att, 0.01, \rel, 3, \modfreq, Pseq([12, 9, 7, 5, 3], inf), \pos, 0 ); ~weirdperc = Pbind( \instrument, "first", \midinote, Pseq([72, 73, 74, 75, 86, 85, 84, 83], 32), \ctranspose, [-3, -0], \dur, Pseq([(1/8), (1/8)], 32), \amp, Pwhite(0.25, 0.35), \att, 0.01, \rel, 0.2, \modfreq, Pwhite(10, 30), \pos, 0 ); ~basstrack = Pbind( \instrument, "mainbass", \dur, (1/2), \note, Pseq([1], 16), \ctranspose, -12, \modindex, Pseq([ 6, 7, 8, 9, 20, 9, 8, 4, 1 ], inf), \amp, Pseq([0.8, 0.82, 0.84, 0.88], inf), \att, 0.01, \rel, 0.3, \pos, 0 ); ~mainsnare = Pbind( \instrument, "snaredeff", \dur, Pseq([Rest(1), 1], 4), \att, 0.01, \rel, 0.1, \sinfreq, 180, \ffreq, 1000, \amp, 0.7 ); ~mainkick = Pbind( \instrument, "kicka", \dur, Pseq([0.5, 0.5, Rest(1.5), 0.5, Rest(1/4), (3/4)], 2), \att, 0.01, \rel, 0.3, \sinfreq, 60, \glissf, 0.98, \amp, 0.8, ); ~amsynthwub = Pbind( \instrument, "ams1", \midinote, Pseq([70, 70, 80, 70, 70, 60], 4), \ctranspose, -12, \dur, Pseq([0.25, 0.25, 0.5], inf), \amp, Pwhite(0.65, 0.7), \att, Pwhite(0.2, 0.3), \rel, 0.8, \modfreq, Pseq([7, 7, 1], inf) ); ~amsynthwubfast = Pbind( \instrument, "ams1", \midinote, Pseq([70, 70, 80, 70, 70, 60, 60], 4), \ctranspose, -12, \dur, Pseq([0.25, 0.25, 0.5, 0.25, 0.25, 0.25, 0.25], inf), \amp, Pwhite(0.65, 0.7), \att, Pwhite(0.05, 0.1), \rel, 0.7, \modfreq, Pseq([16, 16, 2, 16, 16, 2, 1], inf) ); ~amsynthwubfastsecond = Pbind( \instrument, "ams1", \midinote, Pseq([70, 70, 80, 70, 70, 60, 60], 4), \ctranspose, 0, \dur, Pseq([0.25, 0.25, 0.5, 0.25, 0.25, 0.25, 0.25], inf), \amp, Pwhite(0.45, 0.5), \att, Pwhite(0.05, 0.1), \rel, 0.7, \modfreq, Pseq([14, 14, 1, 14, 14, 1, 2], inf) ); ~amsynthbg = Pbind( \instrument, "ams1", \midinote, Pseq([80, 90, 95], 4), \ctranspose, 0, \dur, Pseq([1, 0.5, 0.5], 4), \amp, Pseq([0.4, 0.48, 0.5], 4), \att, Pseq([0.1, 0.2, 0.1], 4), \rel, 0.7, \modfreq, Pseq([16, 8, 16], 4), \pos, Pseq([-0.5, 0, 0.5, 0.5, 0, -0.5], 2) ); ~amsynthbg2 = Pbind( \instrument, "ams1", \midinote, Pseq([45, 45, 45], 4), \ctranspose, 0, \dur, Pseq([1, 0.5, 0.5], 4), \amp, Pseq([0.7, 0.78, 0.8], 4), \att, Pseq([0.1, 0.2, 0.1], 4), \rel, 0.5, \modfreq, Pseq([1.5, 1.5, 1.5, 4, 0.5, 0.5], 2), \pos, 0 ); ~amsynthbg3 = Pbind( \instrument, "ams1", \midinote, Pseq([45, 45, 45], 4), \ctranspose, -6, \dur, Pseq([1, 0.5, 0.5], 4), \amp, Pseq([0.95, 0.98, 1], 4), \att, Pseq([0.1, 0.2, 0.1], 4), \rel, 0.5, \modfreq, Pseq([1.5, 1.5, 1.5, 4, 0.5, 0.5], 2), \pos, 0 ); ~amsynthbg4 = Pbind( \instrument, "ams1", \midinote, Pseq([45, 43, 40], 4), \ctranspose, -12, \dur, Pseq([1, 0.5, 0.5], 4), \amp, Pseq([0.95, 0.98, 1], 4), \att, Pseq([0.1, 0.2, 0.1], 4), \rel, 0.5, \modfreq, Pseq([1.5, 1.5, 1.5, 8, 1, 1], 2), \pos, 0 ); ~amsynthbgfinal = Pbind( \instrument, "ams1", \midinote, Pseq([45, 43, 40], 4), \ctranspose, -12, \dur, Pseq([1, 0.5, 0.5], 4), \amp, Pseq([0.95, 0.98, 1], 4), \att, Pseq([0.1, 0.2, 0.1], 4), \rel, 0.5, \modfreq, Pseq([8, 8, 8, 16, 8, 16], 2), \pos, 0 ); ~amsynthbgoutro = Pbind( \instrument, "ams1", \midinote, Pseq([45, 43, 40, 35, 45, 43, 40, 45], 1), \ctranspose, -12, \dur, Pseq([2, 2, 2, 2, 2, 2, 2, 2], 2), \amp, Pseq([0.95, 0.98, 1, 0.4, 0.95, 0.98, 1, 0.5], 1), \att, Pseq([0.1, 0.2, 0.1, 0.5], 2), \rel, 0.7, \modfreq, Pseq([32, 16, 8, 4, 32, 16, 8, 16], 1), \pos, 0 ); ) ~bassthingy.play; ~firstsynth.play; ~weirdperc.play; ~basstrack.play; ~mainsnare.play; ~mainkick.play; ~amsynthwub.play; ~amsynthwubfast.play; ~amsynthbg.play; ~amsynthbg2.play; ~amsynthbg3.play; ~amsynthbg4.play; ~amsynthbgfinal.play; ~amsynthbgoutro.play; ( t = TempoClock(140/60); Pspawner({arg maestro; maestro.wait(8); maestro.seq(~firstsynth); maestro.seq(Ppar([~firstsynth, ~bassthingy])); maestro.seq(~weirdperc); maestro.seq(~basstrack); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwub])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwubfast])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwub])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwubfastsecond])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwub, ~amsynthbg])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwubfast, ~amsynthbg])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwub, ~amsynthbg2])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthwubfastsecond, ~amsynthbg2])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthbg3])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthbg4])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthbg3])); maestro.seq(Ppar([~basstrack, ~mainsnare, ~mainkick, ~amsynthbgfinal])); maestro.seq(~amsynthbgoutro); }).play(t); )
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