Chord detection in JavaScript based on String Array of notes

1.7k Views Asked by At

I want to detect chords based on input String with notes (e.g. 'C', 'F', 'G') and get the resulting output chord (in this case, 'Csus4'). I've done some research and it seems that all of the solutions out there are for working on audio stream input. Is there some JavaScript library that does this based on String input rather than an audio stream?

1

There are 1 best solutions below

2
DaraJ On BEST ANSWER

I found the danigb/tonal library and the Detect module does exactly what I need:

import { chord } from 'tonal-detect'
chord(['C', 'F', 'G']) // => ['Csus4']