This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
Notes.hpp
Go to the documentation of this file.
1 /* ✔ */
2 
3 #pragma once
4 
6 #include <stdint.h>
7 
9 
12 
16 namespace MIDI_Notes {
17 
18 constexpr int8_t C = 0;
19 constexpr int8_t Db = 1;
20 constexpr int8_t D = 2;
21 constexpr int8_t Eb = 3;
22 constexpr int8_t E = 4;
23 constexpr int8_t F = 5;
24 constexpr int8_t Gb = 6;
25 constexpr int8_t G = 7;
26 constexpr int8_t Ab = 8;
27 constexpr int8_t A = 9;
28 constexpr int8_t Bb = 10;
29 constexpr int8_t B = 11;
30 
32 constexpr int8_t octave(int8_t numOctave) { return 12 * (numOctave + 1); }
33 
35 constexpr int8_t note(int8_t note, int8_t numOctave) {
36  return note + octave(numOctave);
37 }
38 
39 } // namespace MIDI_Notes
40 
42 
MIDI_Notes::A
constexpr int8_t A
Definition: Notes.hpp:27
MIDI_Notes::Ab
constexpr int8_t Ab
Definition: Notes.hpp:26
MIDI_Notes::Eb
constexpr int8_t Eb
Definition: Notes.hpp:21
MIDI_Notes::G
constexpr int8_t G
Definition: Notes.hpp:25
MIDI_Notes::E
constexpr int8_t E
Definition: Notes.hpp:22
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition: NamespaceSettings.hpp:9
MIDI_Notes::note
constexpr int8_t note(int8_t note, int8_t numOctave)
Get the MIDI note in the given octave.
Definition: Notes.hpp:35
MIDI_Notes::octave
constexpr int8_t octave(int8_t numOctave)
Get the first MIDI note in the given octave.
Definition: Notes.hpp:32
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition: NamespaceSettings.hpp:10
NamespaceSettings.hpp
MIDI_Notes::Db
constexpr int8_t Db
Definition: Notes.hpp:19
MIDI_Notes::D
constexpr int8_t D
Definition: Notes.hpp:20
MIDI_Notes::B
constexpr int8_t B
Definition: Notes.hpp:29
MIDI_Notes::C
constexpr int8_t C
Definition: Notes.hpp:18
MIDI_Notes
MIDI note names.
Definition: Notes.hpp:16
MIDI_Notes::Bb
constexpr int8_t Bb
Definition: Notes.hpp:28
MIDI_Notes::Gb
constexpr int8_t Gb
Definition: Notes.hpp:24
MIDI_Notes::F
constexpr int8_t F
Definition: Notes.hpp:23