rstmt_core/
consts.rs

1/*
2    Appellation: consts <module>
3    Created At: 2025.12.29:16:49:00
4    Contrib: @FL03
5*/
6//! various constants defined and used throughout the library.
7
8pub const OCTAVE_SIZE: usize = 12;
9/// The C Major scale represented as an array of pitch class indices.
10pub const C_MAJOR_SCALE: [usize; 7] = [0, 2, 4, 5, 7, 9, 11];
11/// Defines the frequency of the A4 note in Hertz.
12pub const A4_FREQUENCY: f64 = 440.0;
13/// Defines the frequency of the C4 note in Hertz.
14pub const C4_FREQUENCY: f64 = 261.625565;
15
16pub const NATURAL_SYMBOL: char = '♮';
17pub const SHARP_SYMBOL: char = '♯';
18pub const FLAT_SYMBOL: char = '♭';
19pub const DOUBLE_SHARP_SYMBOL: char = '𝄪';
20pub const DOUBLE_FLAT_SYMBOL: char = '𝄫';
21
22pub const NATURAL_PITCH_CLASSES: [&str; 7] = ["C", "D", "E", "F", "G", "A", "B"];
23
24pub const SHARP_PITCH_CLASSES: [&str; 5] = ["C#", "D#", "F#", "G#", "A#"];
25
26pub const FLAT_PITCH_CLASSES: [&str; 5] = ["Db", "Eb", "Gb", "Ab", "Bb"];
27
28pub const ENHARMONIC_EQUIVALENTS: [(&str, &str); 10] = [
29    ("C#", "Db"),
30    ("D#", "Eb"),
31    ("F#", "Gb"),
32    ("G#", "Ab"),
33    ("A#", "Bb"),
34    ("Db", "C#"),
35    ("Eb", "D#"),
36    ("Gb", "F#"),
37    ("Ab", "G#"),
38    ("Bb", "A#"),
39];