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

Add signature method for a scale. Closes #89 #91

Closed
wants to merge 5 commits into from
Closed

Add signature method for a scale. Closes #89 #91

wants to merge 5 commits into from

Conversation

dy
Copy link

@dy dy commented Sep 20, 2015

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.

@saebekassebil
Copy link
Owner

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!

@dy
Copy link
Author

dy commented Sep 21, 2015

@saebekassebil so what thoughts on that?

@dy
Copy link
Author

dy commented Sep 21, 2015

@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.
Copy link
Owner

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.

@saebekassebil
Copy link
Owner

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?

@dy
Copy link
Author

dy commented Sep 24, 2015

Yes, that’s a good point.
Signatures returned should bring abstract meaning, but as far each specific note has that abstract info - that’s ok.
However, for sheet music it is probably more handy to return not arbitrary formed key sequence (as it is done now), but a sequence corresponding to a clef. E.g. for the G-clef it’d be handy to have teoria.note('A1').scale('major').signature('treble').toString(); //f#4,c#4,g#4.
Description of all the clefs can be found on the wikipedia.
So probably it might be a solution - to pass exact clef which it is needed to embody returned key sequence?

//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?

@saebekassebil
Copy link
Owner

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?

@dy
Copy link
Author

dy commented Sep 26, 2015

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.
I can implement either approach, whether it is a separate module or teoria-function, but this is architectural decision, and it is up to you)
Just please let me know)

@dy
Copy link
Author

dy commented Sep 26, 2015

By the way, considering the SMUFL, what else can be possibly here to complicate the teoria? I hardly can think up of something.

@saebekassebil
Copy link
Owner

tonal is definitely a step in the right direction! What I'd like to see is that teoria could continue to be a "god-object" or a "programming platform for music theory". But it should consist of many smaller modules, like tonal, pitch, etc. The difference is, that I've been representing notes in a numeric format, while tonal prefers it to be in string format.

I'm not sure how you think SMUFL fits in?

@saebekassebil
Copy link
Owner

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?

@dy
Copy link
Author

dy commented Sep 10, 2016

Hi @saebekassebil!
We have chosen the similar approach in audiojs/audio — it is going to be a class consisting of small components, but still monolithic thing, because for high-level apps that makes more sense.
I am a bit out of this issue though.

@dy
Copy link
Author

dy commented Jun 21, 2017

@saebekassebil is there any chance to have this PR merged? If not I suggest closing it then.

@saebekassebil
Copy link
Owner

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.

@dy
Copy link
Author

dy commented Jul 2, 2017

@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.

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 this pull request may close these issues.

Key signatures
2 participants