Hello @wws
Some ideas to get started:
In music, we can think of âpointsâ as specific events, like a note at a particular time, and âvectorsâ as transformations or movements between those points, such as intervals or rhythmic shifts. For example, a point in pitch is a specific note, while a vector represents the interval between two notes.
Similarly, a point marks a particular moment, and a vector represents a duration or rhythmic displacement. This approach abstracts musical transformations, like transposition, making it easier to define, analyze, and compose by applying the same changes across different elements. Transformations like inversion or augmentation act as vectors that shape the structure and relationships between voices.
To work nicely in tonal contexts (if thatâs your thing), you need a framework that accounts for diatonic and chromatic intervals. Music21 and music-suite do this; you can use a simplified version of this idea. I posted minimal code examples in this forum a while ago, enabling accurate interpretation of intervals, key signatures, and accidentals depending on your composition/analysis goals. (Although I donât work with tonal materials, this aspect works well when dealing with intervals and accidentals in general, which can also be helpful).
This fits a hierarchical structure to represent elements like themes, voices, and transformations, making it cool for certain types of music. A type system (e.g., Music, Score, Voice, Note, Rest, etc.) can capture musical and temporal details. At the same time, functions for transformations (such as transposition, inversion, and augmentation) allow for modifying motives and other elements. There are several examples around.
While hierarchical structures work well for representing themes, voices, and transformations, another interesting approach is using prefix trees.
Prefix trees (which is also âhierarchicalâ but different )allow for musically meaningful operations like combining and transforming patterns across different âslicesâ of a score. Unlike hierarchical systems, prefix trees efficiently encode repeated patterns by sharing common prefixes, reducing redundancy. They are beneficial for representing recurring musical motives or transformations across multiple dimensions (e.g., vertically in harmony, horizontally in time, and other âslicesâ). By traversing the tree structure, you can quickly identify variations or transformations within a score and manipulate these across distinct, contextually musically meaningful slices.
PS. There is no problem writing some scripts in python or another language, converting data from sc (for example, Dictionaries) into JSON, and vice-versa back to SC. You donât need to recreate an extensive system in sc if you donât have a good reason.