This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Macros | Typedefs | Variables
Settings.hpp File Reference

All user settings and debugging options can be changed here. More...

#include <Def/Frequency.hpp>
#include <Helpers/ADCConfig.hpp>
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for Settings.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FATAL_ERRORS
 The debug output. More...
 
#define IGNORE_SYSEX   0
 Don't parse incoming System Exclusive messages. More...
 
#define INDIVIDUAL_BUTTON_INVERT
 Make it possible to invert individual push buttons. More...
 

Typedefs

using ANALOG_FILTER_TYPE = uint16_t
 The unsigned integer type to use for analog inputs during filtering. More...
 

Variables

constexpr unsigned long defaultBaudRate = 115200
 The default baud rate for debug MIDI interfaces. More...
 
constexpr uint8_t ADC_BITS = ADC_RESOLUTION
 The bit depth to use for the ADC (Analog to Digital Converter). More...
 
constexpr uint8_t ANALOG_FILTER_SHIFT_FACTOR = 2
 The factor for the analog filter:
Difference equation: \( y[n] = \alpha\cdot x[n] + (1-\alpha)\cdot y[n-1] \) where \( \alpha = \left(\frac{1}{2}\right)^{ANALOG\_FILTER\_SHIFT\_FACTOR} \). More...
 
constexpr unsigned long BUTTON_DEBOUNCE_TIME = 25
 The debounce time for momentary push buttons in milliseconds. More...
 
constexpr unsigned long LONG_PRESS_DELAY = 450
 The time in milliseconds before a press is registered as a long press. More...
 
constexpr unsigned long LONG_PRESS_REPEAT_DELAY = 200
 The time between increments/decremnets during a long press. More...
 
constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL = 1000
 The interval between updating filtered analog inputs, in microseconds. More...
 
