MIDI send and receive

Communicating with Other Programmes

MIDI is an established protocol, and is used by many commercial musical devices. You can also use it to communicate to and from Bela, as well as for using plug and play MIDI interfaces as controllers for your code.

Table of contents

  1. MIDI Send and Receive
  2. Hardware setup
  3. The code

MIDI Send and Receive

MIDI (Musical Instrument Digital Interface) is a 1980s invention for communicating between music hardware.

The base MIDI messages are: note on, note off, pitch, velocity and modulation. From this grammar MIDI approximates the behaviour of musical instruments in the digital realm.

Bela can function as a plug in and play MIDI device. You can send MIDI data to Bela from a DAW, or receive MIDI messages sent from Bela.

Hardware setup

Connect a MIDI keyboard to the host post of Bela.

The code

Find the midi-receive and midi-send sketches in the Pure Data section of the Examples tab of the Bela IDE.

1. Receiving MIDI message on Bela

2. Sending MIDI from Bela

[noteout] and [ctrlout] are used to send note and control MIDI messages from Bela to another piece of software.