Repository navigation
Conversation
- midi_play: scan PortMidi outputs for JUST_INTONATION_MIDI_OUT_NAME (default loopbe) or honor JUST_INTONATION_MIDI_DEVICE_ID; raise a RuntimeError that lists available outputs on failure; decode bytes device names; fix pitch_bend reset to pass explicit value 0 - README: MIDI signal path, Windows LoopBe/loopMIDI, macOS IAC, Linux ALSA hints, env vars, pitch-bend synth expectations Co-authored-by: endolith <endolith@gmail.com>
- Open output via mido.open_output after name substring or index env lookup - Send program_change, pitchwheel, note_on/off; clip pitch wheel to spec - atexit closes the port; Timer note-offs use a zero-arg closure - requirements-midi.txt for optional demo deps; README MIDI section updated - Helpful RuntimeError if RtMidi cannot enumerate ports (e.g. missing ALSA seq) Co-authored-by: endolith <endolith@gmail.com>
cursor
Bot
force-pushed
the
cursor/midi-mido-rewrite-2589
branch
from
June 12, 2026 04:44
d6bec19 to
e6f9a89
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces pygame / PortMidi in
midi_play.pywith mido and the RtMidi backend (mido[ports-rtmidi]/python-rtmidi), which is the usual stack for dedicated MIDI I/O in Python today. Behavior is unchanged: per-note channel rotation, pitch bend for sub-semitone tuning (samefrac * 4096mapping, clamped to −8192..8191), GM drum channel skipped,Timer-based note-offs, and the sameJUST_INTONATION_MIDI_*selection logic (now againstmido.get_output_names()indices).Files
midi_play.py:mido.set_backend('mido.backends.rtmidi'),resolve_midi_output_port_name(),open_output,Message(...)for all traffic;atexitcloses the port; clearer error if RtMidi cannot enumerate (e.g. Linux without/dev/snd/seq).requirements-midi.txt: optionalmido[ports-rtmidi]+numpyfor the demo (main package / CI unchanged).README.md: MIDI section updated for mido/RtMidi,pip install -r requirements-midi.txt, historical pointer to pygame PR #394.Notes
masterseparately, rebase this branch onto updatedmasterbefore merge.RuntimeErrorexplains the usual Linux fix.Verification
pytest— 21 passed (midi_playnot imported by tests).