Line data Source code
1 : #pragma once
2 :
3 : #include <Banks/BankAddresses.hpp>
4 : #include <MIDI_Outputs/Bankable/Abstract/MIDIFilteredAnalog.hpp>
5 : #include <MIDI_Senders/PitchBendSender.hpp>
6 :
7 : BEGIN_CS_NAMESPACE
8 :
9 : namespace Bankable {
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 can be banked.
22 : *
23 : * @ingroup BankableMIDIOutputElements
24 : */
25 : class PBPotentiometer
26 : : public MIDIFilteredAnalog<SingleAddress, PitchBendSender<10>> {
27 : public:
28 : /**
29 : * @brief Create a new Bankable PBPotentiometer object with the given
30 : * analog pin and channel.
31 : *
32 : * @param config
33 : * The bank configuration to use: the bank to add this element to,
34 : * and whether to change the address, channel or cable number.
35 : * @param analogPin
36 : * The analog input pin to read from.
37 : * @param address
38 : * The MIDI channel [Channel_1, Channel_16] and optional Cable
39 : * Number [Cable_1, Cable_16].
40 : */
41 1 : PBPotentiometer(OutputBankConfig<BankType::ChangeChannel> config,
42 : pin_t analogPin, MIDIChannelCable address)
43 1 : : MIDIFilteredAnalog {{config, address}, analogPin, {}} {}
44 : };
45 :
46 : } // namespace Bankable
47 :
48 : END_CS_NAMESPACE
|