so js free to use midi to funcbeat converter
put ur midi in the same folder as code name it song.mid and run the program then take the code from output.txt and paste it to the funcbeat, done!
if someone can do better, please do, ik its possible to do much better
(if someone wants details its just midi player with use of base64 encrypted midi song)
const fs = require('fs');
const midiBuffer = fs.readFileSync('song.mid');
const midiBytes = Array.from(midiBuffer);
var midiString = Buffer.from(midiBytes).toString('base64');
let code = `
var BASE64_CHARS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function base64ToBytes(str){var clean=(str||"").replace(/=+$/,""),out=[];for(var i=0;i<clean.length;i+=4){var n=(BASE64_CHARS.indexOf(clean.charAt(i))<<18)|(BASE64_CHARS.indexOf(clean.charAt(i+1))<<12)|(BASE64_CHARS.indexOf(clean.charAt(i+2)||'A')<<6)|(BASE64_CHARS.indexOf(clean.charAt(i+3)||'A'));out.push((n>>16)&0xFF);if(clean.charAt(i+2)&&clean.charAt(i+2)!=='=')out.push((n>>8)&0xFF);if(clean.charAt(i+3)&&clean.charAt(i+3)!=='=')out.push(n&0xFF);}return out;}
function readVarLen(bytes,i){var value=0,b;do{b=bytes[i++];value=(value<<7)|(b&0x7F);}while(b&0x80);return {value,nextIndex:i};}
function splitTracks(bytes){var i=0;if(String.fromCharCode(bytes[i],bytes[i+1],bytes[i+2],bytes[i+3])!=='MThd')throw new Error('Invalid MIDI header');var hl=(bytes[i+4]<<24)|(bytes[i+5]<<16)|(bytes[i+6]<<8)|bytes[i+7];var format=(bytes[i+8]<<8)|bytes[i+9],nTracks=(bytes[i+10]<<8)|bytes[i+11],tpq=(bytes[i+12]<<8)|bytes[i+13];i+=8+hl;var tracks=[];for(var t=0;t<nTracks;t++){if(String.fromCharCode(bytes[i],bytes[i+1],bytes[i+2],bytes[i+3])!=='MTrk')throw new Error('Invalid track header');var tl=(bytes[i+4]<<24)|(bytes[i+5]<<16)|(bytes[i+6]<<8)|bytes[i+7];tracks.push(bytes.slice(i+8,i+8+tl));i+=8+tl;}return{format,tpq,tracks};}
function parseTrackToEvents(bytes){var events=[],i=0,tick=0,lastStatus=null;while(i<bytes.length){var dt=readVarLen(bytes,i);tick+=dt.value;i=dt.nextIndex;if(i>=bytes.length)break;var statusByte=bytes[i],status;if(statusByte>=0x80){status=statusByte;lastStatus=status;i++;}else{if(!lastStatus)break;status=lastStatus;}var cmd=status&0xF0,channel=status&0x0F;if(status===0xFF){var mt=bytes[i++],lenInfo=readVarLen(bytes,i),len=lenInfo.value;i=lenInfo.nextIndex+len;if(mt===0x51&&len===3){var tempo=(bytes[i-3]<<16)|(bytes[i-2]<<8)|bytes[i-1];events.push({tick,type:"setTempo",tempo});}continue;}if(cmd===0xC0){var program=bytes[i++];events.push({tick,type:"programChange",channel,program});continue;}if(cmd===0x90||cmd===0x80){var d1=bytes[i++],d2=bytes[i++];if(cmd===0x90&&d2>0)events.push({tick,type:"noteOn",note:d1,velocity:d2,channel});else events.push({tick,type:"noteOff",note:d1,channel});continue;}if(cmd===0xA0||cmd===0xB0||cmd===0xE0){i+=2;continue;}if(cmd===0xD0){i+=1;continue;}i++;}return events;}
function ticksToSecondsAndNotes(bytes){var midi=splitTracks(bytes),tpq=midi.tpq,all=[];for(var t=0;t<midi.tracks.length;t++){var evs=parseTrackToEvents(midi.tracks[t]);for(var k=0;k<evs.length;k++)all.push(evs[k]);}all.sort((a,b)=>a.tick-b.tick);var tempo=500000;for(var i=0;i<all.length;i++){if(all[i].type==="setTempo"){tempo=all[i].tempo;break;}}var lastTick=0,lastSec=0;for(var i=0;i<all.length;i++){var ev=all[i];var dt=ev.tick-lastTick;var secDelta=(dt*tempo)/(tpq*1000000);lastSec+=secDelta;ev.time=lastSec;if(ev.type==="setTempo")tempo=ev.tempo;lastTick=ev.tick;}var notes=[],openNotes={},channelPrograms=new Array(16).fill(0);for(var j=0;j<all.length;j++){var e=all[j];if(e.type==="programChange")channelPrograms[e.channel]=e.program;if(e.type==="noteOn")openNotes[e.note+"_"+e.channel]={start:e.time,velocity:e.velocity,channel:e.channel,program:channelPrograms[e.channel]};if(e.type==="noteOff"){var key=e.note+"_"+e.channel;if(openNotes[key]){var s=openNotes[key].start,v=openNotes[key].velocity,dur=e.time-s;if(dur<0)dur=0;notes.push({note:e.note,velocity:v,time:s,duration:dur,channel:e.channel,program:openNotes[key].program});delete openNotes[key];}}}return{notes,tpq,channelPrograms};}
function createPlayerFromBase64(base64String){var bytes=base64ToBytes(base64String);var parsed=ticksToSecondsAndNotes(bytes);var notes=parsed.notes;return function(t){var out=[];for(var i=0;i<notes.length;i++){var e=notes[i];if(t>=e.time&&t<e.time+e.duration)out.push({note:e.note,frequency:440*Math.pow(2,(e.note-69)/12),velocity:e.velocity,time:e.time,duration:e.duration,channel:e.channel,program:e.program});}return out;};}
function envelope(t,n){let dt=t-n.time;if(dt<0||dt>n.duration)return 0;let a=0.005,d=0.12,s=0.7,r=0.25,st=Math.max(0,n.duration-a-d-r);if(dt<a)return dt/a;dt-=a;if(dt<d)return 1-(1-s)*(dt/d);dt-=d;if(dt<st)return s;dt-=st;if(dt<r)return s*(1-dt/r);return 0;}
function harmonicWave(type,f,t){switch(type){case"sine":return Math.sin(2*Math.PI*f*t)+0.5*Math.sin(2*Math.PI*2*f*t)+0.25*Math.sin(2*Math.PI*3*f*t);case"triangle":return 2/Math.PI*Math.asin(Math.sin(2*Math.PI*f*t));case"square":return Math.sign(Math.sin(2*Math.PI*f*t));case"sawtooth":return 2*(f*t-Math.floor(f*t+0.5));case"softSine":return Math.sin(2*Math.PI*f*t)*0.8+Math.sin(2*Math.PI*2*f*t)*0.2;case"brightSaw":return 2*(f*t-Math.floor(f*t));default:return Math.sin(2*Math.PI*f*t);}}
function instrumentWave(program){program=Math.max(0,Math.min(127,program));var waves=["sine","softSine","triangle","square","sawtooth","brightSaw","softSine","triangle","sine","square","sawtooth","triangle","softSine","brightSaw","sine","triangle"];return waves[program%waves.length];}
function synthNote(n,t){return harmonicWave(instrumentWave(n.program),440*Math.pow(2,(n.note-69)/12),t)*Math.pow(n.velocity/127,0.8)*envelope(t,n);}
function drumWave(n,t){let dt=t-n.time;if(dt<0||dt>n.duration)return 0;function clamp(x){return Math.max(-1,Math.min(1,x));}switch(n.note){case 35:case 36:return clamp(Math.sin(2*Math.PI*60*dt)*Math.exp(-dt*12)+(Math.random()*2-1)*Math.exp(-dt*150));case 38:case 40:return clamp((Math.random()*2-1)*Math.exp(-dt*60)+Math.sin(2*Math.PI*180*dt)*Math.exp(-dt*30)+Math.sin(2*Math.PI*330*dt)*Math.exp(-dt*25));case 41:case 43:case 45:case 47:case 49:case 51:case 53:case 55:case 57:case 59:return clamp((Math.random()*2-1)*Math.exp(-dt*200));case 42:case 44:case 46:case 48:case 50:case 52:case 54:case 56:case 58:case 60:return clamp((Math.random()*2-1)*Math.exp(-dt*150));default:return 0;}}
function makeSynth(base64Midi){var getActiveNotesAtTime=createPlayerFromBase64(base64Midi);var state={hpL:{x:0,y:0},hpR:{x:0,y:0}};return function(t,sr){var active=getActiveNotesAtTime(t);var L=0,R=0,wL=0,wR=0;for(var i=0;i<active.length;i++){var n=active[i];var sig=n.channel===9?drumWave(n,t):synthNote(n,t);var pan=0.5+0.5*Math.sin(n.note/50+t*0.05);L+=sig*(1-pan);R+=sig*pan;wL+=Math.pow(n.velocity/127,0.8)*(1-pan);wR+=Math.pow(n.velocity/127,0.8)*pan;}if(wL>0)L/=wL;if(wR>0)R/=wR;var dt=1/sr;var hpL=state.hpL.y+0.5*(L-state.hpL.y)*dt*44100;state.hpL.y=hpL;var hpR=state.hpR.y+0.5*(R-state.hpR.y)*dt*44100;state.hpR.y=hpR;return [hpL,hpR];};}
var synth = makeSynth(`+'`'+midiString+'`'+`);
return synth`
fs.writeFileSync('output.txt', code);