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

Note accidental gets 'undefined' sometimes (accidentalValue() > 2) #107

Open
eagor opened this issue Apr 20, 2016 · 2 comments
Open

Note accidental gets 'undefined' sometimes (accidentalValue() > 2) #107

eagor opened this issue Apr 20, 2016 · 2 comments

Comments

@eagor
Copy link

eagor commented Apr 20, 2016

var scale = teoria.scale("cx", 'wholetone');
scale.simple();
> ["cx", "dx", "ex", "fundefined", "gundefined", "aundefined"]

I suspect this is a result of Note#accidental()

scale.notes()[3].accidentalValue()
> 3
scale.notes()[3].accidental()
> undefined

But the accidentalValue should not be greater than 2. If it is, then it should be another note name. Thus I think the root of the issue is in the way the intervals are calculated, particularly, how it finds the note that is some interval away from another note (from scale tonic in our case).

@eagor eagor changed the title Note accidental might be 'undefined' sometimes Note accidental gets 'undefined' sometimes (accidentalValue() > 3) Apr 20, 2016
@eagor eagor changed the title Note accidental gets 'undefined' sometimes (accidentalValue() > 3) Note accidental gets 'undefined' sometimes (accidentalValue() > 2) Apr 20, 2016
@eagor
Copy link
Author

eagor commented Apr 21, 2016

so this is it:

teoria.note("cx").interval("A4").toString()
>"fundefined3"

but seems to be like note name has to be F (as 4th note after C)
what does music theory has to answer to this:
C## + A4 = ?

@saebekassebil
Copy link
Owner

Yes. that's the problem. I don't think there's an answer for that - since we generally speaking never deal in "triple accidentals" like that.

I think throwing an error would be best - since you're trying to do something "impossible"

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