Line data Source code
1 : #pragma once 2 : 3 : #include <Control_Surface/Control_Surface_Class.hpp> 4 : 5 : BEGIN_CS_NAMESPACE 6 : 7 : class DigitalNoteSender { 8 : public: 9 26 : DigitalNoteSender(uint8_t velocity = 0x7F) : velocity(velocity) {} 10 18 : void sendOn(MIDICNChannelAddress address) { 11 18 : Control_Surface.MIDI().sendNoteOn(address, getVelocity()); 12 18 : } 13 18 : void sendOff(MIDICNChannelAddress address) { 14 18 : Control_Surface.MIDI().sendNoteOff(address, 0x7F); 15 18 : } 16 : 17 : void setVelocity(uint8_t velocity) { this->velocity = velocity; } 18 18 : uint8_t getVelocity() const { return this->velocity; } 19 : 20 : private: 21 : uint8_t velocity; 22 : }; 23 : 24 : END_CS_NAMESPACE