Online Sequencer Make music online
  • Sequences
  • Members
  • Chat
  • Forum
  • Wiki

Existing user? Sign In Create account
Login at Online Sequencer Forums

Online Sequencer Forums › Online Sequencer › Online Sequencer Discussion
« Previous 1 … 5 6 7 8 9 … 79 Next »

MP3 to midi sound

Thread tools
MP3 to midi sound
Marysamat Offline
⭐⭐⭐⭐⭐⭐
268 Posts:
 
#2
10-02-2021, 02:48 PM
Copy this code into consol:

For going into consol, ctrl + f12

For getting f12, press fn button

In consol, delete code there by pressing ctrl + l

Then, paste code given to you with ctrl + v or right click and paste

To copy code, ctrl + c or right click and copy

For code, copy everything below this sentence:

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();
context.decodeAudioData(e.target.result, function(buffer){
var node = context.createAnalyser();
var resolution = 4;
node.fftSize = 4096;
node.smoothingTimeConstant = 0;
var bufferLength = node.frequencyBinCount;
var dataArray = new Uint8Array(bufferLength);
var audioSource = context.createBufferSource();
audioSource.buffer = buffer;
audioSource.loop = false;
audioSource.connect(node);
var time = 0;
audioSource.start(0);
setInterval(function(){
node.getByteFrequencyData(dataArray);
var f = [];
for (var i = 1; i < dataArray.length - 1; i++) {
var isPeak = dataArray[i] >= dataArray[i-1] && dataArray[i] >= dataArray[i+1];
if (isPeak) {
f.push([i, dataArray[i]]);
}
}
f.sort(function(a, b){return b[1] - a[1]});
for(var i = 0; i < Math.min(f.length, 4); i++) {
var frequency = f[i][0] * context.sampleRate / node.fftSize;
var note = piano[Math.round((piano.length*Math.log(2)+12*Math.log(55/frequency)+Math.log(4))/(Math.log(2)))];
if (note != undefined && f[i][1] > 32) {
song.addNote(new Note(song, note, time/resolution, 1/resolution, 13));
}
}
time++;
}, song.sleepTime/resolution);
setInterval(SequencerView.repaint, 1000);
});
}

reader.readAsArrayBuffer(e.target.files[0]);
});

el.click();


The greatest legacy on earth
  • x1
    • x1
    • value1
Reply

Messages In This Thread
MP3 to midi sound - by Mario5-300-000 - 10-02-2021, 02:43 PM
RE: MP3 to midi sound - by Marysamat - 10-02-2021, 02:48 PM
RE: MP3 to midi sound - by TFAVC1381 - 09-19-2024, 04:16 PM
RE: MP3 to midi sound - by Firebolt391d - 10-02-2021, 02:48 PM
RE: MP3 to midi sound - by sweetillusion - 02-07-2022, 09:16 AM
RE: MP3 to midi sound - by tbyunomi - 02-07-2022, 09:17 AM
RE: MP3 to midi sound - by sweetillusion - 02-07-2022, 09:18 AM
RE: MP3 to midi sound - by Lopyt - 02-07-2022, 09:24 AM
RE: MP3 to midi sound - by Instantly Meatified - 02-07-2022, 09:20 AM
RE: MP3 to midi sound - by tbyunomi - 02-07-2022, 09:22 AM
RE: MP3 to midi sound - by Lallilap - 03-23-2022, 02:44 AM
RE: MP3 to midi sound - by RolinGP3 - 06-16-2024, 07:59 AM



Users browsing this thread:   1 Guest(s)


  •  Return to Top
  •  Contact Us
  •   Home
  •  Lite mode
© Rush Crafted with ❤ by iAndrew
Powered By MyBB, © 2002-2025 MyBB Group.
Linear Mode
Threaded Mode
View a Printable Version
Subscribe to this thread
Add Poll to this thread
Send thread to a friend