A new utility which dumps MIDI 1.0 events in real-time.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential D46418
mididump(1): Initial revision christos on Aug 23 2024, 3:19 PM. Authored by Tags None Referenced Files
Details A new utility which dumps MIDI 1.0 events in real-time. Sponsored by: The FreeBSD Foundation $ mididump /dev/umidi0.0 Note on channel=1, note=48 (C3, 130.81Hz), velocity=87 Note off channel=1, note=48 (C3, 130.81Hz), velocity=127 Note on channel=1, note=50 (D3, 146.83Hz), velocity=72 Note off channel=1, note=50 (D3, 146.83Hz), velocity=127 Note on channel=1, note=65 (F4, 349.23Hz), velocity=95 Note off channel=1, note=65 (F4, 349.23Hz), velocity=127 Note on channel=1, note=67 (G4, 392.00Hz), velocity=29 Note off channel=1, note=67 (G4, 392.00Hz), velocity=127 Note on channel=1, note=69 (A4, 440.00Hz), velocity=46 Note off channel=1, note=69 (A4, 440.00Hz), velocity=127 Control/Mode change channel=1, control=64 (Damper Pedal (Sustain)), value=127 (on) Control/Mode change channel=1, control=64 (Damper Pedal (Sustain)), value=0 (off) ^C
Diff Detail
Event TimelineComment Actions Inspired by aseqdump and OpenBSD's midicat, but more user-friendly (printing note names, frequencies, control names, ...), and also native so it does not require ALSA or any sound backend. In the future I would like to support MIDI 2.0 events as well, but I think for now we can roll with just MIDI 1.0.
Comment Actions Finally got around to bring my MIDI controller home - unfortunately I couldn't test anything meaningful, see inline comments.
Comment Actions Regarding the approach to read one byte at a time, that's potentially one syscall every 320 microseconds. Probably ok for this tool, but I hope nobody copies this code for something serious ;-)
Comment Actions Fix SysEx handling. In the case of 3-byte VendorID, I am not sure if we should Comment Actions I suppose we have to read 2 additional bytes (after the first byte of the manufacturer ID was read as 0x00). This seems to be the official table of manufacturer IDs: https://midi.org/SysExIDtable Comment Actions Read 2 bytes (instead of 3) in case byte1 in SysEx is 0. Any objections regarding the output interface? Comment Actions For real devices there's a "Timing clock" message coming at a certain frequency, too much noise to see the other MIDI messages. Maybe we could collect them and print them together, or add a flag to enable or disable printing them? Comment Actions Unfortunately I cannot find all these cases with my humble and barebones AKAI LPK25... I will add a flag to print them (not disable them, as probably disabling them is probably the most wanted behavior, no?). Comment Actions Introduce -t option to print "Timing Clock" messages on-demand, in order to Comment Actions I didn't see any more problems while testing. Would be nice to have a MIDI example file for testing that exercises all types of MIDI messages. mididump file.midi works BTW, but I think it's more of a feature than a bug. Comment Actions Yeah, it is nice to examine a file this way as well. Are you okay with the user interface? Comment Actions I think you can leave the interface as is, it's sufficient for debugging and we can expand it if necessary. The next best practical feature I can think of is timing data (like a log file) and replay functionality, but that's a bit more involved.
|