Closed gsouf closed 9 years ago
Hi Soufiane!
There ought to be! I remember the chord parser being able to do exactly that - let me just check up on it.
Thanks for your interest btw!
I just tried the chord parser, it worked and chord.notes() return the good bass, but actually there is no simple way to distinctly get the root and the tone.
Theoria thinks that the tone and the root are the same thing but in theory that goes wrong for inverted chord (i finaly got the english word for it!).
Maybe can we add it to the library :
A first way that mays break a few compatibility but that i think better with music words :
Chord.root
would return either the tone for a normal chord or the bass in an inverted chord.
Am
chord it would be the note A
Am/B
chord it would be the note B
Chord.tone
property that would be the tonic of the chord (why not a shortcut to get("first")
)
Am
and Am/B
chord it would be A
An other way that would keep 100% compatibility and would be easyer to implement :
Chord.bass
property, that woul defaulty be the same as tone, expect for inverted chords.
Am
chord it would be the note A
Am/B
chord it would be the note B
Tell me your feeling about it. I would be happy to contribute.
Actually it should be possible to just do:
var chord = teoria.chord('Am/B'); // Create a Am(add9) with voicing b, a, c, e
var bass = chord.notes()[0]; // The *bass* of this chord is b
var root = chord.root; // The *root* of this chord is a
It seems that we've a bit of confused terminology. What you refer to as the "tone" is the root/tonic (which apparently is only called a tonic in scale terminology and a root in chords). And what you refer to as root is actually the base of the chord - which you can already get by just taking the lowest note in the chord voicing as shown above.
What do you think about this? Is it too elaborate?
Sure there is a terminology to have.
I checked, double checked, and triple checked, and even more. Actually I couldnt figure out the good definition of the root of a chord. For some people it's the note with the lowest pitch (the base), for some other it's the tonic. I have a book that I i highly entrust. I will check asap what the book says about that.
I use to know the root as the lowest note in the chord when teoria knows it has the tonic. That's where the confusion comes from.
Btw, that's just a terminology problem, the most important is that things to get clear.
About the solution var bass = chord.notes()[0];
. The problem is not that it is hard to play with. But i think it would be more semantic and easyest to understand for new commers and code readers to have a shortcut .getBase()
(or just .base()
to respect the library convention).
Not sure if it's valid (although I've always said it that way): http://en.wikipedia.org/wiki/Root_(chord)
You're probably right about the .base()
method - Let's add it. Would you like to do it?
Fixed per d9a04c94fa39c599b817ec28eb064fbe6545ebe2
Hi,
Not sure about the correct english name of what i want to explain, an exemple worth 10000 words.
I dont find the way to build such a chord :
A/B
: A chord withA
as the tonic andB
as the bass.Is there a way to do so in the current version ?