Skip to content

Instantly share code, notes, and snippets.

@catfact
Created December 28, 2023 21:46
Show Gist options
  • Save catfact/5ed463d82701330c96024fa17aa9f39c to your computer and use it in GitHub Desktop.
Save catfact/5ed463d82701330c96024fa17aa9f39c to your computer and use it in GitHub Desktop.
ji / 12tet pulse demo
s = Server.default;
s.waitForBoot { Routine {
SynthDef.new(\pan_pulse, {
var pos = Line.ar(\pos.kr(0), 0, \dur.kr(5));
var snd = Pulse.ar(\hz.kr(110));
snd = Pan2.ar(snd * \amp.kr(0.1), pos);
Out.ar(\out.kr(0), snd);
}).send(s);
s.sync;
// just intonation
l = Synth.new(\pan_pulse, [\hz, 110, \pos, -1]);
r = Synth.new(\pan_pulse, [\hz, 110 * 3/2 * 2, \pos, 1]);
15.wait;
l.free;
r.free;
// 12tet
l = Synth.new(\pan_pulse, [\hz, 110, \pos, -1]);
r = Synth.new(\pan_pulse, [\hz, 110 * 7.midiratio * 2, \pos, 1]);
15.wait;
l.free;
r.free;
}.play; };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment