Repository navigation
emuscd, emusc-winmidi: --midi-in by index or name on both platforms - #20
Merged
Merged
Conversation
A number is still an index. Anything else picks the port whose name it is, or the only one containing it, ignoring case and runs of whitespace. Assisted-by: Claude:claude-opus-5-5
Same matching as emusc-winmidi's --midi-in. emuscd still creates its own port; this subscribes it to a source such as a USB keyboard at startup, which otherwise takes an aconnect after every start. Assisted-by: Claude:claude-opus-5-5
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.
Addresses the MIDI-in part of #18.
Both daemons now take
--midi-inwith the same argument and the same matching, as scva-headless does:--list-midi-in. Out of range reportsout of range (0..N).In From MIDI Yoke: 1, with two spaces.What it selects differs by platform:
emusc-winmidi(Windows): WinMM cannot create a port, so--midi-inchooses which existing input to open. It used to take an index only.emuscd(Linux, new):emuscdstill creates its own ALSA sequencer port (--name) for programs to connect to.--midi-inadditionally subscribes it at startup to an existing source, such as a USB keyboard, instead of needing anaconnectafter every start. Sources are every readable sequencer port except the system client's andemuscd's own, named<client>: <port>.--list-midi-inlists them.The matching is a platform-free header (
emuscd/midi_port_match.h) with a unit test,midi_port_match_test.Verified locally
Unit test: passes natively and as the 32-bit MinGW
.exeunder Wine. Five mutations of the matcher (no exact-match pass, ambiguity ignored, case kept, whitespace dropped, numbers searched as names) each make it fail.Test ports: both platforms were tested against two ALSA ports named exactly like MIDI Yoke's. Only port 2 sends notes: a held 24-note chord.
Windows (
emusc-winmidi.exeunder Wine, which exposes ALSA ports as WinMM inputs):"MIDI Yoke"is rejected as ambiguous, with both ports listed.Maplematches nothing.9reports out of range (0..2).--midi-in "MIDI YOKE: 2", synthesis load went from 1.7% to 14–18% while the chord was held. With--midi-in "yoke: 1"it stayed at 1.6–1.8%..exes still import only KERNEL32, msvcrt and WINMM.Linux (
emuscd, audio captured through ALSA'sfilePCM):--list-midi-inlistsMidi Throughand both Yoke ports. The ambiguous, unknown and out-of-range cases give the same errors as on Windows, exiting 1.--midi-inaconnect -l"MIDI YOKE: 2""yoke: 1""yoke: 1", plus a song played intoemuscd's own port🤖 Generated with Claude Code