Repository navigation
Add MIDI input - #281
Add MIDI input#281v10101a wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
amazing! just kicked off automated tests for you, and will do some hand testing. but looks good! |
tychedelia
left a comment
There was a problem hiding this comment.
Would you mind collapsing the new midi_input example into the midi example? Feel free to be as creative as you want here, we just want to show off both examples in a single example.
|
Visual regression: 1 changed of 43 cases
If these changes are intentional, add the baseline |
|
@tychedelia examples merged! While testing I also found that MIDI out (including the original midi example) wasn't reaching Ableton or Web MIDI tools on macOS, likely bc messages were sent with timestamp 0. Enabling midir's |
currently libprocessing could only send MIDI, though #74 describes sending and receiving. This PR exposes nannou_midi's existing input in libprocessing, following existing MIDI output code in
processing_midiprocessing_midi:midi_list_input_ports(),midi_connect_input(),midi_disconnect_input(),midi_read()midi_read()returnsMidiMessageobjects with kind, channel, note/velocity, control/value.midi_connect_input()takes a port number or part of a name (e.g."IAC") and returns the port it connected toFix: MIDI out on macOS
MIDI output was sent with timestamp 0. Simpler listeners that ignore timestamps still receive them, but notes don't show up in Ableton or Web MIDI visualizer when i tested on MacOS. This also affects the existing
midiexample.coremidi_send_timestampedfeature (macOS only) inprocessing_midi/Cargo.toml, so each message is stamped with the current time. nannou_midi uses the same midir, so this applies to all MIDI output, in Rust and Python.Example
Merged MIDI in and out into the existing
midiexample (examples/midi.rsandcrates/processing_pyo3/examples/midi.py):I tested on macOS only: IAC loopback, Ableton, a Web MIDI visualizer, and unit tests.
Disclosure: used claude to help with coding