Supercollider and MIDI devices

Hi there,

if I program for pisound I start on my osx laptop with a midi device connected and then I transfer it to the pisound.

What I realized is that I have to comment out the command

MIDIIn.connectAll

and I only use

MIDIClient.init

I also have to change the MIDIOut port (as described in the supercollider helpfile) when I go from one os to the other.
I think I need to use

MIDIOut.newByName ?

but I can not get it working.

Does anybody has a suggestion or best practice how to use/code the MIDI device stuff to be compatible without headache?

Thanks in advance

Yes, Patchbox OS comes with our amidiauto utility bundled which automatically connects all MIDI software ports to hardware ports. /etc/amidiauto.conf can be used to customize the rules to make particular connections or to prevent automatic connections. There’s a couple of config examples available here in the community in some topics.

amidiauto only allows working with the very first port of a device or program. There’s a more fully featured utility amidiminder that you could use instead, and it allows connecting all the ports as necessary. You should also find more information on it here in the community. :slight_smile:

I’d recommend using one of these automatic connection utilities to set up your system, and skip making ALSA MIDI connections within the patch.

Thanks again Giedrius,

what I do not understand is what I should or should not do in supercollider.

Powering on the pisound the supercollider program starts and I do not have to do anything but play the machine.

Programming is done mainly on my laptop and best would be having to change as few things as possible going from laptop to pisound.

Best,
Sebastian

What is the OS you’re using on your laptop?

If you’d like to have identical behavior on both devices, then you either would have to get amidiauto or amidiminder installed on your laptop too (only if it’s Linux), or disable those utilities on the Pi. :slight_smile:

To disable it, just run:

sudo systemctl stop amidiauto
sudo systemctl disable amidiauto
sudo systemctl mask amidiauto

An alternative could be to look into whether the SC patch can identify the system it’s running on, and do ‘MIDIIn.connectAll’ only for the laptop.

Thanks. I will try to identify the system via SC. There is the

Platform.case

command.

1 Like

I highly advise the usage of Modality toolkit, it simplifies the mapping of MIDI (and other) controls a lot.

http://modalityteam.github.io/

Just install the quark and look at the tutorials, you create an instance of a modality controller inside your patch and assign controls to it, all you need is a template of your controller that maps all the hardware controls to the naming convention of the library. I believe there already is a template for the controller you use:

http://modalityteam.github.io/controllers/akai-midimix.html

best–