Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SpellPitch] Add Unspelled and Spelled protocols #168

Open
jsbean opened this issue Nov 5, 2018 · 1 comment
Open

[SpellPitch] Add Unspelled and Spelled protocols #168

jsbean opened this issue Nov 5, 2018 · 1 comment

Comments

@jsbean
Copy link
Member

jsbean commented Nov 5, 2018

cc @bwetherfield.

Issue

We currently have a matrix of types which describe Pitch and Pitch.Class values and how they map into the Spelled universe.

Unspelled Spelled
Pitch.Class Pitch.Spelling
Pitch SpelledPitch

For the purposes of PitchSpeller, it would be compelling to define Unspelled and Spelled protocols. This would generalize PitchSpeller from being concrete over (Pitch) -> SpelledPitch or (Pitch.Class) -> Pitch.Spelling to being generic over (Unspelled) -> Spelled.

Design proposal

Conform Pitch and Pitch.Class to the Unspelled protocol, and SpelledPitch and Pitch.Spelling to the Spelled protocol. We may need to add a unifying super protocol, from which each of the new protocols inherit.

I assume we will need to add some operation to these the super protocol that can map from the Unspelled to Spelled state given some context.

@bwetherfield
Copy link
Member

This is great. Makes it much clearer to me how it might be possible to genericize PitchSpeller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants