Parses a domain-specific text notation into a sequence of MusicalNote objects.
More...
#include <notesequenceparser.h>
Parses a domain-specific text notation into a sequence of MusicalNote objects.
NoteSequenceParser interprets a compact text language for describing musical sequences. The language supports:
- Letter notes: A–G with optional sharps (#) and flats (b), octave shifts (+/-), dots, and duration modifiers (*N, /N).
- Numeric scale degrees: Integer scale degrees (0-based) resolved against the current MusicalScale.
- Rests: Underscore (_) for a rest, pipe (|) to rest until the next bar boundary.
- Parameter commands: T(bpm), N(length), A(amplitude), O(octave), S(scale), L(legato), V(depth[,rate]), TR(depth[,rate]).
- Parameter stack: NP (push), PP (pop), PS(name) (save), PR(name) (recall).
- Comments: // to end of line.
auto notes =
parser.parse(
"T(120) S(C Major) O(4) N(1/4) C D E F G");
Dynamic array container wrapping std::vector.
Definition list.h:40
Parses a domain-specific text notation into a sequence of MusicalNote objects.
Definition notesequenceparser.h:42
◆ errors()
Returns any errors encountered during the last parse.
- Returns
- List of error message strings.
◆ parse()
| MusicalNote::List NoteSequenceParser::parse |
( |
const String & |
input | ) |
|
Parses the input string and returns a list of notes.
- Parameters
-
| input | The notation string. |
- Returns
- The resulting note sequence.
The documentation for this class was generated from the following file: