-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add signature method for a scale. Closes #89 #91
Conversation
Hey Deema - this looks like a really good addition to the library! Let me just look it through and ponder it a bit, and I'll get it merged! Cheers! |
@saebekassebil so what thoughts on that? |
@saebekassebil I don’t want to bother you, but do you have any considerations? |
@@ -181,6 +181,8 @@ The chroma number is ranging from pitch class C which is 0 to 11 which is B | |||
#### Note#interval(interval) | |||
- A sugar function for calling teoria.interval(note, interval); | |||
|
|||
Returns a new note based on the passed interval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment isn't related the the PR. Please remove it.
There might be a problem with this approach. I guess you'd maybe want to use this for drawing the signature for sheet music. If that's what you wanted, then you'd want an abstract "f#" and not maybe "f#3" or "f#8". This method will return different results for: teoria.note('A8').scale('major').signature() != teoria.note('A3').scale('major').signature() What are your thoughts on that? |
Yes, that’s a good point. //default clef is 'G', or 'treble'
teoria.note('A1').scale('major').signature().toString(); //f#4,c#4,g#4
//other clef can be passed as a param, e.g. 'bass', or 'F'
teoria.note('A1').scale('major').signature('F').toString(); //f#3,c#3,g#3 What do you think? |
When we begin to discuss "clefs" and such I think we're slowly progressing into sheet notation area, and I don't think this library should be coupled to sheet notation specifically - that's for another module. I think maybe what we want is a method that returns the "position" of the signature/scale in the circle of fifths. E.g.: teoria.note('A').scale('major').signature() === 3
teoria.note('C').scale('major').signature() === 0
teoria.note('D').scale('minor').signature() === -2
// etc and then we'd want another module that would transform this position into the notes in a given clef position: var getNotes = require('signature-for-clef');
var getTrebleNotes = getNotes('treble');
var signature = teoria.note('A').scale('major').signature(); // -> 3
getTrebleNotes(signature); // -> ["f#4", "c#4", "g#4"]
getNotes('bass')(signature) // -> ["f#3", "c#3", "g#3"] What are your thoughts on this? |
I see, you want to implement the principle of atomizing and functional separation in here. That makes perfect sense, but I felt teoria is rather a somewhat god-object, alike to jquery, including everything possible here at place to work with the music theory. (and it is hardly to find anything bad in that, as the final bundle size is bearable and relatively small). But in case of separation on plugins it ceases to be like that and becomes similar to tonal, which was initially inspired by teoria but has basically plugins-composable architecture. |
By the way, considering the SMUFL, what else can be possibly here to complicate the teoria? I hardly can think up of something. |
tonal is definitely a step in the right direction! What I'd like to see is that I'm not sure how you think SMUFL fits in? |
Hi Dima, I just wanted to know if you're still interested in implementing this feature - have you come up with any good implementation ideas this year? ;) I think we should go with the modular approach. But maybe including the module in teoria, as to remain "god" status? |
Hi @saebekassebil! |
@saebekassebil is there any chance to have this PR merged? If not I suggest closing it then. |
Hey @dfcreative Thank you for the time invested in this pull - sorry for not being able to return back sooner. I've closed the pull request since we never came to any conclusion about where to draw the line between sheet music and music theory - and also since you've implemented them in your own module, this seems redundant. |
@saebekassebil yes, thanks for making decision. It is fine - just wanted to close old unfinished things. I will get back to it if I need it one more time. |
Hi, @matthewconstantine!
I’ve implemented, as it seems to me so far, the most logical method of getting key signatures for any scale with any tonic, based on note coordinates. It is quite late here and there might be some mistake, but tests of basic major/minor scales are passed. So please take a look, it should be nice ).
It closes #89.