v2
This commit is contained in:
parent
6f6ed6fe47
commit
dc3811b5d5
3 changed files with 82 additions and 15 deletions
BIN
static/qrplay/qrplay-v2-nupas-theme.png
Normal file
BIN
static/qrplay/qrplay-v2-nupas-theme.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
|
@ -37,8 +37,6 @@ T=[];L=[];
|
|||
u=137;
|
||||
// volume. 40 is default, 35 is half, 30 is half again.
|
||||
v=40;
|
||||
// percussion can be approximated as 1024th notes.
|
||||
P=x=>(s=`z99${x}z${Z} o${o+4} x`+s.slice(c),c=0,T[99]=t,L[99]=2**-5);
|
||||
for(
|
||||
c=t=k=Z=0;D=s[c+1],E=D+s[c+2],C=s[c++];
|
||||
// no match
|
||||
|
@ -50,18 +48,8 @@ for(
|
|||
// dots and triplets
|
||||
z<5?l*=3/2:
|
||||
z<6?l/=3:
|
||||
// percussion
|
||||
C==`0`?P(`o07g`):
|
||||
C==`1`?P(`o05b+c#deff#gg#aa#b+cc#d`):
|
||||
C==`2`?P(`o06g++ddb--g++ddb--g++ddb--g++ddb`):
|
||||
C==`4`?P(`o07g`): // todo
|
||||
C==`5`?P(`o07g`): // todo
|
||||
C==`6`?P(`o05a++c#-aae+e--a++c#-aae+e--a++c#`):
|
||||
C==`7`?P(`o07g`): // todo
|
||||
C==`8`?P(`o07g`): // todo
|
||||
C==`9`?P(`o04a++c#-aae+e--a++c#-aae+e--a++c#`): // todo
|
||||
// note or rest
|
||||
z<23?(
|
||||
z<14?(
|
||||
z-=6,
|
||||
O=new OscillatorNode(A,{
|
||||
type:`square`,
|
||||
|
@ -73,6 +61,22 @@ for(
|
|||
O.start(t),
|
||||
O.stop(t+=7.5*l/u)
|
||||
):
|
||||
// percussion
|
||||
z<23?(
|
||||
// insert micronotes to match ZZTs drums. random numbers chosen in advance.
|
||||
s=`z99o06${[
|
||||
"+g",
|
||||
"-b+c#deff#gg#aa#b+cc#d",
|
||||
"g++ddb--g++ddb--g++ddb--g++ddb",
|
||||
,
|
||||
"+ea-g--b++g++c#----b++g+cd#-g+cec",
|
||||
"a#ga#g-a#+g-b+g",
|
||||
"-a++c#-aae+e--a++c#-aae+e--a++c#",
|
||||
"-fffeeed#d#dddc#c#c#",
|
||||
"dddddedc#ded#fee",
|
||||
"--ba#bb-a+a#-baaa+a#bb-a",
|
||||
][z-14]}z${Z} o${o+4} x`+s.slice(c),c=0,T[99]=t,L[99]=u/2**12
|
||||
):
|
||||
// reset octave and duration
|
||||
z<24?(o=0,l=1):
|
||||
// set note length
|
||||
|
@ -89,7 +93,7 @@ for(
|
|||
z<34?(v=E,c+=2):
|
||||
// set octave
|
||||
(o=E-4,c+=2)
|
||||
)z=`\n;-+.3cdefgab012456789x@jtsiqhwzuvo`.indexOf(C)
|
||||
)z=`\n;-+.3cdefgabx012456789@jtsiqhwzuvo`.indexOf(C)
|
||||
'>#play</button> <button onclick=f.A.close()>#stop</button>
|
||||
<!-- stop snipping here -->
|
||||
</center>
|
||||
|
|
|
@ -1 +1,64 @@
|
|||
<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></textarea><p><button onclick='s=f.value.toLowerCase();f.A?.close();A=f.A=new AudioContext;T=[];u=137;v=40;for(c=t=o=k=Z=0,l=3;D=s[c+1],E=D+s[c+2],C=s[c++];z<0?0:z<2?k=z:k?0:z<4?o+=C+12|0:z<6?l*=3/d:z<23?(z-=6,O=new OscillatorNode(A,{type:`square`,detune:100*(z*2-(z>3)-(D==`!`)+(D==`#`)+o-9)}),G=new GainNode(A,{gain:z<7&&.5**(11-v/5)}),O.connect(G),G.connect(A.destination),O.start(t),O.stop(t+=2.5*l/u)):z<24?(o=0,l=3):z<31?l=3<<(z-25):z<32?(T[Z]=t,t=T[Z=E]|0,c+=2):z<33?u=E+s[c+=2,c++]:(v=E,c+=2))z=`\n;-+.3cdefgab012456789x@jtsiqhwzuv`.indexOf(C)'>#play</button> <button onclick=f.A.close()>#stop</button>
|
||||
<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
|
||||
</textarea><p>
|
||||
<button onclick='
|
||||
s=`@`+f.value.toLowerCase();
|
||||
f.A?.close();
|
||||
A=f.A=new AudioContext;
|
||||
T=[];L=[];
|
||||
u=137;
|
||||
v=40;
|
||||
for(
|
||||
c=t=k=Z=0;D=s[c+1],E=D+s[c+2],C=s[c++];
|
||||
z<0?0:
|
||||
z<2?k=z:k?0:
|
||||
z<4?o+=C+1|0:
|
||||
z<5?l*=3/2:
|
||||
z<6?l/=3:
|
||||
z<14?(
|
||||
z-=6,
|
||||
O=new OscillatorNode(A,{
|
||||
type:`square`,
|
||||
detune:100*(z*2-(z>2)-(D==`!`)+(D==`#`)+12*o-9)
|
||||
}),
|
||||
G=new GainNode(A,{gain:z<7&&.5**(12-v/5)}),
|
||||
O.connect(G),
|
||||
G.connect(A.destination),
|
||||
O.start(t),
|
||||
O.stop(t+=7.5*l/u)
|
||||
):
|
||||
z<23?(
|
||||
s=`z99o06${[
|
||||
"+g",
|
||||
"-b+c#deff#gg#aa#b+cc#d",
|
||||
"g++ddb--g++ddb--g++ddb--g++ddb",
|
||||
,
|
||||
"+ea-g--b++g++c#----b++g+cd#-g+cec",
|
||||
"a#ga#g-a#+g-b+g",
|
||||
"-a++c#-aae+e--a++c#-aae+e--a++c#",
|
||||
"-fffeeed#d#dddc#c#c#",
|
||||
"dddddedc#ded#fee",
|
||||
"--ba#bb-a+a#-baaa+a#bb-a",
|
||||
][z-14]}z${Z} o${o+4} x`+s.slice(c),c=0,T[99]=t,L[99]=u/2**12
|
||||
):
|
||||
z<24?(o=0,l=1):
|
||||
z<31?l=2**(z-25):
|
||||
z<32?(
|
||||
T[Z]=t,L[Z]=l,
|
||||
t=T[Z=E|0]||0,l=L[Z]||l,
|
||||
c+=2
|
||||
):
|
||||
z<33?u=E+s[c+=2,c++]:
|
||||
z<34?(v=E,c+=2):
|
||||
(o=E-4,c+=2)
|
||||
)z=`\n;-+.3cdefgabx012456789@jtsiqhwzuvo`.indexOf(C)
|
||||
'>#play</button> <button onclick=f.A.close()>#stop</button>
|
Loading…
Add table
Reference in a new issue