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

Feature request: Set the key #36

Closed
FragLegs opened this issue Sep 6, 2015 · 10 comments
Closed

Feature request: Set the key #36

FragLegs opened this issue Sep 6, 2015 · 10 comments
Labels

Comments

@FragLegs
Copy link
Contributor

FragLegs commented Sep 6, 2015

It would be nice to be able to set the key (either by name or as a series of flatted/sharped notes) as an attribute and global attribute. I don't know Clojure well enough to quickly set up a pull request for this, but if I find time I might try my hand at it. In the meantime, I put this out there for anyone else working on it.

@daveyarwood
Copy link
Member

This would be a step in the right direction toward eventually being able to export sheet music for an Alda score.

I think what we want is to define a new top-level thing called *key* that is initialized as an empty map {} when a score is initialized, and any time the key is set via an attribute/global attribute change, the current time marking and the key is recorded in *key*. What would be even more useful is if we could store the current measure number, but we'd have to implement measures first. (currently, Alda just ignores bar lines)

I don't think we'll be able to do much with the key-change data for the time being, but once things get moving with the sheet music export feature, we'll be able to use the key-change data to tell it what key signature to display.

@crisptrutski
Copy link
Member

Perhaps this would even change the default meaning of bare notes like c - with a "natural" modifier to escape the key like c.? This would dovetail into microtonal or custom tunings - perhaps "keys" could even introduce new note symbols within their scope - like aa or h or some suitable unicode 🎶

@FragLegs
Copy link
Contributor Author

FragLegs commented Sep 7, 2015

Yeah, that's more along the lines of what I was thinking. I just don't want
to have to type "b-" for every B flat in a song when the song is in the key
of B flat. Motivated by the same laziness that invented key signatures in
the first place. :)

On Monday, September 7, 2015, Chris Truter notifications@github.com wrote:

Perhaps this would even change the default meaning of bare notes like c -
with a "natural" modifier to escape the key like c.? This would dovetail
into microtonal or custom tunings - perhaps "keys" could even introduce new
note symbols within their scope - like aa or h or some suitable unicode [image:
🎶]


Reply to this email directly or view it on GitHub
#36 (comment).

@daveyarwood
Copy link
Member

Aha! I see what you're saying now. I think that's a great idea! Disregard my last comment -- on second thought, I think we should keep track of keys on a per-instrument basis, like everything else. Being able to have 2 instruments playing at the same time in 2 different keys is totally in line with Alda's way of doing things. For example, you can have different tempos for different instruments by doing something like this:

violin: (tempo 180) e f g e f g e f g e f g e f g
viola: (tempo 200) e f g e f g e f g e f g e f g

which creates a nice phase effect. To change the tempo for all instruments, you can do it globally with the tempo! global attribute.

We could do a similar thing with keys -- allowing you to change the key per-instrument with key or for every instrument with key!. An instrument's key can be C major by default, so if you don't provide an accidental for a note, it will be natural by default, which is the way it works currently.

I like the idea of using . to represent a natural note. . is already used for dotted note lengths (e.g. c4. is a dotted quarter note C), but it shouldn't conflict with the . representing a natural, when placed immediately after a note letter name. So, a C natural dotted quarter note could be represented as c.4. This might look slightly weird, but it is fairly uncommon to see natural accidentals, so I don't mind it. Another idea would be to use ,: c,4.

@crisptrutski
Copy link
Member

Whoops! Forgot the . is already used - and think that I'd get confused by the overloading (dotted notes with the implicit duration seem common). Perhaps @ or | or=? Struggling to find a character that feels.. natural (comma feels like whitespace or separator)

@FragLegs
Copy link
Contributor Author

FragLegs commented Sep 7, 2015

I'm in favor of = as it is right in between + and -

On Monday, September 7, 2015, Chris Truter notifications@github.com wrote:

Whoops! Forgot the . is already used - and think that I'd get confused by
the overloading (dotted notes with the implicit duration seem common).
Perhaps @ or | or=? Struggling to find a character that feels.. natural
(comma feels like whitespace or separator)


Reply to this email directly or view it on GitHub
#36 (comment).

@crisptrutski
Copy link
Member

Goldilocks :person_with_blond_hair:

@FragLegs
Copy link
Contributor Author

FragLegs commented Sep 7, 2015

Another thing that would have to be taken into consideration is what
happens when you write c+ in a key that has a c+? Does it become c++ or
does the local + override the key's +. In handwritten scores, the local
annotation overrides, which I think is what you'd want here. So the key
only applies to in annotated notes.

On Monday, September 7, 2015, Shayne Miel miel.shayne@gmail.com wrote:

I'm in favor of = as it is right in between + and -

On Monday, September 7, 2015, Chris Truter <notifications@github.com
javascript:_e(%7B%7D,'cvml','notifications@github.com');> wrote:

Whoops! Forgot the . is already used - and think that I'd get confused
by the overloading (dotted notes with the implicit duration seem common).
Perhaps @ or | or=? Struggling to find a character that feels.. natural
(comma feels like whitespace or separator)


Reply to this email directly or view it on GitHub
#36 (comment).

@FragLegs
Copy link
Contributor Author

FragLegs commented Sep 7, 2015

That's "unannotated" (stupid autocorrect)

On Monday, September 7, 2015, Shayne Miel miel.shayne@gmail.com wrote:

Another thing that would have to be taken into consideration is what
happens when you write c+ in a key that has a c+? Does it become c++ or
does the local + override the key's +. In handwritten scores, the local
annotation overrides, which I think is what you'd want here. So the key
only applies to in annotated notes.

On Monday, September 7, 2015, Shayne Miel <miel.shayne@gmail.com
javascript:_e(%7B%7D,'cvml','miel.shayne@gmail.com');> wrote:

I'm in favor of = as it is right in between + and -

On Monday, September 7, 2015, Chris Truter notifications@github.com
wrote:

Whoops! Forgot the . is already used - and think that I'd get confused
by the overloading (dotted notes with the implicit duration seem common).
Perhaps @ or | or=? Struggling to find a character that feels.. natural
(comma feels like whitespace or separator)


Reply to this email directly or view it on GitHub
#36 (comment).

@daveyarwood
Copy link
Member

I like =: it's like you're saying "this note, no more, no less"

EDIT: = will probably also be used for variable definition, but variable names will be required to be at least 2 characters long (so as to differentiate them from notes), so I don't think it will conflict.

I agree that the local accidental should override the key signature -- you see this sometimes in sheet music, where it serves the purpose of making it extra clear to the performer what the accidental of the note is, even if it's in the key signature.

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

No branches or pull requests

3 participants