Skip to content

Commit 35fc048

Browse files
committed
Implement sustain message
1 parent 1c4d5bf commit 35fc048

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/tests/midi_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ def note_off_with_nil_velocity_case
2828
assert_equal [[MIDI::NOTE_OFF_EVENT || 0, 0, 76]], @midi.instance_variable_get("@buffer")
2929
end
3030

31+
description "sustain on"
32+
def sustain_on_case
33+
@midi.send_sustain(1)
34+
assert_equal [[MIDI::CONTROL_CHANGE_EVENT || 0, 0x7f]], @midi.instance_variable_get("@buffer")
35+
end
36+
37+
description "sustain off"
38+
def sustain_off_case
39+
@midi.send_sustain(0)
40+
assert_equal [[MIDI::CONTROL_CHANGE_EVENT || 0, 0]], @midi.instance_variable_get("@buffer")
41+
end
42+
3143
description "task_when_chord_mode_on_with_major"
3244
def convert_chord_pattern_with_major_case
3345
assert_equal [0, 4, 7], @midi.convert_chord_pattern(0)

0 commit comments

Comments
 (0)