Control Surface  1.1.0
MIDI Control Surface library for Arduino
ManyAddresses/CCPotentiometer.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
8 namespace Bankable {
9 namespace ManyAddresses {
10 
11 /**
12  * @brief A class of MIDIOutputElement%s that read the analog input from a
13  * **potentiometer or fader**, and send out 7-bit MIDI **Control
14  * Change** events.
15  *
16  * The analog input is filtered and hysteresis is applied for maximum
17  * stability.
18  * This version can be banked using an arbitrary list of alternative
19  * addresses.
20  *
21  * @tparam N
22  * The number of variants/alternative addresses the element has.
23  *
24  * @ingroup ManyAddressesMIDIOutputElements
25  */
26 template <setting_t N>
28  : public Bankable::MIDIFilteredAnalogAddressable<ManyAddresses<N>,
29  ContinuousCCSender> {
30  public:
31  /**
32  * @brief Create a new CCPotentiometer object with the given
33  * analog pin, and address list.
34  *
35  * @param bank
36  * The bank that selects the address to use.
37  * @param analogPin
38  * The analog input pin to read from.
39  * @param addresses
40  * The list of MIDI addresses containing the controller number
41  * [0, 119], channel [CHANNEL_1, CHANNEL_16], and optional cable
42  * number [0, 15].
43  * @param sender
44  * The MIDI sender to use.
45  *
46  * @ingroup MIDIOutputElementConstructors
47  */
48  CCPotentiometer(const Bank<N> &bank, pin_t analogPin,
49  const Array<MIDICNChannelAddress, N> &addresses,
50  const ContinuousCCSender &sender = {})
52  {bank, addresses}, analogPin, sender} {}
53 };
54 
55 } // namespace ManyAddresses
56 } // namespace Bankable
57 
Bank
A class that groups Bankable BankableMIDIOutputs and BankableMIDIInputs, and allows the user to chang...
Definition: Bank.hpp:77
Bankable
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
Definition: BankAddresses.hpp:7
Bankable::MIDIFilteredAnalogAddressable< ManyAddresses< N >, ContinuousCCSender >::sender
ContinuousCCSender sender
Definition: Bankable/Abstract/MIDIFilteredAnalog.hpp:79
Bankable::ManyAddresses::CCPotentiometer::CCPotentiometer
CCPotentiometer(const Bank< N > &bank, pin_t analogPin, const Array< MIDICNChannelAddress, N > &addresses, const ContinuousCCSender &sender={})
Create a new CCPotentiometer object with the given analog pin, and address list.
Definition: ManyAddresses/CCPotentiometer.hpp:48
Bankable::ManyAddresses::ManyAddresses< N >
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:9
BankAddresses.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: Settings/NamespaceSettings.hpp:10
AH::Array
An array wrapper for easy copying, comparing, and iterating.
Definition: Array.hpp:36
MIDIFilteredAnalog.hpp
AH::pin_t
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
Definition: Hardware-Types.hpp:17
Bankable::ManyAddresses::CCPotentiometer
A class of MIDIOutputElements that read the analog input from a potentiometer or fader,...
Definition: ManyAddresses/CCPotentiometer.hpp:27
ContinuousCCSender.hpp
Bankable::MIDIFilteredAnalogAddressable
A class for potentiometers and faders that send MIDI events and that can be added to a Bank.
Definition: Bankable/Abstract/MIDIFilteredAnalog.hpp:21
ContinuousCCSender
Definition: ContinuousCCSender.hpp:7