SuperDirt midi out on Raspberry Pi 4

I'm trying to send midi out to a drum machine from Tidalcycles using the regular method.

https://blog.tidalcycles.org/superdirt-midi/

It works fine on Windows and OSX but I really want to do it from my Raspberry Pi.

I've managed to install Tidalcycles on RPi4 using Ansible by @cleary

Running Tidal in Vim, I'm getting audio out fine and the Raspberry Pi is picking up my Drum machine as a midi device when I run MidiClient.init in Supercollider.

I get as far as sending:

d1 $ note (run 128) # s 'midi'

Which should trigger every channel of the drum machine, but nothing comes out. The same code triggers the drum machine fine from my windows and OSX machines.

Could anyone think of anything I could try to get this working? I'm super keen to start using the Raspberry Pi as a drum sequencer for my live set and I'm so very close.

Supercollider needs to know about your drum machine - in your other builds you will have modified the startup.scd

I've added some convenience to my ansible installer for this - in short,

  1. copy /path/to/ansible-tidalcycles/vars/all.yml.ex to /path/to/ansible-tidalcycles/vars/all.yml
  2. edit your new all.yml file

Find this section, uncomment the custom_midi_clients and add your drum machine in the same format as the examples:

# connect midi client(s) to send patterns *from tidal* (hardware, software synths/plugins etc)
# see: https://tidalcycles.org/SuperDirt_MIDI_Tutorial
# In SuperCollider get the output of:
#   MIDIClient.init;
# Which will return a series Sources and Destinations in the following format:
#   MIDIEndPoint("full_name", "port_name")
# livecode_name is the name you'd like to use to refer to this midi device in your tidal code
# latency is optional, and defaults to 0
#
#custom_midi_clients:
#    - { livecode_name: midi0, full_name: Midi Through, port_name: Midi Through Port-0, latency: 0 }
#    - { livecode_name: midi1, full_name: Focusrite USB MIDI, port_name: Focusrite USB MIDI }

It should look similar to:

custom_midi_clients:
    - { livecode_name: midi, full_name: MYDRUMMACHINEASPERSCOUTPUT, port_name: MYDRUMMACHINE_PORT_ASPERSCOUTPUT }

Then run the installer again, you only need to apply the tidal playbook (not the whole vim playbook)

The required stanzas will be added to startup.scd automatically.

1 Like

Thanks very much for your help but it's not done the trick, sadly.

I followed your advice. I also tried evaluating the following in a separate SC file, after initialising Tidal.

MIDIClient.init;

~midiOut = MIDIOut.newByName("RD-9", "RD-9"); // substitute your own device here

~dirt.soundLibrary.addMIDI(\rd9, ~midiOut);

Usually that works and has worked on my other machines. SC is picking up my RD9 drum machine as being connected to the RPi, when I run :

MidiClient.init

I then substitute the name of my device into:

~midiOut = MIDIOut.newByName("RD-9", "RD-9"); // substitute your own device here

The problem here seems to be that SC won't send the MidiOut messages from the USB port on the RPi 4. Is there anything else anyone could suggest?