Skip to content

Instantly share code, notes, and snippets.

@LFSaw
Created January 26, 2024 01:36
Show Gist options
  • Save LFSaw/320294673ed73f2aabbbd8610561c12c to your computer and use it in GitHub Desktop.
Save LFSaw/320294673ed73f2aabbbd8610561c12c to your computer and use it in GitHub Desktop.
Greyball

Greyball

2014, Till Bovermann

(
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)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment