parent
afe017cba8
commit
6e2d3a94f5
1 changed files with 62 additions and 46 deletions
|
@ -1,26 +1,60 @@
|
||||||
<!--
|
<!--
|
||||||
modified version of SArpnt's player (see /golf3.html)
|
nycki's modified version of SArpnt's player (see /golf3.html)
|
||||||
compatible with QR alphanumeric mode or with ZZM files
|
compatible with ZZM files or with a reduced instruction set for QR Alphanumeric efficiency.
|
||||||
|
|
||||||
reference
|
commands, case-insensitive
|
||||||
A: Audio context
|
ABCDEFG play note
|
||||||
C: Command Character
|
* or # sharp
|
||||||
D: character after C, or other Data
|
: or ! flat
|
||||||
F: main Function, also object that holds samples
|
X rest
|
||||||
G: Gain node
|
P go one note length to the Past
|
||||||
H: textarea Html element
|
JTSIQHW set note length to sixtyfourth, Thirtytwoth, Sixteenth, eIghth, Quarter, Half, Whole. (persistent)
|
||||||
I: Index into M
|
. increase note length by 50% (persistent)
|
||||||
J: lookahead (for sharps and flats)
|
3 divide note length by 3 (persistent)
|
||||||
L: note Length
|
+ octave up (persistent)
|
||||||
M: Music text
|
- octave down (persistent)
|
||||||
N: semitone Note offset (for octave changes)
|
R or \n reset note length and octave
|
||||||
O: Oscillator node
|
Vxx set volume
|
||||||
P: current time step
|
Uxxx set bpm
|
||||||
Q: numeric command id
|
$x.../ set sample
|
||||||
S: find Sample
|
01245679 play sample
|
||||||
T: note Time
|
|
||||||
U: bpm
|
ZZM mode
|
||||||
W: realtime When the song starts
|
comments begin with ; and metadata begins with $ (inside a comment)
|
||||||
|
for instance:
|
||||||
|
; $SONG TITLE 1 The Forest Chase
|
||||||
|
|
||||||
|
QR Alphanumeric Mode
|
||||||
|
0-9A-Z $%*+-./:
|
||||||
|
no lowercase, no newline, limited punctuation.
|
||||||
|
to convert, use R for reset, * for sharp, : for flat, /.../ for comment.
|
||||||
|
|
||||||
|
Chords
|
||||||
|
to play multiple notes at once, use P after each note to back up and play another one in parallel. to play multiple channels at once, convert each channel to a sample and use P after playing each sample.
|
||||||
|
|
||||||
|
variable 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
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
data:TEXT/HTML,<META%20NAME=VIEWPORT%20CONTENT=initial-scale=1><CENTER><P><A%20HREF=http://nycki.net/qrplay>qrplay%20v3e</A><br>by%20nycki%20and%20SArpnt</P><TEXTAREA%20ID=H%20STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>; $TITLE WiL Best :: Atrocity%0A; $SONG TITLE 1 The Forest Chase%0AS-A+EBAEAGEA+C-BGAE+C-GRS-DA+DEGF*DAGEDF*DCEF*RS-A+EBAEAGEA+C-BGAE+C-GRS-DA+DEGF*DAGEDF*DEGARS--G+G+BAGDBF*BGDF*GAB+CRSCG+CE-G+E-G+CD-G+CC-G+CD-GRS-F+CF+C-AFCFGCFACEFERS-EB+EFG*AB+CD*EFG*AB+FE%0A</TEXTAREA><P><BUTTON%20onclick="H.A?.close();H.A=A=new%20AudioContext;W=Date.now();U=137;F=(M='',T=0,L,N,I=0,K=0,S=D=>D?S(D+(M[++I]==C)-(M[I]=='/')):I)=>{for(;C=M[I++];D=M[I],J=E=>E.indexOf(D)>=0,P=L/U*15/8,Q>25?K=!K:Q>23?(K=Q-24)||(L=N=4):K?0:Q>22?T-=P:Q>20?N-=C+12:Q>7?(Q-=9)?Q>9?L/=+C||2/3:Q>7?(D=D+M[++I,I++]|0)?Q>8?U=D+M[I++]:G=new%20GainNode(A,{gain:2**(D/5-11)}):0:L=~Q?1<<Q:(K=0,N=4):F[D]=M.slice(++I,S(1)):~Q?(O=new%20OscillatorNode(A,{type:%20'square',detune:100*(Q*2-(Q>3)-J('!:')+J('%23*')-N-7)}),Q&&O.connect(G),G.connect(A.destination),O.start(T),O.stop(T+=P)):C>'@'||1+C>1?(E=>setTimeout(_=>F(...E),1e3*E[1]-Date.now()+W-5e3,))([F[C],T+=P,L,N]):0)Q='XCDEFGABR$JTSIQHWVU3.-+P\n;/'.indexOf(C)},F('RV35'+H.value.toUpperCase())">%23play</BUTTON>%20<BUTTON%20onclick=H.A.close()>%23stop
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,25 +62,9 @@ reference
|
||||||
<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 WiL Best :: Atrocity
|
||||||
: $SONG TITLE 1 The Forest Chase
|
; $SONG TITLE 1 The Forest Chase
|
||||||
s-a+ebaeagea+c-bgae+c-g
|
S-A+EBAEAGEA+C-BGAE+C-GRS-DA+DEGF*DAGEDF*DCEF*RS-A+EBAEAGEA+C-BGAE+C-GRS-DA+DEGF*DAGEDF*DEGARS--G+G+BAGDBF*BGDF*GAB+CRSCG+CE-G+E-G+CD-G+CC-G+CD-GRS-F+CF+C-AFCFGCFACEFERS-EB+EFG*AB+CD*EFG*AB+FE
|
||||||
s-da+degf#dagedf#dcef#
|
|
||||||
s-a+ebaeagea+c-bgae+c-g
|
|
||||||
s-da+degf#dagedf#dega
|
|
||||||
s--g+g+bagdbf#bgdf#gab+c
|
|
||||||
scg+ce-g+e-g+cd-g+cc-g+cd-g
|
|
||||||
s-f+cf+c-afcfgcfacefe
|
|
||||||
s-eb+efg#ab+cd#efg#ab+fe
|
|
||||||
; $SONG ENDS
|
|
||||||
s-a+ebaeagea+c-bgae+c-g
|
|
||||||
s-da+degf#dagedf#dcef#
|
|
||||||
s-a+ebaeagea+c-bgae+c-g
|
|
||||||
s-da+degf#dagedf#dega
|
|
||||||
s--g+g+bagdbf#bgdf#gab+c
|
|
||||||
scg+ce-g+e-g+cd-g+cc-g+cd-g
|
|
||||||
s-f+cf+c-afcfgcfacefe
|
|
||||||
s-eb+efg#ab+cd#efg#ab+fe
|
|
||||||
</TEXTAREA><P>
|
</TEXTAREA><P>
|
||||||
<BUTTON onclick="
|
<BUTTON onclick="
|
||||||
H.A?.close();
|
H.A?.close();
|
||||||
|
@ -66,14 +84,12 @@ F=(
|
||||||
D=M[I],
|
D=M[I],
|
||||||
J=E=>E.indexOf(D)>=0,
|
J=E=>E.indexOf(D)>=0,
|
||||||
P=L/U*15/8,
|
P=L/U*15/8,
|
||||||
// start of comment
|
// skip comments and reset on newline
|
||||||
Q>24?K=1:
|
Q>25?K=!K:
|
||||||
// reset
|
Q>23?(K=Q-24)||(L=N=4):
|
||||||
Q>23?(L=N=4,K=0):
|
K?0:
|
||||||
// backspace
|
// backspace
|
||||||
Q>22?T-=P:
|
Q>22?T-=P:
|
||||||
// check comment mode
|
|
||||||
K?0:
|
|
||||||
// change octave
|
// change octave
|
||||||
Q>20?N-=C+12:
|
Q>20?N-=C+12:
|
||||||
Q>7?
|
Q>7?
|
||||||
|
|
Loading…
Add table
Reference in a new issue