MidiClient and remote scsynth

Hi,
I have successfully gotten a Raspberry Pi to boot a remote SuperCollider server, and connected to it from a scide running on a remote mac (producing sound and everything). This Raspberry Pi also has midi devices connected to it. Prior to figuring out the remote stuff, I would run sclang internally on the Raspberry pi with internal .scd files. In these scd files I was able to get my midi devices on the RPi triggering SuperCollider code.

However, now that I am using scide remotely, I am confused how to access the Midi devices on the remote RPi, or if it is even possible at all. For instance, internally on the RPI, the output of MidiClient.init is:

MIDI Sources:
MIDIEndPoint("System", "Timer")
MIDIEndPoint("System", "Announce")
MIDIEndPoint("Midi Through", "Midi Through Port-0")
MIDIEndPoint("io|2", "io|2 MIDI 1")
MIDIEndPoint("Launch Control", "Launch Control MIDI 1")
MIDIEndPoint("2PedalPiano1.0", "2PedalPiano1.0 MIDI 1")
MIDIEndPoint("SuperCollider", "out0")
MIDIEndPoint("SuperCollider", "out1")
MIDIEndPoint("SuperCollider", "out2")
MIDIEndPoint("SuperCollider", "out3")
MIDI Destinations:
MIDIEndPoint("Midi Through", "Midi Through Port-0")
MIDIEndPoint("io|2", "io|2 MIDI 1")
MIDIEndPoint("Launch Control", "Launch Control MIDI 1")
MIDIEndPoint("2PedalPiano1.0", "2PedalPiano1.0 MIDI 1")
MIDIEndPoint("SuperCollider", "in0")
MIDIEndPoint("SuperCollider", "in1")
MIDIEndPoint("SuperCollider", "in2")
MIDIEndPoint("SuperCollider", "in3")
MIDIEndPoint("SuperCollider", "in4")
MIDIEndPoint("SuperCollider", "in5")

This is all correct, and works great. However, after connecting to my RPi remotely from my Mac in the IDE with this code…:

o = ServerOptions.new;
o.maxLogins = 8;
s = Server.remote(\realtimepi, NetAddr("192.168.1.67", 57117), o);
s.serverRunning;
s.boot;
{ [SinOsc.ar(440, 0, 0.2), SinOsc.ar(442, 0, 0.2)] }.play(s);
MIDIClient.init;

…which does produce sound remotely, so I know I am connected, the output of MIDIClient.init however is the following:

MIDI Sources:
MIDI Destinations:
-> MIDIClient
-> MIDIClient

Which is obviously empty. I am guessing this is saying that no Midi devices are connected to my Mac. When I really need to access the midi devices on the remote RPi server (which is running scsynth on an open port over a local network). Is there any way to remotely access these midi devices? Like for instance, is there a way to call MIDIClient off my remote s object?? If not, are there any other work-arounds?

s represents a server.

MIDIClient is a language-side class, and a language-side operation.

So “is there a way to call MIDIClient off my remote s object” is really not a meaningful approach.

  • You could run sclang on the rpi. Even if you don’t have the IDE on the pi, you can still run sclang as a UNIX command. If you do that in the terminal without any commandline arguments, you get an interactive mode where you can type commands (but no IDE features). Or, you can provide a script file as an argument.

  • Or, plug the MIDI devices into the Mac, and do all of the MIDI/language work on the Mac, and run only the server on the pi.

Is there any way to remotely access these midi devices?

MIDI is not a networking protocol, so… no. Not directly. You need to run an instance of sclang on the same machine that the MIDI devices are plugged into.

You can use OSC to communicate MIDI device and MIDI message information across the network to another sclang, but MIDIClient / MIDIFunc by themselves will not work over the network. Never can, never will.

hjh

2 Likes