Ok, important progress (for me at least). The following works:
supercollider:
(
var pat, player;
MIDIClient.init;
// per the docs the following is what linux users should use instead of just MIDIOut(0)
m = MIDIOut(0, MIDIClient.destinations[0].uid);
pat = Pbind(
\type, \midi,
\midicmd, \noteOn,
\chan, 0,
\midiout, m,
\midinote, Pseq([60], inf),
\dur, 1
);
player = pat.play;
)
in ardour:
connect "system" to my midi track
(none of a2j, supercollider "out0", "out1", "out2",
or whatever else appears in ardour works - only "system")
Surprise:
If I kill the a2jmidid -e program, it still works. Seems like the alsa bridge is not needed/used at all in this
case. I cannot claim it makes any kind of sense to me, but here we are.
MIDIClient.destinations[0] btw corresponds to MIDIEndPoint(“Midi Through”, “Midi Through Port-0”)
If I now try to use newByName instead, it works too:
(
var pat, player;
MIDIClient.init;
m = MIDIOut.newByName("Midi Through", "Midi Through Port-0");
pat = Pbind(
\type, \midi,
\midicmd, \noteOn,
\chan, 0,
\midiout, m,
\midinote, Pseq([60], inf),
\dur, 1
);
player = pat.play;
)
So the trick here appears to not use any alsa midi bridge at all, but just connect to the “system” midi in in ardour, and use midi through as destination in supercollider.
It’s great that I now can directly record midi from supercollider.
It’s not so great that I have no idea what I just did and why it works…