Please ensure Javascript is enabled for purposes of website accessibility Jump to content

M5 MIDI communication, sending commands using custom software


eberdugo
 Share

Recommended Posts

Hello everybody,

 

I don't know if there is anybody interested on this, but I decided to share my findings about communication with M5 via MIDI interface.

 

I decided to build a small pedal by myself, using most probably some micro-controller to send MIDI commands to the pedal, when I press, enable navigation.

 

This is the ultimate goal, but meanwhile, to test the concept, I started to do some communication experiments, and for my initial setup I could implement a VERY SIMPLE python code to do this, using an USB-MIDI interface cable by ESI MidiMate eX connected to my computer.

 

It worked, with no need of any driver installation (Windows 10), using the commands explained in M5 manual.

 

Here's the python code with some examples:

 

------------------

 

#remember to install the library python-rtmidi
#pip install python-rtmidi 


import rtmidi

midiout = rtmidi.MidiOut()

 

available_ports = midiout.get_ports()

 

from rtmidi.midiconstants import (PROGRAM_CHANGE , CONTROLLER_CHANGE)

 

print(available_ports)

 

#the number (1) can change, depending on the address on your computer when you connect the cable

if available_ports:
    midiout.open_port(1)
    

#this is from the M5 manual:
#Preset Change PC 0-23 (Corresponds to Presets 01-24)
#FX on/off CC#11 / 0-63 (Bypass) / 64-127 (On)
#Tuner Mode on/off CC#69 0-63 (Exit) / 64-127 (Enter)

#Expression Pedal CC#01 0-127
#Tap Tempo CC#64 / 64-127

 

#change to effect 10    

control = [PROGRAM_CHANGE, 9]

 

#change to effect 19
control = [PROGRAM_CHANGE, 18]

 

#switch OFF effect
control = [CONTROLLER_CHANGE, 11, 0]

 

#switch ON effect
control = [CONTROLLER_CHANGE, 11, 64]

 

#tuner mode ON
control = [CONTROLLER_CHANGE, 69, 64]

 

#tuner mode OFF
control = [CONTROLLER_CHANGE, 69, 0]

 

#send the command
midiout.send_message(control)

 

#close the port

midiout.close_port()

del midiout

 

-------------------

 

Enjoy!

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...