A lot of functions in this code have a very unique purpose, and could be written in a separate utils.js file. They could even be tested individually by unit tests. Bigger functions could be split in smaller functional modules.
For instance, a function that takes as an input a chord, and a list of chord tones and extensions (e.g: 3rd, 7th and 9th), and return what these chord tones and extensions are, for this particular chord.
Example: With a C7b9 chord, the function would return ['E', 'Bb', 'Db']
A lot of functions in this code have a very unique purpose, and could be written in a separate
utils.js
file. They could even be tested individually by unit tests. Bigger functions could be split in smaller functional modules.For instance, a function that takes as an input a chord, and a list of chord tones and extensions (e.g: 3rd, 7th and 9th), and return what these chord tones and extensions are, for this particular chord. Example: With a C7b9 chord, the function would return ['E', 'Bb', 'Db']