Skip to content

Commit

Permalink
fixing values for parsing of pedals (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Natooz committed Dec 6, 2023
1 parent 6a0656f commit 6f0a8f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miditoolkit/midi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,12 +328,12 @@ def __get_instrument(
for control_change in instrument.control_changes:
if control_change.number != 64:
continue
elif last_pedal_on_time is not None and control_change.value == 0:
elif last_pedal_on_time is not None and control_change.value < 64:
instrument.pedals.append(
Pedal(last_pedal_on_time, control_change.time)
)
last_pedal_on_time = None
elif last_pedal_on_time is None and control_change.value == 127:
elif last_pedal_on_time is None and control_change.value >= 64:
last_pedal_on_time = control_change.time

return instruments
Expand Down

0 comments on commit 6f0a8f3

Please sign in to comment.