Skip to content

Commit

Permalink
fixing channel number assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrey-xx committed Jan 9, 2018
1 parent 706778c commit 93fb9b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mopo/src/arpeggiator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ namespace mopo {
}

void Arpeggiator::setPressure(mopo_float pressure, int channel, int sample) {
MOPO_ASSERT(channel >= 1 && channel <= mopo::NUM_MIDI_CHANNELS);
MOPO_ASSERT(channel >= 0 && channel <= mopo::NUM_MIDI_CHANNELS);
for (const auto &n : pressed_notes_) {
if (channel_[n] == channel) {
aftertouch_[n] = pressure;
Expand Down
2 changes: 1 addition & 1 deletion mopo/src/voice_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ namespace mopo {
}

void VoiceHandler::setPressure(mopo_float pressure, int channel, int sample) {
MOPO_ASSERT(channel >= 1 && channel <= mopo::NUM_MIDI_CHANNELS);
MOPO_ASSERT(channel >= 0 && channel <= mopo::NUM_MIDI_CHANNELS);
for (Voice* voice : active_voices_) {
if (voice->state().channel == channel)
voice->setAftertouch(pressure, sample);
Expand Down

0 comments on commit 93fb9b3

Please sign in to comment.