brianhouse / braid

Polyrhythms in Python: a sequencer and musical notation system for monophonic MIDI synths
http://braid.live
GNU General Public License v3.0
47 stars 6 forks source link

MidiIn receive_message() handles messages incorrectly #20

Closed instruments-of-the-aviary closed 3 years ago

instruments-of-the-aviary commented 3 years ago

The receive_message() function of the MidiIn class handles input in a strange (probably incorrect) way.

The section built for handling control values (line 116 of midi.py) only actually receives NOTE_OFF messages, and maps the note number to the control number. This is because the only common MIDI event code less that 0x1001cccc is the NOTE_OFF message.

The section that handles NOTE_ON messages (line 119 of midi.py)also responds to control and aftertouch messages because will all yield a message[0] >= 144.

I made a fork to fix this. I'm working on a piece with braid and I wanted to use midi controls/callbacks to modify patterns during a live performance. Should I submit a pull request? I'm new to the world of open source and don't know the protocol for these things yet.

brianhouse commented 3 years ago

Sorry for the delay ... yes! Please make a pull request, and I'll get it in the repo.