saebekassebil / teoria

Javascript taught Music Theory
http://saebekassebil.github.io/teoria
MIT License
1.32k stars 115 forks source link

Fix #59 : add chord.bass and chord.inverted() #61

Closed gsouf closed 9 years ago

gsouf commented 9 years ago

Fix #59 I added a few testes, but i didnt run the tests. I didnt know how to run them (i'm not a javascript hacker!)

saebekassebil commented 9 years ago

Thank you very much for doing this @SneakyBobito!

I think that the chord.bass property needs to be converted into a method chord.base() because the voicing of a chord can be altered! E.g:

var am = teoria.chord('Am');
am.base().name() == 'a';
am.voicing(['P5', 'P1', 'm3']);
am.base().name() == 'e';

I like the .inverted()! Could you add some tests?

You can run the test be running npm test in the project root.

gsouf commented 9 years ago

I will, adapt the PR asap. Stay tunned

gsouf commented 9 years ago

Is there a way to check if two teoria.note are the same note no matter about the pitch ?

saebekassebil commented 9 years ago

What do you mean "no matter the pitch?".

gsouf commented 9 years ago

I'm looking if two notes are the sames.

For instance a A low and a A high are both a A.

saebekassebil commented 9 years ago

note.toString(true) gives you the note name without the octave number

saebekassebil commented 9 years ago

Hi @gsouf - I went ahead and implemented the Chord#bass() function, which basically just returns the note voiced the lowest. Hope you'll find it useful!

gsouf commented 9 years ago

Hey @saebekassebil Sorry, my project with teoria has not been updated for weeks, I forgot this issue !

Thank you