diff --git a/assets/index-b1c73188.js b/assets/index-78471af9.js similarity index 99% rename from assets/index-b1c73188.js rename to assets/index-78471af9.js index ea40119..5174587 100644 --- a/assets/index-b1c73188.js +++ b/assets/index-78471af9.js @@ -182,7 +182,21 @@ beat([.25,.125, .5].beat(4))::snd('arpy:4') .cutoff(100 + usine(1/8) * 800).lpadsr(5, 0, [1/8, 1.16].beat(), 0, 0) .resonance(5).gain(0.4).end(0.8).room(0.9).size(0.9).n(3).out(); beat(.5) :: snd('arpy').note([30, 33, 35].repeatAll(4).beat(1) - [24,12].beat(0.5)) - .cutoff(500).lpadsr(8, 0.05, .125, 0, 0).out()`];class bt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),Zn.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let r=[];return this.decompose(e,t,r,0),Zn.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new _o(this),s=new _o(e);for(let a=t,o=t;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new _o(this,e)}iterRange(e,t=this.length){return new lv(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new cv(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?bt.empty:e.length<=32?new er(e):Zn.from(er.split(e,[]))}}class er extends bt{constructor(e,t=SI(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let a=this.text[s],o=i+a.length;if((t?r:o)>=e)return new OI(i,o,r,a);i=o+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new er(b_(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=Bl(s.text,a.text.slice(),0,s.length);if(o.length<=32)r.push(new er(o,a.length+s.length));else{let l=o.length>>1;r.push(new er(o.slice(0,l)),new er(o.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof er))return super.replace(e,t,r);let i=Bl(this.text,Bl(r.text,b_(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new er(i,s):Zn.from(er.split(i,[]),s)}sliceString(e,t=this.length,r=` + .cutoff(500).lpadsr(8, 0.05, .125, 0, 0).out()`,` +// Naïf et agréable -- Bubobubobubo +z1('1/8 024!3 035 024 0124').sound('wt_stereo') + .adsr(0, .4, 0.5, .4).gain(0.1) + .lpadsr(4, 0, .2, 0, 0) + .cutoff(5000 + usine(1/2) * 2000) + .n([1,2,4].beat(4)).out() +z2('<1/8 1/16> __ 0 <(^) (^ ^)> (0,8)').sound('wt_stereo') + .adsr(0, .5, 0.5, .4).gain(0.2) + .lpadsr(4, 0, .2, 0, 0).n(14) + .cutoff(200 + usine(1/2) * 4000) + .n([1,2,4].beat(4)).o(2).room(0.9).out() +let osci = 2000 + usine(1/2) * 2000; +z3('can can:2').sound().gain(1).cutoff(osci).out() +z4('1/4 kick kick snare kick').sound().gain(1).cutoff(osci).out()`];class bt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),Zn.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let r=[];return this.decompose(e,t,r,0),Zn.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new _o(this),s=new _o(e);for(let a=t,o=t;;){if(i.next(a),s.next(a),a=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(o+=i.value.length,i.done||o>=r)return!0}}iter(e=1){return new _o(this,e)}iterRange(e,t=this.length){return new lv(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new cv(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?bt.empty:e.length<=32?new er(e):Zn.from(er.split(e,[]))}}class er extends bt{constructor(e,t=SI(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let a=this.text[s],o=i+a.length;if((t?r:o)>=e)return new OI(i,o,r,a);i=o+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new er(b_(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let a=r.pop(),o=Bl(s.text,a.text.slice(),0,s.length);if(o.length<=32)r.push(new er(o,a.length+s.length));else{let l=o.length>>1;r.push(new er(o.slice(0,l)),new er(o.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof er))return super.replace(e,t,r);let i=Bl(this.text,Bl(r.text,b_(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new er(i,s):Zn.from(er.split(i,[]),s)}sliceString(e,t=this.length,r=` `){let i="";for(let s=0,a=0;s<=t&&ae&&a&&(i+=r),es&&(i+=o.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new er(r,i)),r=[],i=-1);return i>-1&&t.push(new er(r,i)),t}}class Zn extends bt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let a=this.children[s],o=i+a.length,l=r+a.lines-1;if((t?l:o)>=e)return a.lineInner(e,t,r,i);i=o+1,r=l+1}}decompose(e,t,r,i){for(let s=0,a=0;a<=t&&s=a){let c=i&((a<=e?1:0)|(l>=t?2:0));a>=e&&l<=t&&!c?r.push(o):o.decompose(e-a,t-a,r,c)}a=l+1}}replace(e,t,r){if(r.lines=s&&t<=o){let l=a.replace(e-s,t-s,r),c=this.lines-a.lines+l.lines;if(l.lines>5-1&&l.lines>c>>5+1){let u=this.children.slice();return u[i]=l,new Zn(u,this.length-(t-e)+r.length)}return super.replace(s,o,l)}s=o+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=` `){let i="";for(let s=0,a=0;se&&s&&(i+=r),ea&&(i+=o.sliceString(e-a,t-a,r)),a=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Zn))return 0;let r=0,[i,s,a,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==a||s==o)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let _ of e)r+=_.lines;if(r<32){let _=[];for(let T of e)T.flatten(_);return new er(_,t)}let i=Math.max(32,r>>5),s=i<<1,a=i>>1,o=[],l=0,c=-1,u=[];function p(_){let T;if(_.lines>s&&_ instanceof Zn)for(let R of _.children)p(R);else _.lines>a&&(l>a||!l)?(m(),o.push(_)):_ instanceof er&&l&&(T=u[u.length-1])instanceof er&&_.lines+T.lines<=32?(l+=_.lines,c+=_.length+1,u[u.length-1]=new er(T.text.concat(_.text),T.length+1+_.length)):(l+_.lines>i&&m(),l+=_.lines,c+=_.length+1,u.push(_))}function m(){l!=0&&(o.push(u.length==1?u[0]:Zn.from(u,c)),c=-1,l=u.length=0)}for(let _ of e)p(_);return m(),o.length==1?o[0]:new Zn(o,t)}}bt.empty=new er([""],0);function SI(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Bl(n,e,t=0,r=1e9){for(let i=0,s=0,a=!0;s=t&&(l>r&&(o=o.slice(0,r-i)),i0?1:(e instanceof er?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],a=s>>1,o=i instanceof er?i.text.length:i.children.length;if(a==(t>0?o:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(i instanceof er){let l=i.text[a+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[a+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof er?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class lv{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new _o(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class cv{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(bt.prototype[Symbol.iterator]=function(){return this.iter()},_o.prototype[Symbol.iterator]=lv.prototype[Symbol.iterator]=cv.prototype[Symbol.iterator]=function(){return this});let OI=class{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}},rs="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;nn)return rs[e-1]<=n;return!1}function T_(n){return n>=127462&&n<=127487}const v_=8205;function Ar(n,e,t=!0,r=!0){return(t?uv:bI)(n,e,r)}function uv(n,e,t){if(e==n.length)return e;e&&dv(n.charCodeAt(e))&&pv(n.charCodeAt(e-1))&&e--;let r=Sr(n,e);for(e+=mn(r);e=0&&T_(Sr(n,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function bI(n,e,t){for(;e>0;){let r=uv(n,e-2,t);if(r=56320&&n<57344}function pv(n){return n>=55296&&n<56320}function Sr(n,e){let t=n.charCodeAt(e);if(!pv(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return dv(r)?(t-55296<<10)+(r-56320)+65536:t}function ng(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function mn(n){return n<65536?1:2}const Uf=/\r\n?|\n/;var lr=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(lr||(lr={}));class ri{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-i);s+=o}else{if(r!=lr.Simple&&c>=e&&(r==lr.TrackDel&&ie||r==lr.TrackBefore&&ie))return null;if(c>e||c==e&&t<0&&!o)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r=0&&i<=t&&o>=e)return it?"cover":!0;i=o}return!1}toString(){let e="";for(let t=0;t=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ri(e)}static create(e){return new ri(e)}}class or extends ri{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Ff(this,(t,r,i,s,a)=>e=e.replace(i,i+(r-t),a),!1),e}mapDesc(e,t=!1){return Yf(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i=0){t[i]=o,t[i+1]=a;let l=i>>1;for(;r.length0&&zi(r,t,s.text),s.forward(u),o+=u}let c=e[a++];for(;o>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],a=0,o=null;function l(u=!1){if(!u&&!i.length)return;am||p<0||m>t)throw new RangeError(`Invalid change range ${p} to ${m} (in doc of length ${t})`);let T=_?typeof _=="string"?bt.of(_.split(r||Uf)):_:bt.empty,R=T.length;if(p==m&&R==0)return;pa&&yr(i,p-a,-1),yr(i,m-p,R),zi(s,i,T),a=m}}return c(e),l(!o),o}static empty(e){return new or(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;io&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length=0&&t<=0&&t==n[i+1]?n[i]+=e:e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function zi(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r>1])),!(t||a==n.sections.length||n.sections[a+1]<0);)o=n.sections[a++],l=n.sections[a++];e(i,c,s,u,p),i=c,s=u}}}function Yf(n,e,t,r=!1){let i=[],s=r?[]:null,a=new Ao(n),o=new Ao(e);for(let l=-1;;)if(a.ins==-1&&o.ins==-1){let c=Math.min(a.len,o.len);yr(i,c,-1),a.forward(c),o.forward(c)}else if(o.ins>=0&&(a.ins<0||l==a.i||a.off==0&&(o.len=0&&l=0){let c=0,u=a.len;for(;u;)if(o.ins==-1){let p=Math.min(u,o.len);c+=p,u-=p,o.forward(p)}else if(o.ins==0&&o.lenl||a.ins>=0&&a.len>l)&&(o||r.length>c),s.forward2(l),a.forward(l)}}}}class Ao{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?bt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?bt.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class fa{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new fa(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return fe.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return fe.range(this.anchor,r)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return fe.range(e.anchor,e.head)}static create(e,t,r){return new fa(e,t,r)}}class fe{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:fe.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new fe(e.ranges.map(t=>fa.fromJSON(t)),e.main)}static single(e,t=e){return new fe([fe.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;ie?4:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;is.head?fe.range(l,o):fe.range(o,l))}}return new fe(e,t)}}function fv(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ig=0;class Ye{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=ig++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}static define(e={}){return new Ye(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:ag),!!e.static,e.enables)}of(e){return new Ul([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ul(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ul(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function ag(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Ul{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=ig++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,a=e[s]>>1,o=this.type==2,l=!1,c=!1,u=[];for(let p of this.dependencies)p=="doc"?l=!0:p=="selection"?c=!0:((t=e[p.id])!==null&&t!==void 0?t:1)&1||u.push(e[p.id]);return{create(p){return p.values[a]=r(p),1},update(p,m){if(l&&m.docChanged||c&&(m.docChanged||m.selection)||$f(p,u)){let _=r(p);if(o?!C_(_,p.values[a],i):!i(_,p.values[a]))return p.values[a]=_,1}return 0},reconfigure:(p,m)=>{let _,T=m.config.address[s];if(T!=null){let R=nc(m,T);if(this.dependencies.every(I=>I instanceof Ye?m.facet(I)===p.facet(I):I instanceof Tr?m.field(I,!1)==p.field(I,!1):!0)||(o?C_(_=r(p),R,i):i(_=r(p),R)))return p.values[a]=R,0}else _=r(p);return p.values[a]=_,1}}}}function C_(n,e,t){if(n.length!=e.length)return!1;for(let r=0;rn[l.id]),i=t.map(l=>l.type),s=r.filter(l=>!(l&1)),a=n[e.id]>>1;function o(l){let c=[];for(let u=0;ur===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(y_).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],a=this.updateF(s,i);return this.compareF(s,a)?0:(r.values[t]=a,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}init(e){return[this,y_.of({field:this,create:e})]}get extension(){return this}}const ua={lowest:4,low:3,default:2,high:1,highest:0};function Ws(n){return e=>new mv(e,n)}const vi={highest:Ws(ua.highest),high:Ws(ua.high),default:Ws(ua.default),low:Ws(ua.low),lowest:Ws(ua.lowest)};class mv{constructor(e,t){this.inner=e,this.prec=t}}class Xn{of(e){return new Gf(this,e)}reconfigure(e){return Xn.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Gf{constructor(e,t){this.compartment=e,this.inner=t}}class rc{constructor(e,t,r,i,s,a){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,r){let i=[],s=Object.create(null),a=new Map;for(let m of vI(e,t,a))m instanceof Tr?i.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let o=Object.create(null),l=[],c=[];for(let m of i)o[m.id]=c.length<<1,c.push(_=>m.slot(_));let u=r==null?void 0:r.config.facets;for(let m in s){let _=s[m],T=_[0].facet,R=u&&u[m]||[];if(_.every(I=>I.type==0))if(o[T.id]=l.length<<1|1,ag(R,_))l.push(r.facet(T));else{let I=T.combine(_.map(L=>L.value));l.push(r&&T.compare(I,r.facet(T))?r.facet(T):I)}else{for(let I of _)I.type==0?(o[I.id]=l.length<<1|1,l.push(I.value)):(o[I.id]=c.length<<1,c.push(L=>I.dynamicSlot(L)));o[T.id]=c.length<<1,c.push(I=>TI(I,T,_))}}let p=c.map(m=>m(o));return new rc(e,a,p,o,l,s)}}function vI(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(a,o){let l=i.get(a);if(l!=null){if(l<=o)return;let c=r[l].indexOf(a);c>-1&&r[l].splice(c,1),a instanceof Gf&&t.delete(a.compartment)}if(i.set(a,o),Array.isArray(a))for(let c of a)s(c,o);else if(a instanceof Gf){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(a.compartment)||a.inner;t.set(a.compartment,c),s(c,o)}else if(a instanceof mv)s(a.inner,a.prec);else if(a instanceof Tr)r[o].push(a),a.provides&&s(a.provides,o);else if(a instanceof Ul)r[o].push(a),a.facet.extensions&&s(a.facet.extensions,ua.default);else{let c=a.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(n,ua.default),r.reduce((a,o)=>a.concat(o))}function So(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function nc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const gv=Ye.define(),_v=Ye.define({combine:n=>n.some(e=>e),static:!0}),Sv=Ye.define({combine:n=>n.length?n[0]:void 0,static:!0}),Ov=Ye.define(),Ev=Ye.define(),bv=Ye.define(),Tv=Ye.define({combine:n=>n.length?n[0]:!1});class Ci{constructor(e,t){this.type=e,this.value=t}static define(){return new CI}}class CI{of(e){return new Ci(this,e)}}class yI{constructor(e){this.map=e}of(e){return new lt(this,e)}}class lt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new lt(this.type,t)}is(e){return this.type==e}static define(e={}){return new yI(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}lt.reconfigure=lt.define();lt.appendConfig=lt.define();class cr{constructor(e,t,r,i,s,a){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,r&&fv(r,t.newLength),s.some(o=>o.type==cr.time)||(this.annotations=s.concat(cr.time.of(Date.now())))}static create(e,t,r,i,s,a){return new cr(e,t,r,i,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(cr.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}cr.time=Ci.define();cr.userEvent=Ci.define();cr.addToHistory=Ci.define();cr.remote=Ci.define();function AI(n,e){let t=[];for(let r=0,i=0;;){let s,a;if(r=n[r]))s=n[r++],a=n[r++];else if(i=0;i--){let s=r[i](n);s instanceof cr?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof cr?n=s[0]:n=Cv(e,ns(s),!1)}return n}function II(n){let e=n.startState,t=e.facet(bv),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=vv(r,Qf(e,s,n.changes.newLength),!0))}return r==n?n:cr.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const NI=[];function ns(n){return n==null?NI:Array.isArray(n)?n:[n]}var Gt=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Gt||(Gt={}));const wI=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let qf;try{qf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function DI(n){if(qf)return qf.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||wI.test(t)))return!0}return!1}function xI(n){return e=>{if(!/\S/.test(e))return Gt.Space;if(DI(e))return Gt.Word;for(let t=0;t-1)return Gt.Word;return Gt.Other}}class St{constructor(e,t,r,i,s,a){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let o=0;oi.set(l,o)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(lt.reconfigure)?(t=null,r=a.value):a.is(lt.appendConfig)&&(t=null,r=ns(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=rc.resolve(r,i,this),s=new St(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,l)=>l.reconfigure(o,this),null).values),new St(t,e.newDoc,e.newSelection,s,(a,o)=>o.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:fe.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],a=ns(r.effects);for(let o=1;oa.spec.fromJSON(o,l)))}}return St.create({doc:e.doc,selection:fe.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=rc.resolve(e.extensions||[],new Map),r=e.doc instanceof bt?e.doc:bt.of((e.doc||"").split(t.staticFacet(St.lineSeparator)||Uf)),i=e.selection?e.selection instanceof fe?e.selection:fe.single(e.selection.anchor,e.selection.head):fe.single(0);return fv(i,r.length),t.staticFacet(_v)||(i=i.asSingle()),new St(t,r,i,t.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(St.tabSize)}get lineBreak(){return this.facet(St.lineSeparator)||` @@ -1571,7 +1585,21 @@ Ziffers is a **musical number based notation** tuned for _live coding_. It is a - exploring **generative / aleatoric / stochastic** melodies and applying them to sounds and synths. - embracing a different mindset and approach to time and **patterning**. -${e("Super Fancy Ziffers example","",!0)} +${e("Super Fancy Ziffers example",` +z1('1/8 024!3 035 024 0124').sound('wt_stereo') + .adsr(0, .4, 0.5, .4).gain(0.1) + .lpadsr(4, 0, .2, 0, 0) + .cutoff(5000 + usine(1/2) * 2000) + .n([1,2,4].beat(4)).out() +z2('<1/8 1/16> __ 0 <(^) (^ ^)> (0,8)').sound('wt_stereo') + .adsr(0, .5, 0.5, .4).gain(0.2) + .lpadsr(4, 0, .2, 0, 0).n(14) + .cutoff(200 + usine(1/2) * 4000) + .n([1,2,4].beat(4)).o(2).room(0.9).out() +let osci = 1500 + usine(1/2) * 2000; +z3('can can:2').sound().gain(1).cutoff(osci).out() +z4('1/4 kick kick snare kick').sound().gain(1).cutoff(osci).out() +`,!0)} ## Notation diff --git a/index.html b/index.html index 82c0ce9..443ea0e 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - +