Skip to content

Commit 9b688c6

Browse files
committed
Fix MIDI channel 16 not working
1 parent 009eb63 commit 9b688c6

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Source/Pd/Instance.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,32 +211,32 @@ struct Instance::internal {
211211

212212
static void instance_multi_noteon(pd::Instance* ptr, int const channel, int const pitch, int const velocity)
213213
{
214-
ptr->receiveNoteOn(channel + 1, pitch, velocity);
214+
ptr->receiveNoteOn(channel, pitch, velocity);
215215
}
216216

217217
static void instance_multi_controlchange(pd::Instance* ptr, int const channel, int const controller, int const value)
218218
{
219-
ptr->receiveControlChange(channel + 1, controller, value);
219+
ptr->receiveControlChange(channel, controller, value);
220220
}
221221

222222
static void instance_multi_programchange(pd::Instance* ptr, int const channel, int const value)
223223
{
224-
ptr->receiveProgramChange(channel + 1, value);
224+
ptr->receiveProgramChange(channel, value);
225225
}
226226

227227
static void instance_multi_pitchbend(pd::Instance* ptr, int const channel, int const value)
228228
{
229-
ptr->receivePitchBend(channel + 1, value);
229+
ptr->receivePitchBend(channel, value);
230230
}
231231

232232
static void instance_multi_aftertouch(pd::Instance* ptr, int const channel, int const value)
233233
{
234-
ptr->receiveAftertouch(channel + 1, value);
234+
ptr->receiveAftertouch(channel, value);
235235
}
236236

237237
static void instance_multi_polyaftertouch(pd::Instance* ptr, int const channel, int const pitch, int const value)
238238
{
239-
ptr->receivePolyAftertouch(channel + 1, pitch, value);
239+
ptr->receivePolyAftertouch(channel, pitch, value);
240240
}
241241

242242
static void instance_multi_midibyte(pd::Instance* ptr, int const port, int const byte)

Source/PluginProcessor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,39 +1684,39 @@ void PluginProcessor::receiveControlChange(int const channel, int const controll
16841684
auto const port = channel >> 4;
16851685
auto const deviceChannel = channel - port * 16;
16861686

1687-
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::controllerEvent(deviceChannel, controller, value), audioAdvancement);
1687+
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::controllerEvent(deviceChannel + 1, controller, value), audioAdvancement);
16881688
}
16891689

16901690
void PluginProcessor::receiveProgramChange(int const channel, int const value)
16911691
{
16921692
auto const port = channel >> 4;
16931693
auto const deviceChannel = channel - port * 16;
16941694

1695-
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::programChange(deviceChannel, value), audioAdvancement);
1695+
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::programChange(deviceChannel + 1, value), audioAdvancement);
16961696
}
16971697

16981698
void PluginProcessor::receivePitchBend(int const channel, int const value)
16991699
{
17001700
auto const port = channel >> 4;
17011701
auto const deviceChannel = channel - port * 16;
17021702

1703-
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::pitchWheel(deviceChannel, value + 8192), audioAdvancement);
1703+
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::pitchWheel(deviceChannel + 1, value + 8192), audioAdvancement);
17041704
}
17051705

17061706
void PluginProcessor::receiveAftertouch(int const channel, int const value)
17071707
{
17081708
auto const port = channel >> 4;
17091709
auto const deviceChannel = channel - port * 16;
17101710

1711-
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::channelPressureChange(deviceChannel, value), audioAdvancement);
1711+
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::channelPressureChange(deviceChannel + 1, value), audioAdvancement);
17121712
}
17131713

17141714
void PluginProcessor::receivePolyAftertouch(int const channel, int const pitch, int const value)
17151715
{
17161716
auto const port = channel >> 4;
17171717
auto const deviceChannel = channel - port * 16;
17181718

1719-
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::aftertouchChange(deviceChannel, pitch, value), audioAdvancement);
1719+
midiDeviceManager.enqueueMidiOutput(port, MidiMessage::aftertouchChange(deviceChannel + 1, pitch, value), audioAdvancement);
17201720
}
17211721

17221722
void PluginProcessor::receiveMidiByte(int const channel, int const byte)

0 commit comments

Comments
 (0)