Hello all,
I’m trying to play a Supercollider synth from a Logic Pro sequence using MIDI on MacOS. To start, I’m using Fieldsteel’s Companion Code 7.1, which implements a generic SynthDef with MIDIdef for noteOn and a MIDIdef for noteOff. I can get the sequence to play, but the timing is obviously bad. My sequence is straight quantized 8th notes, but I can hear SC kinda speeding up, slowing down, rushing a few notes, etc. When the sequence loops, the imperfections fall at different places. Terrible. HOW CAN I GET ROCK SOLID MIDI TIMING BETWEEN LOGIC PRO AND SC ON A MAC?
I verified the sequence is OK by playing an internal software instrument in Logic Pro and it was perfectly clocked.
Thank you for any help or clues or possibilities!
Fieldsteel’s code:
(
SynthDef(\tone, {
arg buf = 0, gate = 1, amp = 0.2,
freq = 220, rel = 0.3, out = 0;
var sig, env;
env = Env.asr(0.002, 1, rel).kr(2, gate);
sig = LFTri.ar(freq * [0, 0.1].midiratio);
sig = sig * env * amp;
Out.ar(out, sig);
}).add;
)
(
~bend = 0;
~group = Group();
~notes = Array.newClear(128, nil);
MIDIdef.freeAll;
MIDIdef.noteOn(\on, {
|val, num, chan, src|
~notes.put(
num,
Synth(\tone, [
\freq, num.midicps,
\gate, 1,
\amp, val.linexp(0, 127, 0.01, 0.25),
\bend, ~bend
], ~group);
);
}).permanent_(true);
MIDIdef.noteOff(\off, {
arg val, num, chan, src;
~notes[num].set(\gate, 0);
~notes.put(num, nil);
}).permanent_(true);
MIDIdef.bend(\pitchbend, {
arg val, chan, src;
~bend = val.linlin(0, 16383, -2, 2);
~group.set(\bend, ~bend);
}).permanent_(true);
)
MacBook Pro, Apple M1 Max, 64G ram, Sonoma 14.6.1
SC 3.13.0
Logic Pro 11.0.01