This commit is contained in:
parent
0a3a5393d0
commit
879810698b
1 changed files with 15 additions and 21 deletions
|
@ -26,19 +26,9 @@
|
|||
<meta name=viewport content=initial-scale=1>
|
||||
<center>
|
||||
<p><a href=http://nycki.net/qrplay>qrplay v2c</a></p>
|
||||
<textarea id=f style=width:min(40em,99%);height:9lh>; #title nupa's theme
|
||||
; #authors nycki bsp
|
||||
z00
|
||||
@qcceg hcqeg dcdc d#h.d
|
||||
@qcceg hcqeg dcd#d wc
|
||||
z01
|
||||
@-wc b! a a!
|
||||
@-wc b! haqa!g w-c
|
||||
z02
|
||||
@i 0000001x 0000002x 0000004x 0000005x
|
||||
@i 0000006x 0000007x 0000008x 0000009x</textarea><p>
|
||||
<textarea id=f style=width:min(40em,99%);height:9lh></textarea><p>
|
||||
<button onclick='
|
||||
s=`@`+f.value.toLowerCase();
|
||||
s=`@x`+f.value.toLowerCase();
|
||||
f.A?.close();
|
||||
A=f.A=new AudioContext;
|
||||
// stack for parallel stuff
|
||||
|
@ -60,8 +50,11 @@ V=[
|
|||
u=137;
|
||||
// volume. 40 is default, 35 is half, 30 is half again.
|
||||
v=40;
|
||||
for(
|
||||
c=t=k=Z=0;D=s[c+1],E=D+s[c+2],C=s[c++];
|
||||
t=k=Z=0;
|
||||
F=()=>{
|
||||
[C,D,E]=s;
|
||||
c=1;
|
||||
z=`\n;-+.3cdefgabx012456789@jtsiqhwmuvo{}`.indexOf(C);
|
||||
// no match
|
||||
z<0?0:
|
||||
// comments
|
||||
|
@ -94,8 +87,7 @@ for(
|
|||
),
|
||||
V[C]=s.slice(c+1,d),
|
||||
s=s.slice(d+1),
|
||||
c=0,
|
||||
console.log(V[C],s)
|
||||
c=0
|
||||
):
|
||||
// play sample
|
||||
z<23?(s=V[C]+s.slice(c),c=0):
|
||||
|
@ -106,17 +98,19 @@ for(
|
|||
// microtone
|
||||
z<32?l=u/2**11:
|
||||
// change tempo
|
||||
z<33?u=E+s[c+=2,c++]:
|
||||
z<33?u=D+E+s[c+=2,c++]:
|
||||
// change volume
|
||||
z<34?(v=E,c+=2):
|
||||
z<34?(v=D+E,c+=2):
|
||||
// set octave
|
||||
z<35?(o=E-4,c+=2):
|
||||
z<35?(o=D+E-4,c+=2):
|
||||
// play in parallel
|
||||
z<36?S[Z++]={t,l,u,v,o}:
|
||||
z<37?{t,l,u,v,o}=S[--Z]:
|
||||
// no effect
|
||||
0
|
||||
)z=`\n;-+.3cdefgabx012456789@jtsiqhwmuvo{}`.indexOf(C)
|
||||
0;
|
||||
s=s.slice(c);
|
||||
s&&setTimeout(F);
|
||||
};F()
|
||||
'>#play</button> <button onclick=f.A.close()>#stop</button>
|
||||
<!-- stop snipping here -->
|
||||
</center>
|
||||
|
|
Loading…
Add table
Reference in a new issue