Music icon indicating copy to clipboard operation
Music copied to clipboard

Redesign Articulation in final tagless style

Open bwetherfield opened this issue 7 years ago • 0 comments

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 {
    ...
}

bwetherfield avatar Oct 09 '18 20:10 bwetherfield