48 template <
typename PacketCallback>
62 std::byte ((0x4 << 0x4) | Utils::getGroup (
firstWord)),
120 groupAccumulators = {};
125 enum class PnKind { nrpn, rpn };
129 std::byte typeAndGroup;
135 static PacketX2 processNoteOnOrOff (HelperValues helpers);
136 static PacketX2 processPolyPressure (HelperValues helpers);
138 bool processControlChange (HelperValues helpers, PacketX2& packet);
140 PacketX2 processProgramChange (HelperValues helpers)
const;
142 static PacketX2 processChannelPressure (HelperValues helpers);
143 static PacketX2 processPitchBend (HelperValues helpers);
148 bool addByte (uint8_t cc, std::byte
byte);
150 const std::array<std::byte, 4>& getBytes() const noexcept {
return bytes; }
151 PnKind getKind() const noexcept {
return kind; }
154 std::array<std::byte, 4> bytes;
156 PnKind kind = PnKind::nrpn;
162 bool isValid() const noexcept {
return ! (msb & 0x80); }
164 uint8_t getMsb() const noexcept {
return msb & 0x7f; }
165 uint8_t getLsb() const noexcept {
return lsb & 0x7f; }
167 void setMsb (uint8_t i)
noexcept { msb = i & 0x7f; }
168 void setLsb (uint8_t i)
noexcept { msb &= 0x7f; lsb = i & 0x7f; }
179 using ChannelAccumulators = std::array<PnAccumulator, 16>;
180 std::array<ChannelAccumulators, 16> groupAccumulators;
182 using ChannelBanks = std::array<Bank, 16>;
183 std::array<ChannelBanks, 16> groupBanks;