Open martijnmichel opened 4 years ago
An implementation of this would be great! 👍
Do you have any ideas about how to implement it? Perhaps we can discuss them in this issue :-)
ill make a fork of tonal and see how the internals work, maybe itll give me an idea..
If im gonna be helping you with this it seems ill need to start learning typescript first...
Okey, no worries. We can discuss what you need first...
Im not sure I understand the setup of tonal yet also... for example, how would I test new functionality? import it into another project with HMR ? I'd be happy to help though, just gonna need a bit of a learning curve first.
Well i'm deep into typescript atm ;) Can you explain to me how i can setup a test env for a new module?
I've updated CONTRIBUTING.md
Hope it helps
it did but it doesnt describe how to setup a test environment, does it? I cant believe id have to run yarn test:ci everything i change something in my code and wait over a minute for the tests to complete?
You can run npx jest module-name
in root folder to run the test of one module. For example npx jest chord-detect
okay, thatll work.. though it still seems a bit slow to hit the terminal everytime i change a bit of code. But, we can talk about the actual implementation ;)
Ive been trying to come up with a solution.. we need a way to:
export function sub(chordName: string): string[] | undefined {
const [tonic, type] = tokenize(chordName);
if (tonic) {
let c = Chord.get(`${tonic}${type}`);
let scales = Chord.chordScales(`${tonic}${type}`);
return detect(c.notes);
}
}
There are so many scales listed, many of which are very unknown to me that I find it hard to do the above. Do you have any ideas?
Can you explain me how the algorithm works? For example, to go from "Cmaj7" to "Em" you need to remove the tonic. For example:
It seems tonaljs is missing a feature to output chord subs (or i just missed it being there ;))
For instance: Cmaj7 can be subbed with Em or Cmaj79 with Em9 G7(9) -> Bm7b5 G7(9) -> Dm6 etc..
Actually I would be fine with helping out on inserting it in tonal if it is missing and if needed... ive finished conservatory jazz guitar so have all the knowledge to make it work.