monitor

Dumps incoming MIDI data to the log. Useful for diagnostics, but do not leave it in a patch for real playing! Occasionally causes disconnects.
Author: Johannes Taelman
License: BSD
Github: midi/in/monitor.axo

Inlets

None

Outlets

None

Parameters

bool32.tgl Enable to monitor Control Change messages

bool32.tgl Enable to monitor Note On/Off messages

bool32.tgl Enable to monitor Program Change messages

bool32.tgl Enable to monitor Pitch Bend messages

bool32.tgl Enable to monitor Polyphonic Pressure messages

Declaration
bool p_Note;
bool p_PolyPressure;
bool p_ControlChange;
bool p_ProgramChange;
bool p_Bend;
Control Rate
p_Note = param_Note;
p_PolyPressure = param_PolyPressure;
p_ControlChange = param_ControlChange;
p_ProgramChange = param_ProgramChange;
p_Bend = param_Bend;
Midi Handler
switch (status & 0xf0) {
case MIDI_NOTE_ON:
  if (p_Note)
    LogTextMessage("NoteOn  ch%2D n%3D v%3D", 1 + (status & 0x0F), data1,
                   data2);
  break;
case MIDI_NOTE_OFF:
  if (p_Note)
    LogTextMessage("NoteOff ch%2D n%3D v%3D", 1 + (status & 0x0F), data1,
                   data2);
  break;
case MIDI_POLY_PRESSURE:
  if (p_PolyPressure)
    LogTextMessage("PolyPrs ch%2D n%3D v%3D", 1 + (status & 0x0F), data1,
                   data2);
  break;
case MIDI_CONTROL_CHANGE:
  if (p_ControlChange)
    LogTextMessage("Control ch%2D cc%3D v%3D", 1 + (status & 0x0F), data1,
                   data2);
  break;
case MIDI_PROGRAM_CHANGE:
  if (p_ProgramChange)
    LogTextMessage("PgmChg  ch%2D pgm%3D", 1 + (status & 0x0F), data1, data2);
  break;
case MIDI_PITCH_BEND:
  if (p_Bend)
    LogTextMessage("PitchBnd ch%2D v%3D v%3D", 1 + (status & 0x0F), data1,
                   data2);
  break;
default:;
}

Privacy

© 2024 Zrna Research