Parses RPN (Registered Parameter Number) and NRPN (Non-Registered Parameter Number) messages from a stream of MIDI CC events.
More...
#include <rpn_parser.hpp>
|
| void | process (const MidiEvent &event) |
| | Process a MIDI event. Non-CC events are ignored.
|
| void | reset () |
| | Reset all channel state.
|
|
| std::function< void(uint8_t channel, uint16_t parameter, uint16_t value)> | on_rpn |
| | Called when a complete RPN message is received.
|
| std::function< void(uint8_t channel, uint16_t parameter, uint16_t value)> | on_nrpn |
| | Called when a complete NRPN message is received.
|
| std::function< void(uint8_t channel, uint16_t parameter, bool is_rpn)> | on_increment |
| | Called when an increment (CC 96) is received for the active parameter.
|
| std::function< void(uint8_t channel, uint16_t parameter, bool is_rpn)> | on_decrement |
| | Called when a decrement (CC 97) is received for the active parameter.
|
Parses RPN (Registered Parameter Number) and NRPN (Non-Registered Parameter Number) messages from a stream of MIDI CC events.
RPN/NRPN messages are multi-CC sequences:
- CC 101/99 (MSB) + CC 100/98 (LSB) → selects the parameter
- CC 6 (Data Entry MSB) + CC 38 (Data Entry LSB) → sets the value
- CC 96/97 → increment/decrement
rpn.
on_rpn = [](uint8_t ch, uint16_t param, uint16_t value) {
if (param == 0) set_pitch_bend_range(value >> 7);
};
rpn.
on_nrpn = [](uint8_t ch, uint16_t param, uint16_t value) {
handle_custom_param(param, value);
};
Parses RPN (Registered Parameter Number) and NRPN (Non-Registered Parameter Number) messages from a s...
Definition rpn_parser.hpp:32
std::function< void(uint8_t channel, uint16_t parameter, uint16_t value)> on_nrpn
Called when a complete NRPN message is received.
Definition rpn_parser.hpp:41
void process(const MidiEvent &event)
Process a MIDI event. Non-CC events are ignored.
Definition rpn_parser.hpp:50
std::function< void(uint8_t channel, uint16_t parameter, uint16_t value)> on_rpn
Called when a complete RPN message is received.
Definition rpn_parser.hpp:38
◆ process()
| void pulp::midi::RpnParser::process |
( |
const MidiEvent & | event | ) |
|
|
inline |
Process a MIDI event. Non-CC events are ignored.
◆ reset()
| void pulp::midi::RpnParser::reset |
( |
| ) |
|
|
inline |
◆ on_decrement
| std::function<void(uint8_t channel, uint16_t parameter, bool is_rpn)> pulp::midi::RpnParser::on_decrement |
Called when a decrement (CC 97) is received for the active parameter.
◆ on_increment
| std::function<void(uint8_t channel, uint16_t parameter, bool is_rpn)> pulp::midi::RpnParser::on_increment |
Called when an increment (CC 96) is received for the active parameter.
◆ on_nrpn
| std::function<void(uint8_t channel, uint16_t parameter, uint16_t value)> pulp::midi::RpnParser::on_nrpn |
Called when a complete NRPN message is received.
◆ on_rpn
| std::function<void(uint8_t channel, uint16_t parameter, uint16_t value)> pulp::midi::RpnParser::on_rpn |
Called when a complete RPN message is received.
- Parameters
-
| channel | MIDI channel (0-15). |
| parameter | 14-bit parameter number (MSB << 7 | LSB). |
| value | 14-bit data value (MSB << 7 | LSB). |
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/midi/include/pulp/midi/rpn_parser.hpp