Aseqdump_with_json

Rewrote aseqdump in Nim. My version listens only for events: NOTEON, NOTEOFF, CONTROLLER and PGMCHANGE .. because they are the only events I need.

  • Source code: 312 rows
  • Compiled binary: 67K
  --list | -l shows ports
  --port | -p listens to port (and output events)
  --json      output events as json

test

> midi_dump -p 28:0
Waiting for data. Press Ctrl+C to end.
Source  Event                  Ch  Data
 28:0   Note on                 1, note 64, velocity 88
 28:0   Note on                 1, note 60, velocity 84
 28:0   Note on                 1, note 67, velocity 73
 28:0   Note off                1, note 64
 28:0   Note off                1, note 67
 28:0   Note off                1, note 60


> midi_dump --json -p 28:0
{"source_client":28,"source_port":0,"event":"note_on","channel":0,"note":60,"velocity":79}
{"source_client":28,"source_port":0,"event":"note_on","channel":0,"note":64,"velocity":84}
{"source_client":28,"source_port":0,"event":"note_on","channel":0,"note":67,"velocity":75}
{"source_client":28,"source_port":0,"event":"note_off","channel":0,"note":64,"velocity":0}
{"source_client":28,"source_port":0,"event":"note_off","channel":0,"note":67,"velocity":0}
{"source_client":28,"source_port":0,"event":"note_off","channel":0,"note":60,"velocity":0}