Skip to content

Add MIDI input - #281

Open
v10101a wants to merge 1 commit into
processing:mainfrom
v10101a:midi-input
Open

v10101a wants to merge 1 commit into
processing:mainfrom
v10101a:midi-input

Conversation

@v10101a

@v10101a v10101a commented Nov 17, 2026

Copy link
Copy Markdown

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_midi

  • add MIDI input to processing_midi: midi_list_input_ports(), midi_connect_input(), midi_disconnect_input(), midi_read()
  • add same functions to python. midi_read() returns MidiMessage objects 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 to
  • add midi-related error messages

Additionally, i added two examples

  • examples/midi_input.rs: receives midi notes and visualizes them as colored bars. receive midi cc changes and change bg brightness.
  • crates/processing_pyo3/examples/midi_input.py: same as above, but in python

I tested on macOS only (IAC loopback + unit tests).

Disclosure: used claude to help with coding

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@catilac
catilac self-requested a review November 17, 2026 23:43
@catilac

catilac commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

amazing! just kicked off automated tests for you, and will do some hand testing. but looks good!

@tychedelia tychedelia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions

Copy link
Copy Markdown

Visual regression: 1 changed of 43 cases

case status detail
py_flocking_gpu ❌ changed 7.95% of pixels differ

If these changes are intentional, add the deliberate-rendering-change label.

baseline 56dc3f7d01 · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.5 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants