String MidiMessage::getDescription() const { if (isNoteOn()) return "Note on " + MidiMessage::getMidiNoteName (getNoteNumber(), true, true, 3) + " Velocity " + String (getVelocity()) + " Channel " + String (getChannel()); if (isNoteOff()) return "Note off " + MidiMessage::getMidiNoteName (getNoteNumber(), true, true, 3) + " Velocity " + String (getVelocity()) + " Channel " + String (getChannel()); if (isProgramChange()) return "Program change " + String (getProgramChangeNumber()) + " Channel " + String (getChannel()); if (isPitchWheel()) return "Pitch wheel " + String (getPitchWheelValue()) + " Channel " + String (getChannel()); if (isAftertouch()) return "Aftertouch " + MidiMessage::getMidiNoteName (getNoteNumber(), true, true, 3) + ": " + String (getAfterTouchValue()) + " Channel " + String (getChannel()); if (isChannelPressure()) return "Channel pressure " + String (getChannelPressureValue()) + " Channel " + String (getChannel()); if (isAllNotesOff()) return "All notes off Channel " + String (getChannel()); if (isAllSoundOff()) return "All sound off Channel " + String (getChannel()); if (isMetaEvent()) return "Meta event"; if (isController()) { String name (MidiMessage::getControllerName (getControllerNumber())); if (name.isEmpty()) name = String (getControllerNumber()); return "Controller " + name + ": " + String (getControllerValue()) + " Channel " + String (getChannel()); } return String::toHexString (getRawData(), getRawDataSize()); }
const String getMidiMessageAsLogString (const MidiMessage &m, const bool name, const bool channel, const bool number, const bool value, const bool timestamp, const bool rawData, const bool rawInDecimal, const bool rawDataSize) { return ((timestamp ? getTimestamp(m) : "") + (rawDataSize ? getRawDataSize(m) : "") + (name ? getName(m) : "") + (channel ? getMidiChannel(m) : "") + (number ? getMidiNumber(m) : "") + (value ? getMidiValue(m) : "") + (rawData ? getRawData(m,rawInDecimal) : "")); }