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