Skip to content

Commit 49f61d9

Browse files
committed
fix: correct RPN log ch numbers off by one
1 parent 50b156a commit 49f61d9

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/midi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ static void set_fm_chan_parameter(DeviceChannel* devChan, u8 controller, u8 valu
891891
enable_dac(RANGE(value, 2));
892892
break;
893893
default:
894-
log_warn("Ch %d: CC 0x%02X 0x%02X?", devChan->midiChannel, controller, value);
894+
log_warn("Ch %d: CC 0x%02X 0x%02X?", devChan->midiChannel + 1, controller, value);
895895
break;
896896
}
897897
}
@@ -954,9 +954,9 @@ static void rpn_data_entry(MidiChannel* chan, u8 value, bool is_msb)
954954
break;
955955
default:
956956
if (is_msb) {
957-
log_warn("Ch %d: RPN? 0x%04X MSB=0x%02X", chan->num, chan->rpn, value);
957+
log_warn("Ch %d: RPN? 0x%04X MSB=0x%02X", chan->num + 1, chan->rpn, value);
958958
} else {
959-
log_warn("Ch %d: RPN? 0x%04X LSB=0x%02X", chan->num, chan->rpn, value);
959+
log_warn("Ch %d: RPN? 0x%04X LSB=0x%02X", chan->num + 1, chan->rpn, value);
960960
}
961961
break;
962962
}

utils/midi/null-rpn-write

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
. $(dirname $0)/set-var
4+
5+
sendmidi dev "$MDMI_MIDI_PORT" cc 101 127
6+
sendmidi dev "$MDMI_MIDI_PORT" cc 100 127
7+
sendmidi dev "$MDMI_MIDI_PORT" cc 6 48
8+
sendmidi dev "$MDMI_MIDI_PORT" cc 38 1

utils/midi/set-pitch-bend-sensitivity

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
. $(dirname $0)/set-var
4+
5+
sendmidi dev "$MDMI_MIDI_PORT" cc 101 0
6+
sendmidi dev "$MDMI_MIDI_PORT" cc 100 0
7+
sendmidi dev "$MDMI_MIDI_PORT" cc 6 48
8+
sendmidi dev "$MDMI_MIDI_PORT" cc 38 0

0 commit comments

Comments
 (0)