Skip to content

Instantly share code, notes, and snippets.

@andr-ew
Created May 27, 2021 15:19
Show Gist options
  • Save andr-ew/08ef7392e0640fe8b2944398889baa18 to your computer and use it in GitHub Desktop.
Save andr-ew/08ef7392e0640fe8b2944398889baa18 to your computer and use it in GitHub Desktop.
gendy.kr() video
(
ServerOptions.devices;
s.options.device = "UMC404HD 192k";
s.boot;
)
(
~cc = Bus.control(s, 7);
MIDIIn.connectAll;
MIDIdef.cc(\test1, {arg v, ch;
~cc.setAt(ch - 102, v/127);
}, (102..108));
~noise = Bus.audio(s, 2);
)
(
var scale, buffer;
scale = FloatArray[0, 2, 4, 6, 7, 9, 11];
buffer = Buffer.alloc(s, scale.size,1, {|b| b.setnMsg(0, scale) });
~sinedef = SynthDef.new(\sines, {
var cc = \cc.kr(0!7);
var hz = (
DegreeToKey.kr(
buffer.bufnum,
Gendy5.kr(
minfreq:1,
maxfreq:8,
ampscale:0.1,
durscale:0.1,
initCPs:cc[4] * 7,
mul:7.5,
add:7.5),
12,
1,
60
)
+ LFNoise1.kr([3,3], 0.04)
).midicps;
Out.ar(0,
RLPFD.ar(
Splay.ar(
Decimator.ar(SinOsc.ar(hz, SinOsc.ar(hz * (1 + cc[3])) * cc[6]), 441000 * 0.05, 12)
),
880 + (1000 * cc[6]),
0.6
) * 0.5 * cc[1]
);
}).add;
)
~sines.free; ~sines = Synth.new(\sines); ~sines.map(\cc, ~cc);
~sines2.free; ~sines2 = Synth.new(\sines); ~sines2.map(\cc, ~cc);
~sines.free;
~sines2.free;
(
~squaredef = SynthDef.new(\squares, {
var cc = \cc.kr(0!7);
var squares = RLPFD.ar(
LFPulse.ar([48,55].midicps, 0.15),
(Gendy4.kr(2, 2, 1, 1, 0.1, 0.2, 0.1, 0.1, 2, mul:10, add:72) + (cc[2] * 30)).midicps,
0.6
);
Out.ar(0,
CombN.ar(squares, 0.31, 0.31, 2, 0.2, squares) * cc[0]
);
}).add;
)
~squares.free; ~squares = Synth.new(\squares); ~squares.map(\cc, ~cc);
~squares.free;
(
~indef = SynthDef.new(\in, {
var sig = RLPFD.ar(
SoundIn.ar(0!2) * Crackle.ar(1.5!2) * GrayNoise.ar(1!2),
Gendy4.kr(2, 2, 1, 1, 0.1, 0.2, 0.1, 0.1, 2, mul:7, add:92).midicps, 0.2
);
Out.ar(0, sig * 2);
}).add;
)
~in.free; ~in = Synth.new(\in);
~in.free;
~cc.scope
@andr-ew
Copy link
Author

andr-ew commented May 27, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment