hotfix: off by one error affecting whole notes
All checks were successful
/ build (push) Successful in 36s

This commit is contained in:
Nycki 2025-07-07 10:24:15 -07:00
parent 1f49037fca
commit 142746c3a4
4 changed files with 5 additions and 5 deletions

View file

@ -34,10 +34,10 @@ for(
k?0: // comment
z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0): // change channel
z>17?t+=l: // rest
z<4? // @-+
z<3? // @-+
z?o+=g: // change octave
(o=0,l=1/8): // @
z&1?l=g: // change speed
(console.log(z),z)&1?console.log(l=g): // change speed
( // note
a=new OscillatorNode(A,{
type:`square`,
@ -75,7 +75,7 @@ for(
</td>
</tr>
<tr>
<td><textarea>data:text/html,&lt;meta%20name="viewport"%20content="width=device-width%20initial-scale=1.0"&gt;&lt;textarea%20id=f&gt;&lt;/textarea&gt;&lt;br&gt;&lt;button%20onclick='/*qrplay%20v1,%20nycki%20&%20SArpnt,%202025*/v=f.value;T=[];Z=0;%20f.A=A=f.A||new%20AudioContext;B=new%20GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z&lt;0?0:%20z&gt;29?k=1:%20z&gt;28?k=0:%20k?0:%20z&gt;27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):%20z&gt;17?t+=l:%20z&lt;4?%20z?o+=g:%20(o=0,l=1/8):%20z&1?l=g:%20(%20a=new%20OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`%23`)-(d==`!`))%20}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'&gt;%23play&lt;/button&gt;&lt;button%20onclick='f.A.close();f.A=0'&gt;%23stop&lt;/button&gt;</textarea></td>
<td><textarea>data:text/html,&lt;meta%20name="viewport"%20content="width=device-width%20initial-scale=1.0"&gt;&lt;textarea%20id=f&gt;&lt;/textarea&gt;&lt;br&gt;&lt;button%20onclick='/*qrplay%20v1,%20nycki%20&%20SArpnt,%202025*/v=f.value;T=[];Z=0;f.A=A=f.A||new%20AudioContext;B=new%20GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z&lt;0?0:z&gt;29?k=1:z&gt;28?k=0:k?0:z&gt;27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):z&gt;17?t+=l:z&lt;3?z?o+=g:(o=0,l=1/8):(console.log(z),z)&1?console.log(l=g):(a=new%20OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`%23`)-(d==`!`))}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'&gt;%23play&lt;/button&gt;&lt;button%20onclick='f.A.close();f.A=0'&gt;%23stop&lt;/button&gt;</textarea></td>
<td><textarea>'Solfeggettio in C Minor by JS Bach
@i-e!ce!g+ce!dc-bgb+dgfe!de!
@ice!g+ce!dcdc-bagfe!d

View file

@ -1 +1 @@
<meta name="viewport" content="width=device-width initial-scale=1.0"><textarea id=f></textarea><br><button onclick='/*qrplay v1, nycki & SArpnt, 2025*/v=f.value;T=[];Z=0; f.A=A=f.A||new AudioContext;B=new GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z<0?0: z>29?k=1: z>28?k=0: k?0: z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0): z>17?t+=l: z<4? z?o+=g: (o=0,l=1/8): z&1?l=g: ( a=new OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`#`)-(d==`!`)) }),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'>#play</button><button onclick='f.A.close();f.A=0'>#stop</button>
<meta name="viewport" content="width=device-width initial-scale=1.0"><textarea id=f></textarea><br><button onclick='/*qrplay v1, nycki & SArpnt, 2025*/v=f.value;T=[];Z=0;f.A=A=f.A||new AudioContext;B=new GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z<0?0:z>29?k=1:z>28?k=0:k?0:z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):z>17?t+=l:z<3?z?o+=g:(o=0,l=1/8):(console.log(z),z)&1?console.log(l=g):(a=new OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`#`)-(d==`!`))}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'>#play</button><button onclick='f.A.close();f.A=0'>#stop</button>

View file

@ -2,4 +2,4 @@ note to self:
space -> %20
# -> %23
data:text/html,<meta%20name="viewport"%20content="width=device-width%20initial-scale=1.0"><textarea%20id=f></textarea><br><button%20onclick='/*qrplay%20v1,%20nycki%20&%20SArpnt,%202025*/v=f.value;T=[];Z=0;%20f.A=A=f.A||new%20AudioContext;B=new%20GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z<0?0:%20z>29?k=1:%20z>28?k=0:%20k?0:%20z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):%20z>17?t+=l:%20z<4?%20z?o+=g:%20(o=0,l=1/8):%20z&1?l=g:%20(%20a=new%20OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`%23`)-(d==`!`))%20}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'>%23play</button><button%20onclick='f.A.close();f.A=0'>%23stop</button>
data:text/html,<meta%20name="viewport"%20content="width=device-width%20initial-scale=1.0"><textarea%20id=f></textarea><br><button%20onclick='/*qrplay%20v1,%20nycki%20&%20SArpnt,%202025*/v=f.value;T=[];Z=0;f.A=A=f.A||new%20AudioContext;B=new%20GainNode(A,{gain:0.4});B.connect(A.destination);for(i=o=k=t=0,l=1;c=v[i++],d=v[i],c;z<0?0:z>29?k=1:z>28?k=0:k?0:z>27?(T[Z]=t,Z=+v.slice(i,i+=2),t=T[Z]||0):z>17?t+=l:z<3?z?o+=g:(o=0,l=1/8):(console.log(z),z)&1?console.log(l=g):(a=new%20OscillatorNode(A,{type:`square`,detune:100*(g+o+(d==`%23`)-(d==`!`))}),a.connect(B),a.start(t*.4),t+=l,a.stop(t*.4)))g=[,-12,12,4,-9,2,-7,1,-5,.5,-4,.25,-2,1/8,0,l/3,2,l*1.5][z=`@-+wchdqeifsgta3b.x012456789z\npovukr\x27`.indexOf(c.toLowerCase())]'>%23play</button><button%20onclick='f.A.close();f.A=0'>%23stop</button>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB