MIDI Monitor
App: apps/midi_input_demo/
A MIDI monitor (engine PLM-135 / ADR 0044): it lists the MIDI input devices with
Midi.inputDevices, opens the first one, and shows the incoming events —
notes, controllers, pitch bend — scrolling in a GUI window. Plug in a USB-MIDI keyboard and play.
Desktop only. With no device connected it shows a hint instead; the events can drive anything (feeding
them to a SoundFontInstrument is the next step).
Run from root
Section titled “Run from root”% ./plume3d midi_input_demoWhat it does
Section titled “What it does”- On
init, readsMidi.inputDevices; if any exist, opens device0withMidi.openInput(0)and logs the opened device name. - Each
update, drainsMidi.poll()and formats each event (note on/off, control change, pitch bend, …) into a scrolling log shown in a Gui window. - On
quit, callsMidi.closeInput().
Key pattern
Section titled “Key pattern”import "engine" for Midi
// init: open the first available MIDI input.if (Midi.inputDevices.count > 0) Midi.openInput(0)
// update: consume this frame's events (drained onto the main thread by the engine).for (ev in Midi.poll()) { if (ev["type"] == "noteOn") { // ev["data1"] = note, ev["data2"] = velocity, ev["channel"] = 0..15 }}