@@ -1722,7 +1722,27 @@ String InputEventMIDI::as_text() const {
17221722}
17231723
17241724String InputEventMIDI::to_string () {
1725- return vformat (" InputEventMIDI: channel=%d, message=%d, pitch=%d, velocity=%d, pressure=%d, controller_number=%d, controller_value=%d" , channel, message, pitch, velocity, pressure, controller_number, controller_value);
1725+ String ret;
1726+ switch (message) {
1727+ case MIDIMessage::NOTE_ON :
1728+ ret = vformat (" Note On: channel=%d, pitch=%d, velocity=%d" , channel, pitch, velocity);
1729+ break ;
1730+ case MIDIMessage::NOTE_OFF :
1731+ ret = vformat (" Note Off: channel=%d, pitch=%d, velocity=%d" , channel, pitch, velocity);
1732+ break ;
1733+ case MIDIMessage::PITCH_BEND :
1734+ ret = vformat (" Pitch Bend: channel=%d, pitch=%d" , channel, pitch);
1735+ break ;
1736+ case MIDIMessage::CHANNEL_PRESSURE :
1737+ ret = vformat (" Channel Pressure: channel=%d, pressure=%d" , channel, pressure);
1738+ break ;
1739+ case MIDIMessage::CONTROL_CHANGE :
1740+ ret = vformat (" Control Change: channel=%d, controller_number=%d, controller_value=%d" , channel, controller_number, controller_value);
1741+ break ;
1742+ default :
1743+ ret = vformat (" channel=%d, message=%d, pitch=%d, velocity=%d, pressure=%d, controller_number=%d, controller_value=%d, instrument=%d" , channel, message, pitch, velocity, pressure, controller_number, controller_value, instrument);
1744+ }
1745+ return " InputEventMIDI: " + ret;
17261746}
17271747
17281748void InputEventMIDI::_bind_methods () {
0 commit comments