Compare commits

..

No commits in common. "afe017cba83e5847895f49c7130f3158a398ccf1" and "7ed6ac3d7d42e7bb69a2b024b7a6abe5ae73f361" have entirely different histories.

View file

@ -1,58 +1,32 @@
<!--
modified version of SArpnt's player (see /golf3.html)
compatible with QR alphanumeric mode or with ZZM files
reference
A: Audio context
C: Command Character
D: character after C, or other Data
F: main Function, also object that holds samples
G: Gain node
H: textarea Html element
I: Index into M
J: lookahead (for sharps and flats)
L: note Length
M: Music text
N: semitone Note offset (for octave changes)
O: Oscillator node
P: current time step
Q: numeric command id
S: find Sample
T: note Time
U: bpm
W: realtime When the song starts
-->
<!-- snip -->
<META NAME=VIEWPORT CONTENT=initial-scale=1> <META NAME=VIEWPORT CONTENT=initial-scale=1>
<CENTER> <CENTER>
<P><A HREF=http://nycki.net/qrplay>qrplay v3e</A><br>by nycki and SArpnt</P> <P><A HREF=http://nycki.net/qrplay>qrplay v3e</A><br>by nycki and SArpnt</P>
<TEXTAREA ID=H STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>: $TITLE WiL Best :: Atrocity <TEXTAREA ID=H STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>; @title nupa's theme
: $SONG TITLE 1 The Forest Chase ; @authors nycki bsp
s-a+ebaeagea+c-bgae+c-g ; single channel version
s-da+degf#dagedf#dcef# 1[@0000]
s-a+ebaeagea+c-bgae+c-g
s-da+degf#dagedf#dega 2[
s--g+g+bagdbf#bgdf#gab+c 0[c-c+]1 1
scg+ce-g+e-g+cd-g+cc-g+cd-g 0[e-c+]1 0[g-c+]1
s-f+cf+c-afcfgcfacefe 0[c-b!+]1 1
s-eb+efg#ab+cd#efg#ab+fe 0[e-b!+]1 0[g-b!+]1
; $SONG ENDS 0[d-a+]1 0[c-a+]1
s-a+ebaeagea+c-bgae+c-g ]
s-da+degf#dagedf#dcef#
s-a+ebaeagea+c-bgae+c-g 2
s-da+degf#dagedf#dega 0[d-a+]1 0[c-a+]1
s--g+g+bagdbf#bgdf#gab+c 0[d#-a!+]1 0[d-a!+]1
scg+ce-g+e-g+cd-g+cc-g+cd-g 1 1
s-f+cf+c-afcfgcfacefe
s-eb+efg#ab+cd#efg#ab+fe 2
0[d#-a!+]1 0[d-g+]1
0[c--c++]1 1
1 1
</TEXTAREA><P> </TEXTAREA><P>
<BUTTON onclick=" <BUTTON onclick="
H.A?.close();
H.A=A=new AudioContext; H.A=A=new AudioContext;
W=Date.now(); W=Date.now();
U=137;
F=( F=(
M='', M='',
T=0, T=0,
@ -61,21 +35,15 @@ F=(
I=0, I=0,
K=0, K=0,
S=D=>D?S(D+(M[++I]==C)-(M[I]=='/')):I S=D=>D?S(D+(M[++I]==C)-(M[I]=='/')):I
)=>{for(; )=>{;for(;
C=M[I++]; C=M[I++];
D=M[I], D=M[I],
J=E=>E.indexOf(D)>=0, J=E=>E.indexOf(D)>=0,
P=L/U*15/8,
// start of comment // start of comment
Q>24?K=1: Q>21?K=1:
// reset Q>20?(L=N=4,K=0):
Q>23?(L=N=4,K=0):
// backspace
Q>22?T-=P:
// check comment mode // check comment mode
K?0: K?0:
// change octave
Q>20?N-=C+12:
Q>7? Q>7?
// DECREMENT Q, and then... // DECREMENT Q, and then...
(Q-=9)? (Q-=9)?
@ -107,19 +75,20 @@ F=(
Q&&O.connect(G), Q&&O.connect(G),
G.connect(A.destination), G.connect(A.destination),
O.start(T), O.start(T),
O.stop(T+=P) O.stop(T+=L/U*15/8)
): ):
// any unused non-whitespace letter or number // any unused letter or number
C>'@'||1+C>1?(E=>setTimeout( C-3|C>'@'?setTimeout(
// play a sample async // play a sample in parallel
_=>F(...E), _=>F(D,T,L,N),
// don't async too far ahead or you'll lag us out // ...but don't read infinitely far ahead
1e3*E[1]-Date.now()+W-5e3, 1e3*T-Date.now()+W-5e3,
))([F[C],T+=P,L,N]): D=F[C]
// do nothing ):
0 // change octave, or noop
)Q='XCDEFGABR$JTSIQHWVU3.-+P\n;/'.indexOf(C)}, N-=C+12|0
F('RV35'+H.value.toUpperCase()) )Q='XCDEFGABR$JTSIQHWVU3.\n;:'.indexOf(C)},
F('\nU137V40'+H.value.toUpperCase())
">#play</BUTTON> <BUTTON onclick=H.A.close()>#stop ">#play</BUTTON> <BUTTON onclick=H.A.close()>#stop
<!-- snip --> <!-- snip -->