Music
Music copied to clipboard
Redesign Articulation in final tagless style
Some ideas for replacing the enum based articulation with a final tagless approach. This will enable more user customization downstream.
// Articulation that can be represented by a single symbol above or below a notehead
protocol SymbolizableArticulation {
static func staccato() -> Self
static func staccatissimo() -> Self
static func marcato() -> Self
...
static func stack([Self]) -> Self
}
typealias DrawnMarking = SomeView // for example - something drawn
typealias MarkingDescribed = String // string representation like "staccato"
extension DrawnMarking: SymbolizableArticulation {
...
}
extension MarkingDesribed: SymbolisableArticulation {
...
}