Submit
Browse
Anonymous
Login
RSS
SuperCollider Code
Fork Code: Doppler Effect Composition
name
code content
// Rumush // https://mycelialcordsblog.wordpress.com/ // https://fungorumush.bandcamp.com/releases ( fork{ var pFreq = [108, 128, 132, 144, 162, 180, 192, 204, 216, 240, 264, 288, 324, 360, 384, 408, 432, 480, 528, 576, 648, 720, 768, 816, 864, 960, 1056, 1152, 1296, 1440, 1536, 1632, 1728, 1920, 2112, 2304, 2592, 2880, 3072, 3264 ]; var rep = 0; var t = 30; var speed = 10; var modF = 4; var arrayI = 31; n = 2; loop{ // Value Checkers if(rep >= 8, { t = 150 }, { t = [20,30].choose } ); if(arrayI < 0, {arrayI = 0} ); // Structure Info („rep”+rep).postln; („t”+t).postln; („speed”+speed).postln; („modF”+modF).postln; („n”+n).postln; („arrayI”+arrayI).postln; play{ // Sine Envelope var env1 = EnvGen.ar(Env.sine(90, 1), doneAction:2); // Doppler Effect var src1 = Mix.fill(8,{ var x, y, distance, velocity, pitchRatio, amplitude, azimuth, panValue, sound, index; index = Array.series(7, 8, 1); x = 50.rand; y = LFSaw.kr(1/IRand(speed, speed*3), 0, 100); distance = hypot(x, y); velocity = Slope.kr(distance); pitchRatio = (344 – velocity) / 344; amplitude = 2.5 / distance.squared; sound = if(0.6.coin, {Saw.ar(pFreq[index.choose] * pitchRatio, 1)}, {Saw.ar(pFreq[index.choose] * pitchRatio, LFPulse.ar(IRand(1, speed)))} ); azimuth = atan2(y, x); panValue = (azimuth / 0.5pi).clip2(1); Pan2.ar(sound, [panValue, panValue.neg].choose, amplitude) }); // Noise var src2 = Mix.fill(n,{ var index = Array.series(8, arrayI, 1); var fm = Pan2.ar(SinOsc.ar(pFreq.choose+SinOsc.ar(pFreq[index.choose]/IRand(2, modF), 0, 100000), 0, 1/64*LFSaw.ar(1/IRand(speed/2, speed*2)).linexp(-1, 1, 0.01, 1)), 0.9*SinOsc.ar(4/IRand(speed/2, speed*2))); var noise = Pan2.ar(BPF.ar(PinkNoise.ar(1), pFreq[index.choose]+SinOsc.ar(1.rand, 0, 108), Rand(0.05, 0.25)), 0.9*SinOsc.ar(1/IRand(speed/2, speed*2))); fm+noise }); // Structure Progression rep = rep+1; speed = speed-1; modF = modF*2; n = n+2; arrayI = arrayI-4; // Output (((src1)+(src2*(1/2)))*(0+env1)) };t.wait } } )
code description
Almost finished composition based on Doppler Effect from 'Operators-Hypot' in the help file. It just needs a couple of finishing touches and a way to terminate it, as it will run forever but after 8 repeates it just takes longer for it to do so.
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