constexpr unsigned long VU_PEAK_DECAY_TIME = 300
 The time in milliseconds it takes for the VU meter display peak bar to drop one unit (i.e. More...
 
constexpr unsigned long VU_PEAK_HOLD_TIME = 400
 The time in milliseconds that a VU meter display peak bar stays at the peak before decaying. More...
 
constexpr bool VU_PEAK_SMOOTH_DECAY = true
 If set to true, the VU meter display peak bars will decay smoothly (i.e. More...
 
constexpr uint8_t NOTE_VELOCITY_THRESHOLD = 1
 Determines when a note input should be interpreted as 'on'. More...
 
constexpr size_t SYSEX_BUFFER_SIZE = 128
 The length of the maximum System Exclusive message that can be received. More...
 
constexpr unsigned long HAIRLESS_BAUD = 115200
 The baud rate to use for Hairless MIDI. More...
 
constexpr uint8_t MAX_FPS = 60
 The maximum frame rate of the displays. More...
 
constexpr static Frequency SPI_MAX_SPEED = 8_MHz
 

Detailed Description

All user settings and debugging options can be changed here.

Definition in file Settings.hpp.

Macro Definition Documentation

◆ FATAL_ERRORS

#define FATAL_ERRORS

The debug output.

Exit when encountering an error, instead of trying to recover (recommended).

Definition at line 28 of file Settings.hpp.

◆ IGNORE_SYSEX

#define IGNORE_SYSEX   0

Don't parse incoming System Exclusive messages.

Definition at line 99 of file Settings.hpp.

◆ INDIVIDUAL_BUTTON_INVERT

#define INDIVIDUAL_BUTTON_INVERT

Make it possible to invert individual push buttons.

Enabling this will increase memory usage.

Definition at line 117 of file Settings.hpp.

Typedef Documentation

◆ ANALOG_FILTER_TYPE

using ANALOG_FILTER_TYPE = uint16_t

The unsigned integer type to use for analog inputs during filtering.

See also
FilteredAnalog

Definition at line 69 of file Settings.hpp.

Variable Documentation

◆ defaultBaudRate

constexpr unsigned long defaultBaudRate = 115200
constexpr

The default baud rate for debug MIDI interfaces.

Definition at line 34 of file Settings.hpp.

◆ ADC_BITS

constexpr uint8_t ADC_BITS = ADC_RESOLUTION
constexpr

The bit depth to use for the ADC (Analog to Digital Converter).

By default, the maximum supported resolution is used, but if you need it for compatibility with other code that expects the default 10-bit resolution, you can use

constexpr uint8_t ADC_BITS = 10;

If the library doesn't know your specific hardware, it defaults to 10 bits. This might not be the optimal resolution, so it's best to add the actual resolution to Helpers/ADCConfig.hpp.

Definition at line 51 of file Settings.hpp.

◆ ANALOG_FILTER_SHIFT_FACTOR

constexpr uint8_t ANALOG_FILTER_SHIFT_FACTOR = 2
constexpr

The factor for the analog filter:
Difference equation: \( y[n] = \alpha\cdot x[n] + (1-\alpha)\cdot y[n-1] \) where \( \alpha = \left(\frac{1}{2}\right)^{ANALOG\_FILTER\_SHIFT\_FACTOR} \).

See also
FilteredAnalog

Definition at line 62 of file Settings.hpp.

◆ BUTTON_DEBOUNCE_TIME

constexpr unsigned long BUTTON_DEBOUNCE_TIME = 25
constexpr

The debounce time for momentary push buttons in milliseconds.

Definition at line 72 of file Settings.hpp.

◆ LONG_PRESS_DELAY

constexpr unsigned long LONG_PRESS_DELAY = 450
constexpr

The time in milliseconds before a press is registered as a long press.

Definition at line 75 of file Settings.hpp.

◆ LONG_PRESS_REPEAT_DELAY

constexpr unsigned long LONG_PRESS_REPEAT_DELAY = 200
constexpr

The time between increments/decremnets during a long press.

Definition at line 78 of file Settings.hpp.

◆ FILTERED_INPUT_UPDATE_INTERVAL

constexpr unsigned long FILTERED_INPUT_UPDATE_INTERVAL = 1000
constexpr

The interval between updating filtered analog inputs, in microseconds.

Definition at line 81 of file Settings.hpp.

◆ VU_PEAK_DECAY_TIME

constexpr unsigned long VU_PEAK_DECAY_TIME = 300
constexpr

The time in milliseconds it takes for the VU meter display peak bar to drop one unit (i.e.

one twelfth of the complete scale).

Definition at line 85 of file Settings.hpp.

◆ VU_PEAK_HOLD_TIME

constexpr unsigned long VU_PEAK_HOLD_TIME = 400
constexpr

The time in milliseconds that a VU meter display peak bar stays at the peak before decaying.

Definition at line 89 of file Settings.hpp.

◆ VU_PEAK_SMOOTH_DECAY

constexpr bool VU_PEAK_SMOOTH_DECAY = true
constexpr

If set to true, the VU meter display peak bars will decay smoothly (i.e.

one pixel at a time), if set to false, they will decay one unit at a time. *‍/

Definition at line 93 of file Settings.hpp.

◆ NOTE_VELOCITY_THRESHOLD

constexpr uint8_t NOTE_VELOCITY_THRESHOLD = 1
constexpr

Determines when a note input should be interpreted as 'on'.

Definition at line 96 of file Settings.hpp.

◆ SYSEX_BUFFER_SIZE

constexpr size_t SYSEX_BUFFER_SIZE = 128
constexpr

The length of the maximum System Exclusive message that can be received.

The maximum length sent by the MCU protocol is 120 bytes.

Definition at line 105 of file Settings.hpp.

◆ HAIRLESS_BAUD

constexpr unsigned long HAIRLESS_BAUD = 115200
constexpr

The baud rate to use for Hairless MIDI.

Definition at line 108 of file Settings.hpp.

◆ MAX_FPS

constexpr uint8_t MAX_FPS = 60
constexpr

The maximum frame rate of the displays.

Examples
2.VU-Meter-OLED-USB-DAC.ino.

Definition at line 111 of file Settings.hpp.

◆ SPI_MAX_SPEED

constexpr static Frequency SPI_MAX_SPEED = 8_MHz
staticconstexpr
ADC_BITS
constexpr uint8_t ADC_BITS
The bit depth to use for the ADC (Analog to Digital Converter).
Definition: Settings.hpp:51