highest/lowest can be #/b

master
Matthew Huntington 1 year ago
parent ad36d46486
commit b2a458e0dc

@ -40,10 +40,10 @@ generateToneButton.addEventListener('click', () => {
generateNoteButton.addEventListener('click', () => {
Tone.start()
const lowOctave = parseInt(lowest.charAt(1)) * 12
const lowNote = notes.findIndex(enharmonics => enharmonics.includes(lowest.charAt(0)))
const highOctave = parseInt(highest.charAt(1)) * 12
const highNote = notes.findIndex(enharmonics => enharmonics.includes(highest.charAt(0)))
const lowOctave = parseInt(lowest.charAt(lowest.length - 1)) * 12
const lowNote = notes.findIndex(enharmonics => enharmonics.includes(lowest.substring(0, lowest.length-1)))
const highOctave = parseInt(highest.charAt(highest.length - 1)) * 12
const highNote = notes.findIndex(enharmonics => enharmonics.includes(highest.substring(0, highest.length-1)))
const lowPitch = lowOctave + lowNote
const highPitch = highOctave + highNote
@ -55,8 +55,8 @@ generateNoteButton.addEventListener('click', () => {
const randomPitchNote = randomPitch % 12
newTone = notes[randomPitchNote][0] + randomPitchOctave
newTone = teoria.note(newTone).fq()
toneDisplay.innerHTML = newTone
newTone = teoria.note(newTone).fq()
})
playButton.addEventListener('click', ()=>{

Loading…
Cancel
Save