Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add polyKeyPressure method #121

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion LibSource/MidiMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class MidiMessage {
data[0] == USB_COMMAND_SYSEX_EOX1 ||
data[0] == USB_COMMAND_SYSEX_EOX2 ||
data[0] == USB_COMMAND_SYSEX_EOX3;
}
}
bool isControlChange(){
return (data[1] & MIDI_STATUS_MASK) == CONTROL_CHANGE;
}
Expand Down Expand Up @@ -128,6 +128,9 @@ class MidiMessage {
else
return MidiMessage(USB_COMMAND_NOTE_ON, NOTE_ON|(ch&0xf), note&0x7f, velocity&0x7f);
}
static MidiMessage kp(uint8_t ch, uint8_t note, uint8_t value){
return MidiMessage(USB_COMMAND_POLY_KEY_PRESSURE, POLY_KEY_PRESSURE|(ch&0xf), note&0x7f, value&0x7f);
}
static MidiMessage cp(uint8_t ch, uint8_t value){
return MidiMessage(USB_COMMAND_CHANNEL_PRESSURE, CHANNEL_PRESSURE|(ch&0xf), value&0x7f, 0);
}
Expand Down
4 changes: 1 addition & 3 deletions LibSource/MidiProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ class MidiProcessor {
controlChange(msg);
}else if(msg.isChannelPressure()) {
channelPressure(msg);
}else if(msg.isChannelPressure()) {
channelPressure(msg);
}else if(msg.isPolyKeyPressure()) {
polyKeyPressure(msg);
}
}
}
};

#endif // __MidiProcessor_h__