Created
June 7, 2020 06:27
-
-
Save francoisgeorgy/67e0415b087640f662213db83e40f834 to your computer and use it in GitHub Desktop.
tonal cookbook #tonal #music #javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/tonaljs/tonal/issues/108 | |
| // To obtain the scale properties, use the scale function: | |
| import { scale } from "@tonaljs/scale" | |
| scale("G aeolian").notes // => ["G", "A", "Bb", ... ] | |
| // To obtain the chords, use the scaleChords function from the same package: | |
| import { scaleChords } from "@tonaljs/scale" | |
| scaleChords("aeolian") | |
| // Getting a diatonic chord sequence starting from a given note | |
| // https://github.com/tonaljs/tonal/issues/161 | |
| 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' ] | |
| ] | |
| /* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment