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

Key signatures #89

Open
dy opened this issue Sep 6, 2015 · 3 comments
Open

Key signatures #89

dy opened this issue Sep 6, 2015 · 3 comments

Comments

@dy
Copy link

dy commented Sep 6, 2015

Sorry for asking maybe an obvious question, but I can’t think up, what is the best way to get key signature notes for a scale?
I could imagine some method like scale.signature(), which returns key signature notes in proper order, but seems it is already possible to do via other means, but it’s not quite clear how.
Any ideas?
I can go the default way like building it from scratch, as it described here though.
Thank you.

Trying to use teoria in piano-game to engage scales, accents, chords etc.

@dy
Copy link
Author

dy commented Sep 7, 2015

@saebekassebil if you want I can implement this method in a separate PR?

@saebekassebil
Copy link
Owner

Hey Deema!

Well, that's a good question. My first thought is something like summing up the accidentals, and then mapping to a signature? It's a bit fragile, but should work with all the diatonic scales:

var scale = teoria.note('D').scale('major');
var notes = scale.notes();

var signatureSum = notes.reduce(function(sum, note) {
  return sum + note.accidentalValue();
}, 0);

Let me just think about this for a little while - it's a bit early in the morning here :) Looking forward to try out your piano game!

@dy
Copy link
Author

dy commented Sep 10, 2015

Interesting approach, but I can’t think up the continuation. First I thought to simply show the notes with accidentals while traversing degrees in a scale, but the order of notes in signature is important (famous "Father Christmas Gave Dad An Electric Blanket"). That is why I thought it may be possible to calculate signatures via circle of fifts and note coordinates in a scale. But I didn’t manage to understand the meaning of note coordinates

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

Successfully merging a pull request may close this issue.

2 participants