From 7fc03a0f9d5aeb209763e51b000ba18a5c54d641 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 6 Apr 2023 13:14:36 -0700 Subject: [PATCH] Fix polyphonic pressure (aftertouch) message writing. Wrong constant was used, implying message with a different length, which caused mis-parsing on the read side, mis-aligning and corrupting successive messages. --- miditk/smf/writer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/miditk/smf/writer.py b/miditk/smf/writer.py index e722aa8..725de5c 100644 --- a/miditk/smf/writer.py +++ b/miditk/smf/writer.py @@ -22,10 +22,10 @@ META_EVENT, MIDI_CH_PREFIX, MIDI_TIME_CODE, - MONO_PRESSURE, NOTE_OFF, NOTE_ON, PITCH_BEND, + POLYPHONIC_PRESSURE, PROGRAM_CHANGE, SEQUENCE_NAME, SEQUENCE_NUMBER, @@ -198,7 +198,7 @@ def pitch_bend(self, channel, value): def poly_pressure(self, channel=0, note=0x40, pressure=0x40): """Handle poly pressure (aftertouch) event.""" - self.event_slice(tobytestr([MONO_PRESSURE + channel, note, pressure])) + self.event_slice(tobytestr([POLYPHONIC_PRESSURE + channel, note, pressure])) def program_change(self, channel, program): """Handle program change event."""