Skip to content

Instantly share code, notes, and snippets.

@alexander-daniel
Last active February 11, 2023 01:11
Show Gist options
  • Save alexander-daniel/7f5f4260d862abd2c15bd7402862f019 to your computer and use it in GitHub Desktop.
Save alexander-daniel/7f5f4260d862abd2c15bd7402862f019 to your computer and use it in GitHub Desktop.
// does somethign need to be an `arg` to write to (.set()) it?
(
SynthDef.new(\horn, {
arg out = 0, freq = [440, 440];
ar sig;
// var freq = [[660, 662], [440, 442]].choose;
var env = Env(
levels:[0, 0.15, 0],
times:[1.7, 1.5]
);
var envGen = env.kr(doneAction: Done.freeSelf);
sig = LFPulse.ar(freq, 0, envGen);
sig = LPF.ar(
in: sig,
freq: 6000,
mul: envGen,
add: 0
);
Out.ar(out, [sig, sig])
}).add;
)
/*a = Synth.new(\horn);
a.set("freq", [220, 240]);
a.set("freq", [420, 420]);*/
(Pbind(
\note, Pseq([[−7, 3, 7, 10], [0, 3, 5, 8], [-2, 3, 5, 7]], inf),
\dur, 4,
\legato, 0.4,
\strum, 0.1, // try 0, 0.1, 0.2, etc
\instrument, \horn
).play;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment