«greyball» by LFSaw

on 26 Jan'24 02:35 in compositionreverb

reverb study

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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
(
s.options.memSize_(65536 * 4);
s.reboot;

Spec.add(\damp, [0, 1]);
Spec.add(\diff, [0, 1]);
Spec.add(\highband, [1000, 10000, \exp]);
Spec.add(\highx, [0, 1]);
Spec.add(\lowband, [100, 6000, \exp]);
Spec.add(\lowx, [0, 1]);
Spec.add(\modDepth, [0, 50]);
Spec.add(\modFreq, [0, 10]);
Spec.add(\midx, [0, 1]);
Spec.add(\size, [0.5, 3]);
Spec.add(\t60, [0.1, 60, \exp]);
Spec.add(\wet, [0, 1]);
Spec.add(\shelfslope, [1, 10]);
Spec.add(\shelfFreq, \freq);
Spec.add(\fb, [0, 1]);
Spec.add(\dtime, [0, 2]);
)




s.makeWindow
(
Ndef(\src, {
    //SoundIn.ar([0, 1])
    Splay.ar(Impulse.ar([1, 3, 5, 7, 9]).scramble);

});
)

(
Ndef(\src).fadeTime = 4;
Ndef(\src).quant = 2;
Ndef(\src, {
    var src = 10.collect{
        Pan2.ar([HPF, LPF, ComplexRes].choose.performKeyValuePairs(\ar,[
            \in, [Impulse, LFPulse].choose.ar(
                [4, 2, 1, 1/2, 1/3, 1/4, 1/6].choose,
                iphase: [0, 1/4, 1/8, 1/2, 1/3].choose,
                phase: [0, 1/4, 1/8, 1/2, 1/3].choose,
                width:  [0.001, 0.0001, 0.01, 0.1, 0.2].choose,
                mul:    [1, 2, 3, 4].choose.reciprocal * [1, -1].choose
            ),
            \freq, [10000, 2000, 1000, 500, 250, 125, 125/2].choose,
            \decay, [0.1, 0.2, 0.4, 1].choose,
        ]
        ), Rand(-1, 1));
    }.sum;
    HighShelf.ar(src, \shelfFreq.kr(1000), \shelfslope.kr(1));
})
)



Ndef(\src).play;
Ndef(\hole).play;
(
Ndef(\hole, {
    var src, verb, amp;

    src = LeakDC.ar(Ndef(\src).ar);
    //amp = Amplitude.kr(src);
    // src = Gate.ar(src, amp-0.0003)

    src = src * \amp.kr(1);
    // var src = Impulse.ar(0.5);
    verb = GreyholeRaw.ar(
        src, src,
        \damp.kr(0.1),
        \dtime.kr(0.1),
        \diff.kr(0.707),
        \fb.kr(0.1),
        \modDepth.kr(0.01),
        \modFreq.kr(2),
        \size.kr(1)
    );
    verb
}
)
)

Ndef(\hole).edit;
Ndef(\src).edit;

MIDIIn.connectAll

MIDIdef.cc(\test, {arg ... args; args.postln});
MIDIdef.cc(\test).free;

(
    MIDIdef.cc(\dtime,     {|val, num| Ndef(\hole).set(\dtime,     \dtime    .asSpec.map(val/127))},  0);
    MIDIdef.cc(\fb,        {|val, num| Ndef(\hole).set(\fb,        \fb       .asSpec.map(val/127))},  1);
    MIDIdef.cc(\modDepth,    {|val, num| Ndef(\hole).set(\modDepth,    \modDepth   .asSpec.map(val/127))},  2);
    // MIDIdef.cc(\lowx,      {|val, num| Ndef(\hole).set(\lowx,      \lowx     .asSpec.map(val/128))},  3);
    // MIDIdef.cc(\midx,      {|val, num| Ndef(\hole).set(\midx,      \midx     .asSpec.map(val/128))},  4);
    // MIDIdef.cc(\highx,     {|val, num| Ndef(\hole).set(\highx,     \highx    .asSpec.map(val/128))},  5);
    MIDIdef.cc(\amp,       {|val, num| Ndef(\hole).set(\amp,       \amp      .asSpec.map(val/127))},  7);

    MIDIdef.cc(\size,      {|val, num| Ndef(\hole).set(\size,      \size     .asSpec.map(val/127))}, 16);
    MIDIdef.cc(\diff,      {|val, num| Ndef(\hole).set(\diff,      \diff     .asSpec.map(val/127))}, 17);
    MIDIdef.cc(\modFreq,     {|val, num| Ndef(\hole).set(\modFreq,     \modFreq    .asSpec.map(val/128))}, 18);
    MIDIdef.cc(\lowband,   {|val, num| Ndef(\hole).set(\lowband,   \lowband  .asSpec.map(val/127))}, 20);
    MIDIdef.cc(\highband,  {|val, num| Ndef(\hole).set(\highband,  \highband .asSpec.map(val/127))}, 21);
    MIDIdef.cc(\damp,      {|val, num| Ndef(\hole).set(\damp,      \damp     .asSpec.map(val/127))}, 22);
    MIDIdef.cc(\dryAmp,    {|val, num| Ndef(\src).vol = val/127}, 23);
    MIDIdef.cc(\rebuild,   {|val, num|
        (val > 0).if{
            Ndef(\src).rebuild;
        }
    }, 39)
)
raw 3687 chars (focus & ctrl+a+c to copy)
reception
comments