saebekassebil / teoria

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

Create a chord with root different from the tone #59

Closed gsouf closed 9 years ago

gsouf commented 9 years ago

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 with A as the tonic and B as the bass.

Is there a way to do so in the current version ?

saebekassebil commented 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!

gsouf commented 9 years ago

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 :

An other way that would keep 100% compatibility and would be easyer to implement :

Tell me your feeling about it. I would be happy to contribute.

saebekassebil commented 9 years ago

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?

gsouf commented 9 years ago

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

saebekassebil commented 9 years ago

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?

saebekassebil commented 9 years ago

Fixed per d9a04c94fa39c599b817ec28eb064fbe6545ebe2