Control Surface
1.1.0
MIDI Control Surface library for Arduino
src
MIDI_Outputs
Bankable
Bankable/PBPotentiometer.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
AH/Settings/Warnings.hpp
>
4
AH_DIAGNOSTIC_WERROR
()
5
6
#include <Banks/BankAddresses.hpp>
7
#include <
MIDI_Outputs/Bankable/Abstract/MIDIFilteredAnalog.hpp
>
8
#include <
MIDI_Senders/PitchBendSender.hpp
>
9
10
BEGIN_CS_NAMESPACE
11
12
namespace
Bankable
{
13
14
/**
15
* @brief A class of MIDIOutputElement%s that read the analog input from a
16
* **potentiometer or fader**, and send out 14-bit MIDI **Pitch Bend**
17
* events.
18
*
19
* The analog input is filtered and hysteresis is applied for maximum
20
* stability.
21
* The actual precision is "only" 10 bits, because this is the resolution of the
22
* built-in ADC, and this is the default resolution used by the Mackie Control
23
* Universal protocol.
24
* This version can be banked.
25
*
26
* @ingroup BankableMIDIOutputElements
27
*/
28
class
PBPotentiometer
29
:
public
MIDIFilteredAnalog
<SingleAddress, PitchBendSender<10>> {
30
public
:
31
/**
32
* @brief Create a new Bankable PBPotentiometer object with the given
33
* analog pin and channel.
34
*
35
* @param config
36
* The bank configuration to use: the bank to add this element to,
37
* and whether to change the address, channel or cable number.
38
* @param analogPin
39
* The analog input pin to read from.
40
* @param address
41
* The MIDI channel [CHANNEL_1, CHANNEL_16] and optional Cable
42
* Number [0, 15].
43
* @param sender
44
* The MIDI sender to use.
45
*/
46
PBPotentiometer
(
const
OutputBankConfig
&config,
pin_t
analogPin,
47
const
MIDICNChannel
&
address
,
48
const
PitchBendSender<10>
&
sender
= {})
49
:
MIDIFilteredAnalog
{{config,
address
}, analogPin,
sender
} {}
50
};
51
52
}
// namespace Bankable
53
54
END_CS_NAMESPACE
55
56
AH_DIAGNOSTIC_POP
()
Warnings.hpp
Bankable
A namespace for MIDI elements that can be added to a Bank, to change their address or channel.
Definition:
BankAddresses.hpp:7
Bankable::MIDIFilteredAnalog
A class for potentiometers and faders that send MIDI events (with only a channel, no address) and tha...
Definition:
Bankable/Abstract/MIDIFilteredAnalog.hpp:93
Bankable::PBPotentiometer::PBPotentiometer
PBPotentiometer(const OutputBankConfig &config, pin_t analogPin, const MIDICNChannel &address, const PitchBendSender< 10 > &sender={})
Create a new Bankable PBPotentiometer object with the given analog pin and channel.
Definition:
Bankable/PBPotentiometer.hpp:46
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:9
AH_DIAGNOSTIC_POP
#define AH_DIAGNOSTIC_POP()
Definition:
Warnings.hpp:17
PitchBendSender< 10 >
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition:
Settings/NamespaceSettings.hpp:10
PitchBendSender.hpp
Bankable::MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >::sender
PitchBendSender< 10 > sender
Definition:
Bankable/Abstract/MIDIFilteredAnalog.hpp:151
MIDIFilteredAnalog.hpp
MIDICNChannel
A class for saving a MIDI channel and cable number.
Definition:
MIDICNChannelAddress.hpp:19
AH::pin_t
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
Definition:
Hardware-Types.hpp:17
AH_DIAGNOSTIC_WERROR
#define AH_DIAGNOSTIC_WERROR()
Definition:
Warnings.hpp:16
Bankable::MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >::address
SingleAddress address
Definition:
Bankable/Abstract/MIDIFilteredAnalog.hpp:147
OutputBankConfig
A struct for selecting the bank of BankableMIDIOutputs and the bank type.
Definition:
BankConfig.hpp:50
Bankable::PBPotentiometer
A class of MIDIOutputElements that read the analog input from a potentiometer or fader,...
Definition:
Bankable/PBPotentiometer.hpp:28
Generated by
1.8.16