|
MCC
|
Text formatting and parsing into caller-provided buffers. More...

Namespaces | |
| namespace | MCC::Notation |
| Text formatting and parsing for note names, pitches and intervals. | |
Classes | |
| struct | MCC::NotationOptions |
| Options for text output (SPEC-TXT-3). More... | |
Enumerations | |
| enum class | MCC::NotationSymbols : uint8_t { MCC::NotationSymbols::Ascii , MCC::NotationSymbols::Unicode } |
| Accidental symbols used in text output (SPEC-TXT-3). More... | |
Text formatting and parsing into caller-provided buffers.
MCC::Notation::Format() writes note names, pitches, intervals and, when their modules are enabled, catalog scales, chord symbols and keys. Output follows snprintf semantics in code units and never allocates (SPEC-TXT-1..2). ASCII symbols are the default (C#4, Bbb, AA4); NotationOptions::symbols selects Unicode accidentals (C♯4, B𝄫) and explicitNatural writes the natural sign (SPEC-TXT-3). The buffer type selects the encoding: char for ASCII or UTF-8, char16_t for UTF-16 and char32_t for UTF-32 (SPEC-TXT-5). A CodePointSink overload sends each code point to a callback instead, so text can go straight to a serial port or display without a buffer. ParseNoteName(), ParsePitch() and ParseInterval() read any of the three encodings, ASCII or Unicode symbols, either letter case and x for the double sharp, and return the invalid value on malformed text (SPEC-TXT-4). Text constants are stored in program memory on AVR.
Available when MCC_NOTATION is defined. Requires the Interval module.
|
strong |
Accidental symbols used in text output (SPEC-TXT-3).
| Enumerator | |
|---|---|
| Ascii | #, b and n, repeated for multiples. |
| Unicode | U+266F sharp, U+266D flat, U+266E natural, U+1D12A double sharp and U+1D12B double flat. |