# SuperDirt midi out on Raspberry Pi 4

**URL:** <https://uzu.lurk.org/t/superdirt-midi-out-on-raspberry-pi-4/3890>\
**Category:** Uncategorized\
**Created:** [15 February 2022 21:07 UTC](https://uzu.lurk.org/t/superdirt-midi-out-on-raspberry-pi-4/3890 "2022-02-15T21:07:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damu](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@damu](https://uzu.lurk.org/u/damu)\
**Post date:** [15 February 2022 21:07 UTC](https://uzu.lurk.org/t/superdirt-midi-out-on-raspberry-pi-4/3890/1 "2022-02-15T21:07:15Z")

</div>

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

[https://blog.tidalcycles.org/superdirt-midi/](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:

```haskell
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.

---

<div class="post-metadata">

**Author:** ![cleary](https://uzu.lurk.org/user_avatar/uzu.lurk.org/cleary/32/177_2.png) [@cleary](https://uzu.lurk.org/u/cleary)\
**Post date:** [15 February 2022 22:35 UTC](https://uzu.lurk.org/t/superdirt-midi-out-on-raspberry-pi-4/3890/2 "2022-02-15T22:35:11Z")

</div>

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:

```haskell
# 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:

```haskell
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.

---

<div class="post-metadata">

**Author:** ![damu](https://uzu.lurk.org/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@damu](https://uzu.lurk.org/u/damu)\
**Post date:** [16 February 2022 11:52 UTC](https://uzu.lurk.org/t/superdirt-midi-out-on-raspberry-pi-4/3890/3 "2022-02-16T11:52:35Z")

</div>

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.

```haskell
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?
