saebekassebil / teoria

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

teoria.note.chord('maj') Produces Major Seventh Instead of Major Triad #86

Open mjhasbach opened 8 years ago

mjhasbach commented 8 years ago

Why does teoria.note.chord('maj') produce a major seventh chord, while teoria.note.chord(), teoria.note.chord('M'), and teoria.note.chord('major') produce a major triad?

var notes = [];

teoria.note('C4').chord('maj').notes().forEach(function(note){
    notes.push(note.scientific());
});

console.log(notes.join(',')); // C4,E4,G4,B4

By contrast, teoria.note.chord('min') produces a minor triad as expected:

var notes = [];

teoria.note('C4').chord('min').notes().forEach(function(note){
    notes.push(note.scientific());
});

console.log(notes.join(',')); // C4,Eb4,G4
saebekassebil commented 8 years ago

Yes, I know the chord terminology is foggy, but this is my understanding:

C, CM and CMajor means a major triad consisting of C, E, G CMaj means a major seventh chord consisting of C, E, G and B

If you could point to some (somewhat official) reference that means otherwise - I'd be glad to fix it.

mjhasbach commented 8 years ago

Wikipedia (peer-reviewed) Alcorn State University ("somewhat official")

Disclaimer: I am pretty new to music theory and did not verify the Wikipedia sources. Alcorn lists no sources.

saebekassebil commented 8 years ago

Actually thinking about it, it should be possible for the user to implement their own parser. In Denmark we use Cmaj as shorthand for Cmaj7, and I know that most jazz music is like that as well.

But my guess is that there are other, stricter rules that applies to classical music (although chord symbol don't often appear in classical sheet music), and maybe different countries has different rules.

I think for now I'd like to keep "Cmaj" = "Cmaj7", but let's think about a way where the user can configure the meaning of different chord symbols!