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

Getting a diatonic chord sequence starting from a given note #161

Open
ghost opened this issue Apr 21, 2020 · 1 comment
Open

Getting a diatonic chord sequence starting from a given note #161

ghost opened this issue Apr 21, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 21, 2020

Is there any easy way to get chord tones for a diatonic chord sequence from a given note? Meaning that for C major starting on C4, I would want:

[[C4, E4, G4], ...[G4, B4, D5], ...]

Currently I have something like this:

const CHORDS = Key.majorKey('C')
  .chords.map((chord: string) => Chord.get(chord).notes.slice(0, 3))
  .map((chordNotes: string[]) => chordNotes.map(note => `${note}4`));

but that just gives all the notes in the range of C4 - B4. Great library by the way!

@danigb
Copy link
Collaborator

danigb commented Apr 27, 2020

It's true, not obvious 🤔 You can pass a number to the majorKey function:

Key.majorKey('g4').chords.map(chord => Chord.get(chord).notes.slice(0,3))
[
  [ 'G4', 'B4', 'D5' ],
  [ 'A4', 'C5', 'E5' ],
  [ 'B4', 'D5', 'F#5' ],
  [ 'C5', 'E5', 'G5' ],
  [ 'D57', 'F#57', 'A57' ],
  [ 'E5', 'G5', 'B5' ],
  [ 'F#5', 'A5', 'C6' ]
]

But there's a problem with the dominant. Keep this issue open until I solve it

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

1 participant