export type Options = { major: boolean, minor: boolean } export function generate({ major, minor }: Options): string { let choices: string[] = [] if (major) choices = choices.concat(all) if (minor) choices = choices.concat(all.map(chord => `${chord}m`)) return choices[Math.floor(Math.random() * choices.length)] } const all: string[] = [ 'C', 'D♭', 'D', 'E♭', 'E', 'F', 'G♭', 'G', 'A♭', 'A', 'B♭', 'B' ]