Transform a midi note's index into a frequency.
Generate a sine wave with pure JS.
Adjust a freq to the closest midi note.