This commit is contained in:
Bubobubobubobubo
2023-12-02 09:51:32 +00:00
parent 35d9950439
commit 89382263f6
8 changed files with 23 additions and 24 deletions

View File

@ -1 +0,0 @@
var u=Object.defineProperty;var p=(s,e,i)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[e]=i;var a=(s,e,i)=>(p(s,typeof e!="symbol"?e+"":e,i),i);(function(){"use strict";class s extends AudioWorkletProcessor{constructor(t){super(t);a(this,"handleMessage",t=>{t.data&&t.data.type==="ping"?this.port.postMessage(t.data):t.data.type==="start"?this.started=!0:t.data.type==="pause"?this.started=!1:t.data.type==="stop"?this.started=!1:t.data.type==="bpm"?(this.bpm=t.data.value,this.currentPulsePosition=currentTime):t.data.type==="ppqn"?(this.ppqn=t.data.value,this.currentPulsePosition=currentTime):t.data.type==="nudge"&&(this.nudge=t.data.value)});this.port.addEventListener("message",this.handleMessage),this.port.start(),this.nudge=0,this.started=!1,this.bpm=120,this.ppqn=48,this.currentPulsePosition=0}process(t,o,d){if(this.started){const n=(currentTime+this.nudge/100)/(60/this.bpm),r=Math.ceil(n*this.ppqn);r>this.currentPulsePosition&&(this.currentPulsePosition=r,this.port.postMessage({type:"bang",bpm:this.bpm}))}return!0}}registerProcessor("transport",s)})();

File diff suppressed because one or more lines are too long

BIN
assets/index-1d3c40e7.js.gz Normal file

Binary file not shown.

Binary file not shown.