Line data Source code
1 : #pragma once 2 : 3 : #include <MIDI_Outputs/Abstract/MIDIFilteredAnalog.hpp> 4 : #include <MIDI_Senders/ContinuousCCSender.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 7-bit MIDI 11 : * **Control Change** events. 12 : * 13 : * The analog input is filtered and hysteresis is applied for maximum 14 : * stability. 15 : * This version cannot be banked. 16 : * 17 : * @ingroup MIDIOutputElements 18 : */ 19 4 : class CCPotentiometer 20 : : public MIDIFilteredAnalogAddressable<ContinuousCCSender> { 21 : public: 22 : /** 23 : * @brief Create a new CCPotentiometer object with the given analog pin, 24 : * controller number and channel. 25 : * 26 : * @param analogPin 27 : * The analog input pin to read from. 28 : * @param address 29 : * The MIDI address containing the controller number [0, 119], 30 : * channel [CHANNEL_1, CHANNEL_16], and optional cable number 31 : * [CABLE_1, CABLE_16]. 32 : */ 33 4 : CCPotentiometer(pin_t analogPin, const MIDIAddress &address) 34 4 : : MIDIFilteredAnalogAddressable(analogPin, address, {}) {} 35 : }; 36 : 37 : END_CS_NAMESPACE