«Sunday's patch & shader: Value Noise» by TatriX

on 15 Dec'24 18:00 in
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
(
Ndef(\valuenoise, {
    var sig = 0;
    var note = Demand.kr(Impulse.kr(1/8), 0, Dseq([0, 12, 0, 10, 0], inf));
    var freq = (110 + (24 + note).midicps).lag(1/2);

    var trig = Impulse.kr(1) + Impulse.kr(1/9, 1/2);
    var dm = SinOsc.ar(
        freq: Env.perc(0, 0.01).kr(0, trig).exprange(freq*4, freq/4),
        mul: 0.5*Env.perc(0.01, 0.5).kr(0, trig),
    ) + BPF.ar(WhiteNoise.ar(Env.perc(0, 0.01, 0.1).kr(0, trig)), 6000);

    var hh = BPF.ar(WhiteNoise.ar(
        0.03 * Env.perc(0, 1/8 + SinOsc.kr(1, mul: 1/12)).kr(0, Impulse.kr(4))
    ), 9000);

    var noise = PinkNoise.ar(
        LFTri.kr([3, 3.01]).range(0.2, 0.01)
        * LFPulse.kr(3).lag(0.1)
        * LFTri.kr(1/4)
    );

    var offset = Demand.kr(Impulse.kr(1/2), 0, Dseq([5, 6, 4], inf));
    var shift = LFPulse.kr(1/20).range(4, 2);
    var glass = SinOsc.ar(
        freq: freq*[4, offset, 12] / shift,
        mul: 0.7 * Env.perc(0.01, 0.2).kr(0, Impulse.kr(5/2)),
    ).sum!2;

    var bass = SinOsc.ar(freq, mul: 0.5 * LFTri.kr(1/4).range(0.5, 1));
    bass = bass * SinOsc.ar(freq * 2 * SinOsc.ar(freq/4));
    bass = RLPF.ar(bass, LFTri.kr(1/3, 2).exprange(freq/2, freq*4), 0.9);
    bass = (bass * 4).tanh * 0.5;
    bass = LPF.ar(bass, freq*2);

    bass = Pan2.ar(bass);
    bass = bass.blend(NHHall.ar(HPF.ar(bass, freq*2), 3), 1/4);

    glass = (glass * 10).tanh * 0.15 * LFTri.kr(1/8);
    glass = LPF.ar(glass, 6000);
    glass = glass.blend([
        CombL.ar(glass[0], 1, 3/4 + SinOsc.kr(1).range(0.01, 0.02)),
        CombL.ar(glass[1], 1, 4/4),
    ]);
    glass = glass.blend(NHHall.ar(glass, 2 + LFTri.kr(1/4).range(0, 4)), 1/6);
    glass = Rotate2.ar(glass[0], glass[1], SinOsc.kr(1/2));

    noise = noise.blend(NHHall.ar(noise));

    dm = (dm * 3).tanh * 0.5;
    dm = dm.blend(CombL.ar(dm, 1, 1/4, 2), 1/4);

    hh = hh.blend(CombL.ar(hh, 1, [1/9, 1/3], 2), 1/4);
    hh = Rotate2.ar(hh[0], hh[1], LFTri.kr(1/4));

    if (true) {
        bass = bass * Env.asr().delay(0).kr;
        dm = dm * Env.asr().delay(0).kr;
        hh = hh * Env.asr().delay(4).kr;
        noise = noise * Env.asr().delay(10).kr;
        glass = glass * Env.asr(4, curve: 8).delay(12).kr;
    };

    sig = sig + bass;
    sig = sig + glass;
    sig = sig + noise;
    sig = sig + dm;
    sig = sig + hh;

    sig = Limiter.ar(sig);
}).play;
)
raw 2409 chars (focus & ctrl+a+c to copy)
reception
comments