mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-24 05:57:17 -04:00
Updates
This commit is contained in:
@@ -0,0 +1 @@
|
||||
import{W as a,F as b}from"./index.91bb3680.js";export{a as WebMidi,b as enableWebMidi};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
var d=Object.defineProperty;var g=(s,t,e)=>t in s?d(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var i=(s,t,e)=>(g(s,typeof t!="symbol"?t+"":t,e),e);import{G as y,I,K as S,O as T,J as B,L as W,N as j,M as q}from"./index.91bb3680.js";const k=s=>"("+s+")();",w=s=>URL.createObjectURL(new Blob([k(s)],{type:"text/javascript"})),m=s=>new Worker(w(s));class x{constructor(t,e=this.interval){i(this,"worker");i(this,"interval",.1);i(this,"tick",0);this.interval=e,this.worker=m(()=>{let r,o=null;const h=()=>{o&&(clearInterval(o),o=null)},c=()=>{if(h(),!r)throw new Error("no interval set! call worker.postMessage({interval}) before starting.");postMessage("tick"),o=setInterval(()=>postMessage("tick"),r*1e3)};self.onmessage=function(n){n.data=="start"?c():n.data.interval?(r=n.data.interval,o&&c()):n.data=="stop"&&h()}}),this.worker.postMessage({interval:e}),this.worker.onmessage=r=>{r.data==="tick"&&t(this.tick++,this.interval)}}start(){this.worker.postMessage("start")}stop(){this.worker.postMessage("stop"),this.tick=0}setInterval(t){this.worker.postMessage({interval:t})}}class v{constructor({audioContext:t,interval:e=.1,onEvent:r,latency:o=.1}){i(this,"worker");i(this,"pattern");i(this,"phase");i(this,"audioContext");i(this,"cps",1);this.audioContext=t,this.worker=new x((h,c)=>{const n=this.phase,l=this.phase+c*this.cps;this.phase=l,this.pattern.queryArc(n,l).forEach(a=>{var p,u;if(typeof((p=a.value)==null?void 0:p.cps)=="number"&&this.setCps((u=a.value)==null?void 0:u.cps),!!a.part.begin.equals(a.whole.begin)){if(a.context.onTrigger){const f=(a.whole.begin-n)/this.cps+this.audioContext.currentTime+o;a.context.onTrigger(f,a,this.audioContext.currentTime,this.cps)}r&&(r==null||r(a))}})},e)}start(){if(!this.pattern)throw new Error("Scheduler: no pattern set! call .setPattern first.");this.audioContext.resume(),this.phase=0,this.worker.start()}stop(){this.worker.stop()}setPattern(t){this.pattern=t}setCps(t=1){this.cps=t}}export{x as ClockWorker,v as Scheduler,y as getAudioContext,I as getCachedBuffer,S as getLoadedBuffer,T as getLoadedSamples,B as loadBuffer,W as loadGithubSamples,j as resetLoadedSamples,q as samples};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{W as a,D as b}from"./index.e8a05ade.js";export{a as WebMidi,b as enableWebMidi};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{O as a}from"./index.e8a05ade.js";export{a as loadWebDirt};
|
||||
@@ -1 +1 @@
|
||||
import{T as d}from"./index.e8a05ade.js";import{T as A,o as T,a as k,u as E,d as N,f as O,g as I,t as j,k as q,l as x,m as B,b as D,c as F,n as _,q as v,r as C,j as z,h as H,p as S,e as U,s as G,i as J,v as K}from"./index.e8a05ade.js";const f=()=>{document.getElementById("header").style="display:none"};function u(s){window.strudelAnimation&&cancelAnimationFrame(window.strudelAnimation);const a=e=>{const o=d.getTransport().seconds;s(e,o),window.strudelAnimation=requestAnimationFrame(a)};requestAnimationFrame(a)}const g=function(s,a={}){const e=document.getElementById("code"),o="background-image:url("+s+");background-size:contain;";e.style=o;const{className:c}=e,i=(t,n)=>{({style:()=>e.style=o+";"+n,className:()=>e.className=n+" "+c})[t]()},r=Object.entries(a).filter(([t,n])=>typeof n=="function");Object.entries(a).filter(([t,n])=>typeof n=="string").forEach(([t,n])=>i(t,n)),r.length!==0&&u((t,n)=>r.forEach(([l,m])=>{i(l,m(n))}))},h=()=>{const s=document.getElementById("code");s&&(s.style="",s.className="grow relative")};export{A as Tone,T as adsr,k as amsynth,g as backgroundImage,E as cleanupDraw,h as cleanupUi,N as duosynth,O as fmsynth,I as getDefaultSynth,j as getDrawContext,f as hideHeader,q as highpass,x as lowpass,B as membrane,D as metal,F as monosynth,_ as noise,v as osc,C as out,z as piano,H as players,S as pluck,U as polysynth,G as sampler,J as synth,K as vol};
|
||||
import{T as d}from"./index.91bb3680.js";import{T as A,o as T,a as k,u as E,d as N,f as O,g as I,t as j,k as q,l as x,m as B,b as D,c as F,n as _,q as v,r as C,j as z,h as H,p as S,e as U,s as G,i as J,v as K}from"./index.91bb3680.js";const f=()=>{document.getElementById("header").style="display:none"};function u(s){window.strudelAnimation&&cancelAnimationFrame(window.strudelAnimation);const a=e=>{const o=d.getTransport().seconds;s(e,o),window.strudelAnimation=requestAnimationFrame(a)};requestAnimationFrame(a)}const g=function(s,a={}){const e=document.getElementById("code"),o="background-image:url("+s+");background-size:contain;";e.style=o;const{className:c}=e,i=(t,n)=>{({style:()=>e.style=o+";"+n,className:()=>e.className=n+" "+c})[t]()},r=Object.entries(a).filter(([t,n])=>typeof n=="function");Object.entries(a).filter(([t,n])=>typeof n=="string").forEach(([t,n])=>i(t,n)),r.length!==0&&u((t,n)=>r.forEach(([l,m])=>{i(l,m(n))}))},h=()=>{const s=document.getElementById("code");s&&(s.style="",s.className="grow relative")};export{A as Tone,T as adsr,k as amsynth,g as backgroundImage,E as cleanupDraw,h as cleanupUi,N as duosynth,O as fmsynth,I as getDefaultSynth,j as getDrawContext,f as hideHeader,q as highpass,x as lowpass,B as membrane,D as metal,F as monosynth,_ as noise,v as osc,C as out,z as piano,H as players,S as pluck,U as polysynth,G as sampler,J as synth,K as vol};
|
||||
@@ -0,0 +1 @@
|
||||
import{Q as a}from"./index.91bb3680.js";export{a as loadWebDirt};
|
||||
@@ -1 +0,0 @@
|
||||
var h=Object.defineProperty;var p=(e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var l=(e,t,s)=>(p(e,typeof t!="symbol"?t+"":t,s),s);import{S as f,E as u}from"./index.e8a05ade.js";import{F as v,G as L,J as M,N as T,I as B,K as I,M as y,L as F}from"./index.e8a05ade.js";const d=e=>"("+e+")();",g=e=>URL.createObjectURL(new Blob([d(e)],{type:"text/javascript"})),w=e=>new Worker(g(e));class k{constructor(t,s,i=this.interval){l(this,"worker");l(this,"audioContext");l(this,"interval",.2);l(this,"lastEnd",0);this.audioContext=t,this.interval=i,this.worker=w(()=>{let o,a=null;const n=()=>{a&&(clearInterval(a),a=null)},r=()=>{if(n(),!o)throw new Error("no interval set! call worker.postMessage({interval}) before starting.");a=setInterval(()=>postMessage("tick"),o*1e3)};self.onmessage=function(c){c.data=="start"?r():c.data.interval?(o=c.data.interval,a&&r()):c.data=="stop"&&n()}}),this.worker.postMessage({interval:i}),this.worker.onmessage=o=>{if(o.data==="tick"){const a=this.lastEnd||this.audioContext.currentTime,n=this.audioContext.currentTime+this.interval;this.lastEnd=n,s(a,n)}}}start(){console.log("start..."),this.audioContext.resume(),this.worker.postMessage("start")}stop(){console.log("stop..."),this.worker.postMessage("stop")}}class b{constructor({audioContext:t,interval:s=.2,onEvent:i,latency:o=.2}){l(this,"worker");l(this,"pattern");this.worker=new k(t,(a,n)=>{this.pattern.query(new f(new u(a+o,n+o))).forEach(r=>{!r.part.begin.equals(r.whole.begin)||(r.context.onTrigger&&r.context.onTrigger(r.whole.begin,r,t.currentTime,1),i&&(i==null||i(r)))})},s)}start(){if(!this.pattern)throw new Error("Scheduler: no pattern set! call .setPattern first.");this.worker.start()}stop(){this.worker.stop()}setPattern(t){this.pattern=t}}export{k as ClockWorker,b as Scheduler,v as getAudioContext,L as getCachedBuffer,M as getLoadedBuffer,T as getLoadedSamples,B as loadBuffer,I as loadGithubSamples,y as resetLoadedSamples,F as samples};
|
||||
File diff suppressed because one or more lines are too long
+2
-2
@@ -9,8 +9,8 @@
|
||||
<!-- TODO: add manifest images -->
|
||||
<!-- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> -->
|
||||
<title>Strudel Tutorial</title>
|
||||
<script type="module" crossorigin src="/tutorial/assets/index.e8a05ade.js"></script>
|
||||
<link rel="stylesheet" href="/tutorial/assets/index.787effcb.css">
|
||||
<script type="module" crossorigin src="/tutorial/assets/index.91bb3680.js"></script>
|
||||
<link rel="stylesheet" href="/tutorial/assets/index.73765b86.css">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
Reference in New Issue
Block a user