mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-22 13:13:10 -04:00
Updates
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{I as s,M as d,G as o,J as l,F as r,L as t,K as f}from"./index.a9d67b3c.js";export{s as getLoadedBuffer,d as getLoadedSamples,o as loadBuffer,l as loadGithubSamples,r as loadWebDirt,t as resetLoadedSamples,f as samples};
|
||||
import{I as s,M as d,G as o,J as l,F as r,L as t,K as f}from"./index.5a47cda7.js";export{s as getLoadedBuffer,d as getLoadedSamples,o as loadBuffer,l as loadGithubSamples,r as loadWebDirt,t as resetLoadedSamples,f as samples};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
var tt=Object.defineProperty,nt=Object.defineProperties;var at=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var Re=(a,f,r)=>f in a?tt(a,f,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[f]=r,H=(a,f)=>{for(var r in f||(f={}))Pe.call(f,r)&&Re(a,r,f[r]);if(M)for(var r of M(f))Oe.call(f,r)&&Re(a,r,f[r]);return a},J=(a,f)=>nt(a,at(f));var qe=(a,f)=>{var r={};for(var $ in a)Pe.call(a,$)&&f.indexOf($)<0&&(r[$]=a[$]);if(a!=null&&M)for(var $ of M(a))f.indexOf($)<0&&Oe.call(a,$)&&(r[$]=a[$]);return r};import{C as it}from"./index.a9d67b3c.js";function ft(a,f){function r(){this.constructor=a}r.prototype=f.prototype,a.prototype=new r}function D(a,f,r,$){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,D.prototype),l.expected=f,l.found=r,l.location=$,l.name="SyntaxError",l}ft(D,Error);function K(a,f,r){return r=r||" ",a.length>f?a:(f-=a.length,r+=r.repeat(f),a+r.slice(0,f))}D.prototype.format=function(a){var f="Error: "+this.message;if(this.location){var r=null,$;for($=0;$<a.length;$++)if(a[$].source===this.location.source){r=a[$].text.split(/\r\n|\n|\r/g);break}var l=this.location.start,m=this.location.source+":"+l.line+":"+l.column;if(r){var A=this.location.end,w=K("",l.line.toString().length),E=r[l.line-1],d=l.line===A.line?A.column:E.length+1;f+=`
|
||||
var tt=Object.defineProperty,nt=Object.defineProperties;var at=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var Pe=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var Re=(a,f,r)=>f in a?tt(a,f,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[f]=r,H=(a,f)=>{for(var r in f||(f={}))Pe.call(f,r)&&Re(a,r,f[r]);if(M)for(var r of M(f))Oe.call(f,r)&&Re(a,r,f[r]);return a},J=(a,f)=>nt(a,at(f));var qe=(a,f)=>{var r={};for(var $ in a)Pe.call(a,$)&&f.indexOf($)<0&&(r[$]=a[$]);if(a!=null&&M)for(var $ of M(a))f.indexOf($)<0&&Oe.call(a,$)&&(r[$]=a[$]);return r};import{C as it}from"./index.5a47cda7.js";function ft(a,f){function r(){this.constructor=a}r.prototype=f.prototype,a.prototype=new r}function D(a,f,r,$){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,D.prototype),l.expected=f,l.found=r,l.location=$,l.name="SyntaxError",l}ft(D,Error);function K(a,f,r){return r=r||" ",a.length>f?a:(f-=a.length,r+=r.repeat(f),a+r.slice(0,f))}D.prototype.format=function(a){var f="Error: "+this.message;if(this.location){var r=null,$;for($=0;$<a.length;$++)if(a[$].source===this.location.source){r=a[$].text.split(/\r\n|\n|\r/g);break}var l=this.location.start,m=this.location.source+":"+l.line+":"+l.column;if(r){var A=this.location.end,w=K("",l.line.toString().length),E=r[l.line-1],d=l.line===A.line?A.column:E.length+1;f+=`
|
||||
--> `+m+`
|
||||
`+w+` |
|
||||
`+l.line+" | "+E+`
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
var x=Object.defineProperty,A=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))T.call(t,r)&&f(e,r,t[r]);if(k)for(var r of k(t))b.call(t,r)&&f(e,r,t[r]);return e},w=(e,t)=>A(e,C(t));var u=(e,t,r)=>(f(e,typeof t!="symbol"?t+"":t,r),r);import{S as N,E as q,C as O}from"./index.a9d67b3c.js";const M=e=>"("+e+")();",R=e=>URL.createObjectURL(new Blob([M(e)],{type:"text/javascript"})),S=e=>new Worker(R(e));class V{constructor(t,r,n=this.interval){u(this,"worker");u(this,"audioContext");u(this,"interval",.2);u(this,"lastEnd",0);this.audioContext=t,this.interval=n,this.worker=S(()=>{let i,o=null;const s=()=>{o&&(clearInterval(o),o=null)},a=()=>{if(s(),!i)throw new Error("no interval set! call worker.postMessage({interval}) before starting.");o=setInterval(()=>postMessage("tick"),i*1e3)};self.onmessage=function(l){l.data=="start"?a():l.data.interval?(i=l.data.interval,o&&a()):l.data=="stop"&&s()}}),this.worker.postMessage({interval:n}),this.worker.onmessage=i=>{if(i.data==="tick"){const o=this.lastEnd||this.audioContext.currentTime,s=this.audioContext.currentTime+this.interval;this.lastEnd=s,r(o,s)}}}start(){console.log("start..."),this.audioContext.resume(),this.worker.postMessage("start")}stop(){console.log("stop..."),this.worker.postMessage("stop")}}class W{constructor({audioContext:t,interval:r=.2,onEvent:n}){u(this,"worker");u(this,"pattern");this.worker=new V(t,(i,o)=>{this.pattern.query(new N(new q(i,o))).forEach(s=>{!s.part.begin.equals(s.whole.begin)||(n?n==null||n(s):console.warn("unplayable event: no audio node nor onEvent callback",s))})},r)}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}}const{Pattern:c,getFrequency:_,patternify2:F}=O;let d;const p=()=>(d||(d=new AudioContext),d),g=.2,E=(e,t,r,n,i,o,s)=>{const a=p().createGain();return a.gain.setValueAtTime(0,o),a.gain.linearRampToValueAtTime(i,o+e),a.gain.linearRampToValueAtTime(r*i,o+e+t),a.gain.setValueAtTime(r*i,s),a.gain.linearRampToValueAtTime(0,s+n),a};c.prototype.withAudioNode=function(e){return this._withHap(t=>t.setContext(w(h({},t.context),{createAudioNode:(r,n)=>{var i,o;return e(r,n,(o=(i=t.context).createAudioNode)==null?void 0:o.call(i,r,t))}})))};c.prototype._wave=function(e){return this.withAudioNode((t,r)=>{const n=p().createOscillator();n.type=e;const i=_(r);n.frequency.value=i;const o=t!=null?t:r.whole.begin.valueOf()+g,s=o+r.duration.valueOf();return n.start(o),n.stop(s),n})};c.prototype.adsr=function(e=.01,t=.05,r=1,n=.01){return this.withAudioNode((i,o,s)=>{var v;const a=((v=o.context)==null?void 0:v.velocity)||1,l=i!=null?i:o.whole.begin.valueOf()+g,m=l+o.duration.valueOf()+g,y=E(e,t,r,n,a,l,m);return s==null||s.connect(y),y})};c.prototype._filter=function(e="lowpass",t=1e3){return this.withAudioNode((r,n,i)=>{const o=p().createBiquadFilter();return o.type=e,o.frequency.value=t,i==null||i.connect(o),o})};c.prototype.filter=function(e,t){return F(c.prototype._filter)(reify(e),reify(t),this)};c.prototype.out=function(){const e=p().createGain();return e.gain.value=.1,e.connect(p().destination),this.withAudioNode((t,r,n)=>{n||console.warn("out: no source! call .osc() first"),n==null||n.connect(e)})._withHap(t=>{const r=(n,i)=>{var o,s;return(s=(o=i.context)==null?void 0:o.createAudioNode)==null?void 0:s.call(o,n,i)};return t.setContext(w(h({},t.context),{onTrigger:r}))})};c.prototype.define("wave",(e,t)=>t.wave(e),{patternified:!0});export{V as ClockWorker,W as Scheduler,p as getAudioContext};
|
||||
@@ -1 +0,0 @@
|
||||
import{W as a,D as b}from"./index.a9d67b3c.js";export{a as WebMidi,b as enableWebMidi};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{W as a,D as b}from"./index.5a47cda7.js";export{a as WebMidi,b as enableWebMidi};
|
||||
@@ -0,0 +1 @@
|
||||
var v=Object.defineProperty,A=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var x=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var f=(e,t,r)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,h=(e,t)=>{for(var r in t||(t={}))C.call(t,r)&&f(e,r,t[r]);if(x)for(var r of x(t))b.call(t,r)&&f(e,r,t[r]);return e},w=(e,t)=>A(e,T(t));var u=(e,t,r)=>(f(e,typeof t!="symbol"?t+"":t,r),r);import{S as N,E as q,C as O}from"./index.5a47cda7.js";const M=e=>"("+e+")();",R=e=>URL.createObjectURL(new Blob([M(e)],{type:"text/javascript"})),S=e=>new Worker(R(e));class V{constructor(t,r,i=this.interval){u(this,"worker");u(this,"audioContext");u(this,"interval",.2);u(this,"lastEnd",0);this.audioContext=t,this.interval=i,this.worker=S(()=>{let n,o=null;const s=()=>{o&&(clearInterval(o),o=null)},a=()=>{if(s(),!n)throw new Error("no interval set! call worker.postMessage({interval}) before starting.");o=setInterval(()=>postMessage("tick"),n*1e3)};self.onmessage=function(l){l.data=="start"?a():l.data.interval?(n=l.data.interval,o&&a()):l.data=="stop"&&s()}}),this.worker.postMessage({interval:i}),this.worker.onmessage=n=>{if(n.data==="tick"){const o=this.lastEnd||this.audioContext.currentTime,s=this.audioContext.currentTime+this.interval;this.lastEnd=s,r(o,s)}}}start(){console.log("start..."),this.audioContext.resume(),this.worker.postMessage("start")}stop(){console.log("stop..."),this.worker.postMessage("stop")}}class j{constructor({audioContext:t,interval:r=.2,onEvent:i,latency:n=.2}){u(this,"worker");u(this,"pattern");this.worker=new V(t,(o,s)=>{this.pattern.query(new N(new q(o+n,s+n))).forEach(a=>{!a.part.begin.equals(a.whole.begin)||(a.context.onTrigger&&a.context.onTrigger(a.whole.begin,a,t.currentTime,1),i&&(i==null||i(a)))})},r)}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}}const{Pattern:c,getFrequency:_,patternify2:F}=O;let d;const p=()=>(d||(d=new AudioContext),d),g=.2,I=(e,t,r,i,n,o,s)=>{const a=p().createGain();return a.gain.setValueAtTime(0,o),a.gain.linearRampToValueAtTime(n,o+e),a.gain.linearRampToValueAtTime(r*n,o+e+t),a.gain.setValueAtTime(r*n,s),a.gain.linearRampToValueAtTime(0,s+i),a};c.prototype.withAudioNode=function(e){return this._withHap(t=>t.setContext(w(h({},t.context),{createAudioNode:(r,i)=>{var n,o;return e(r,i,(o=(n=t.context).createAudioNode)==null?void 0:o.call(n,r,t))}})))};c.prototype._wave=function(e){return this.withAudioNode((t,r)=>{const i=p().createOscillator();i.type=e;const n=_(r);i.frequency.value=n;const o=t!=null?t:r.whole.begin.valueOf()+g,s=o+r.duration.valueOf();return i.start(o),i.stop(s),i})};c.prototype.adsr=function(e=.01,t=.05,r=1,i=.01){return this.withAudioNode((n,o,s)=>{var y;const a=((y=o.context)==null?void 0:y.velocity)||1,l=n!=null?n:o.whole.begin.valueOf()+g,k=l+o.duration.valueOf()+g,m=I(e,t,r,i,a,l,k);return s==null||s.connect(m),m})};c.prototype._filter=function(e="lowpass",t=1e3){return this.withAudioNode((r,i,n)=>{const o=p().createBiquadFilter();return o.type=e,o.frequency.value=t,n==null||n.connect(o),o})};c.prototype.filter=function(e,t){return F(c.prototype._filter)(reify(e),reify(t),this)};c.prototype.out=function(){const e=p().createGain();return e.gain.value=.1,e.connect(p().destination),this.withAudioNode((t,r,i)=>{i||console.warn("out: no source! call .osc() first"),i==null||i.connect(e)})._withHap(t=>{const r=(i,n)=>{var o,s;return(s=(o=n.context)==null?void 0:o.createAudioNode)==null?void 0:s.call(o,i,n)};return t.setContext(w(h({},t.context),{onTrigger:r}))})};c.prototype.define("wave",(e,t)=>t.wave(e),{patternified:!0});export{V as ClockWorker,j as Scheduler,p as getAudioContext};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
import{T as d}from"./index.a9d67b3c.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.a9d67b3c.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.5a47cda7.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.5a47cda7.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};
|
||||
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.a9d67b3c.js"></script>
|
||||
<link rel="stylesheet" href="/tutorial/assets/index.153eae0f.css">
|
||||
<script type="module" crossorigin src="/tutorial/assets/index.5a47cda7.js"></script>
|
||||
<link rel="stylesheet" href="/tutorial/assets/index.8434e414.css">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
||||
Reference in New Issue
Block a user