Line data Source code
1 : #pragma once 2 : 3 : #include <AH/Settings/Warnings.hpp> 4 : AH_DIAGNOSTIC_WERROR() 5 : 6 : #include <MIDI_Outputs/Abstract/MIDIFilteredAnalog.hpp> 7 : #include <MIDI_Senders/PitchBendSender.hpp> 8 : 9 : BEGIN_CS_NAMESPACE 10 : 11 : /** 12 : * @brief A class of MIDIOutputElement%s that read the analog input from a 13 : * **potentiometer or fader**, and send out 14-bit MIDI **Pitch Bend** 14 : * events. 15 : * 16 : * The analog input is filtered and hysteresis is applied for maximum 17 : * stability. 18 : * The actual precision is "only" 10 bits, because this is the resolution of the 19 : * built-in ADC, and this is the default resolution used by the Mackie Control 20 : * Universal protocol. 21 : * This version cannot be banked. 22 : * 23 : * @ingroup MIDIOutputElements 24 : */ 25 4 : class PBPotentiometer : public MIDIFilteredAnalog<PitchBendSender<10>> { 26 : public: 27 : /** 28 : * @brief Create a new PBPotentiometer object with the given analog pin 29 : * and channel. 30 : * 31 : * @param analogPin 32 : * The analog input pin to read from. 33 : * @param address 34 : * The MIDI channel [CHANNEL_1, CHANNEL_16] and optional Cable 35 : * Number [CABLE_1, CABLE_16]. 36 : */ 37 4 : PBPotentiometer(pin_t analogPin, const MIDIChannelCN &address = CHANNEL_1) 38 4 : : MIDIFilteredAnalog(analogPin, address, {}) {} 39 : }; 40 : 41 : END_CS_NAMESPACE 42 : 43 : AH_DIAGNOSTIC_POP()