diff --git a/js/playnote.js b/js/playnote.js new file mode 100644 index 0000000..05ec9b2 --- /dev/null +++ b/js/playnote.js @@ -0,0 +1,19 @@ +function noteABCDToToneJS(note) { + const pitch = lyToPitch(note); + const noteName = pitch.toStringTone(); + return noteName; +} + +class PlayNote { + static play(notes) { + console.log(notes) + const notesToneJS = notes.map(noteABCDToToneJS); + console.log(notesToneJS) + var polySynth = new Tone.PolySynth(Tone.AMSynth).toMaster(); + polySynth.triggerAttackRelease(notesToneJS, '8n'); + + } +} + + +