Skip to content

Commit

Permalink
Fix polyphonic pressure (aftertouch) message writing.
Browse files Browse the repository at this point in the history
Wrong constant was used, implying message with a different length, which caused mis-parsing on the read side, mis-aligning and corrupting successive messages.
  • Loading branch information
jboone authored and SpotlightKid committed Apr 6, 2023
1 parent 6b28d19 commit f9a8a36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miditk/smf/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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."""
Expand Down

0 comments on commit f9a8a36

Please sign in to comment.