var resolution = 4; // how many times to subdivide each 1/4 note, 4 means 1/16 notes var fftSize = 8192; // must be power of 2 var maxNotes = 1000; // maximum number of notes to add for each interval var minIntensity = 128; // minimum volume for note to be added (0-255) loadInstrument(13); var el = $('<input type="file" accept="audio/*">'); $(document.body).append(el); el.on('change', function(e){ var reader = new FileReader(); reader.onload = function (e) { var context = new AudioContext();