This commit is contained in:
parent
95fdf4f136
commit
d10686a994
2 changed files with 47 additions and 28 deletions
|
@ -1,36 +1,35 @@
|
||||||
<META NAME=VIEWPORT CONTENT=INITIAL=SCALE=1>
|
<META NAME=VIEWPORT CONTENT=INITIAL=SCALE=1>
|
||||||
<CENTER>
|
<CENTER>
|
||||||
<P><A HREF=http://nycki.net/qrplay>qrplay v3b</A></P>
|
<P><A HREF=http://nycki.net/qrplay>qrplay v3b</A><br>by nycki and SArpnt</P>
|
||||||
<TEXTAREA ID=F STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>; drum samples!
|
<TEXTAREA ID=F STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>; @title nupa's theme
|
||||||
i 0000 1111 2222 4444 5555 6666 7777 8888 9999
|
; @authors nycki bsp
|
||||||
|
; single channel version
|
||||||
|
|
||||||
hx@
|
1[@0000]
|
||||||
|
|
||||||
; you can overwrite samples
|
2[
|
||||||
0[-c+c]
|
0[c-c+]1 1
|
||||||
00000000
|
0[e-c+]1 0[g-c+]1
|
||||||
|
0[c-b!+]1 1
|
||||||
|
0[e-b!+]1 0[g-b!+]1
|
||||||
|
0[d-a+]1 0[c-a+]1
|
||||||
|
]
|
||||||
|
|
||||||
hx@
|
2
|
||||||
|
0[d-a+]1 0[c-a+]1
|
||||||
|
0[d#-a!+]1 0[d-a!+]1
|
||||||
|
1 1
|
||||||
|
|
||||||
; state is NOT preserved when playing samples
|
2
|
||||||
0[cdefgab+]
|
0[d#-a!+]1 0[d-g+]1
|
||||||
0000
|
0[c--c++]1 1
|
||||||
|
1 1
|
||||||
; state IS preserved during parallel play
|
|
||||||
@q {-ggeec}
|
|
||||||
cdefg
|
|
||||||
|
|
||||||
hx@
|
|
||||||
|
|
||||||
; infinite loop
|
|
||||||
0[i9x9x6xxx0]
|
|
||||||
0
|
|
||||||
</TEXTAREA><P>
|
</TEXTAREA><P>
|
||||||
<BUTTON onclick="
|
<BUTTON onclick="
|
||||||
F.A?.close();
|
F.A?.close();
|
||||||
F.A=A=new AudioContext;
|
F.A=A=new AudioContext;
|
||||||
// kill some time for the audio context to start?
|
// kill some time for the audio context to start
|
||||||
S='@xx'+F.value;
|
S='@qx@'+F.value;
|
||||||
// stack
|
// stack
|
||||||
B=[];
|
B=[];
|
||||||
// stack variables
|
// stack variables
|
||||||
|
@ -68,8 +67,7 @@ M=_=>{
|
||||||
// reset octave and length
|
// reset octave and length
|
||||||
z<5?(O=0,L=1):
|
z<5?(O=0,L=1):
|
||||||
// dots and triplets
|
// dots and triplets
|
||||||
z<6?L*=3/2:
|
z<7?L*=3/(z<6?2:9):
|
||||||
z<7?L/=3:
|
|
||||||
// note or rest
|
// note or rest
|
||||||
z<15?(
|
z<15?(
|
||||||
z-=7,
|
z-=7,
|
||||||
|
@ -109,7 +107,6 @@ M=_=>{
|
||||||
{L,O,T,U,V}=B[--Z];
|
{L,O,T,U,V}=B[--Z];
|
||||||
|
|
||||||
// loop
|
// loop
|
||||||
S=S.slice(s);
|
(S=S.slice(s))&&setTimeout(M)
|
||||||
S&&setTimeout(M)
|
|
||||||
};M()
|
};M()
|
||||||
">#play</BUTTON> <BUTTON ONCLICK=F.A.close()>#stop
|
">#play</BUTTON> <BUTTON ONCLICK=F.A.close()>#stop
|
||||||
|
|
|
@ -1 +1,23 @@
|
||||||
<META NAME=VIEWPORT CONTENT=INITIAL=SCALE=1><CENTER><P><A HREF=http://nycki.net/qrplay>qrplay v3b</A></P><TEXTAREA ID=F STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH></TEXTAREA><P><BUTTON onclick="F.A?.close();F.A=A=new AudioContext;S='@xx'+F.value;B=[];K=O=T=Z=L=0;U=137;V=40;C=['+g','-b+c#deff#g','g++ddb--g++ddb',,'+ea-g--b++g++c#','a#ga#g-a#+g-b+g','-a++c#-aae+e--a','-ffed#ddc#','dddddd#e','--ba#bb-a+a#-b'].map(c=>`{o06m${c}}x`);M=_=>{[a,b,c,d]=S;s=1;z='\n;+-@.3cdefgabx012456789jtsiqhwmuvo{}'.indexOf(a);z<0?0:z<2?K=z:K?0:z<4?O+=a+1|0:z<5?(O=0,L=1):z<6?L*=3/2:z<7?L/=3:z<15?(z-=7,o=new OscillatorNode(A,{type:'square',detune:100*(z*2-(z>2)-(b=='!')+(b=='#')+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<22&&b=='['?(m=0,d=B.findIndex.call(S,c=>c=='['?!++m:c==']'?!--m:0),C[a]=S.slice(s,d),s=d+1):z<24?S=C[a]+S.slice(s--):z<31?L=2**(z-25):z<32?L=U/2**11:z<33?(U=b+c+d,s+=3):z<34?(V=b+c,s+=2):z<35?(O=b+c-4,s+=2):z<36?B[Z++]={L,O,T,U,V}:{L,O,T,U,V}=B[--Z];S=S.slice(s);S&&setTimeout(M)};M()">#play</BUTTON> <BUTTON ONCLICK=F.A.close()>#stop
|
<META NAME=VIEWPORT CONTENT=INITIAL=SCALE=1><CENTER><P><A HREF=http://nycki.net/qrplay>qrplay v3b</A><br>by nycki and SArpnt</P><TEXTAREA ID=F STYLE=WIDTH:MIN(40EM,99%);HEIGHT:9LH>; @title nupa's theme
|
||||||
|
; @authors nycki bsp
|
||||||
|
; single channel version
|
||||||
|
|
||||||
|
1[@0000]
|
||||||
|
|
||||||
|
2[
|
||||||
|
0[c-c+]1 1
|
||||||
|
0[e-c+]1 0[g-c+]1
|
||||||
|
0[c-b!+]1 1
|
||||||
|
0[e-b!+]1 0[g-b!+]1
|
||||||
|
0[d-a+]1 0[c-a+]1
|
||||||
|
]
|
||||||
|
|
||||||
|
2
|
||||||
|
0[d-a+]1 0[c-a+]1
|
||||||
|
0[d#-a!+]1 0[d-a!+]1
|
||||||
|
1 1
|
||||||
|
|
||||||
|
2
|
||||||
|
0[d#-a!+]1 0[d-g+]1
|
||||||
|
0[c--c++]1 1
|
||||||
|
1 1</TEXTAREA><P><BUTTON onclick="F.A?.close();F.A=A=new AudioContext;S='@qx@'+F.value;B=[];K=O=T=Z=L=0;U=137;V=40;C=['+g','-b+c#deff#g','g++ddb--g++ddb',,'+ea-g--b++g++c#','a#ga#g-a#+g-b+g','-a++c#-aae+e--a','-ffed#ddc#','dddddd#e','--ba#bb-a+a#-b'].map(c=>`{@++m${c}}x`);M=_=>{[a,b,c,d]=S;s=1;z='\n;+-@.3cdefgabx012456789jtsiqhwmuv{}'.indexOf(a);z<0?0:z<2?K=z:K?0:z<4?O+=a+1|0:z<5?(O=0,L=1):z<7?L*=3/(z<6?2:9):z<15?(z-=7,o=new OscillatorNode(A,{type:'square',detune:100*(z*2-(z>2)-(b=='!')+(b=='#')+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<22&&b=='['?(m=0,d=B.findIndex.call(S,c=>c=='['?!++m:c==']'?!--m:0),C[a]=S.slice(s,d),s=d+1):z<24?S=C[a]+S.slice(s--):z<31?L=2**(z-25):z<32?L=U/2**11:z<33?(U=b+c+d,s+=3):z<34?(V=b+c,s+=2):z<35?B[Z++]={L,O,T,U,V}:{L,O,T,U,V}=B[--Z];(S=S.slice(s))&&setTimeout(M)};M()">#play</BUTTON> <BUTTON ONCLICK=F.A.close()>#stop
|
Loading…
Add table
Reference in a new issue