«Doppler Effect Composition» by rumush

on 06 Nov'15 14:16 in

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// 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
}
}
)
descendants
«PhyllisTub» by anonymous (private)
full graph
raw 2043 chars (focus & ctrl+a+c to copy)
reception
comments
javierlucasm user 21 Jul'23 01:30

ERROR: syntax error, unexpected NAME, expecting DOTDOT or ':' or ',' or ')' in interpreted text line 43 char 30:

pitchRatio = (344 – velocity) / 344; ^^^^^^^^

amplitude = 2.5 / distance.squared;

ERROR: Command line parse failed -> nil