NullLogic

...

#!/usr/bin/nsp dl.load("winapi"); function makescales() { var O = { [4] = { C = 261.63; /* middle c */ Cs = 277.18; Df = 277.18; D = 293.66; Ds = 311.13; Ef = 311.13; E = 329.63; F = 349.23; Fs = 369.99; Gf = 369.99; G = 392.00; Gs = 415.30; Af = 415.30; A = 440.00; As = 466.16; Bf = 466.16; B = 493.88; }; } for (i=3;i>(-1);i--) { O[i]={}; for (j=0;j<sizeof(O[i+1]);j++) { if ((x=iname(O[i+1], j))==null) break; O[i][x]=O[i+1][x]/2; } } for (i=5;i<11;i++) { O[i]={}; for (j=0;j<sizeof(O[i-1]);j++) { if ((x=iname(O[i-1], j))==null) break; O[i][x]=O[i-1][x]*2; } } sort.byname(O); return O; } if (win.Beep==null) { print("This test requires Win32\r\n"); } else { var s=2000; /* length of a bar in ms */ var O=makescales(); /* D+G, F+Bflat, G+C, D+G, F+Bflat, Gsharp*+Csharp**, G+C D+G, F+Bflat, G+C, F+Bflat, D+G */ var smoke = { { n=O[2]['G'], d=s/4 }; { n=O[2]['Bf'], d=s/4 }; { n=O[3]['C'], d=s/4+s/8 }; { n=O[2]['G'], d=s/4 }; { n=O[2]['Bf'], d=s/4 }; { n=O[3]['Cs'], d=s/8 }; { n=O[3]['C'], d=s/2 }; { n=O[2]['G'], d=s/4 }; { n=O[2]['Bf'], d=s/4 }; { n=O[3]['C'], d=s/4+s/8 }; { n=O[2]['Bf'], d=s/4 }; { n=O[2]['G'], d=s/8 }; { n=O[2]['G'], d=s/2+s/4 }; }; print("Smoke On The Water - Deep Purple\r\n"); foreach (note in smoke) { print("."); io.flush(); win.Beep(note.n, note.d-50); win.Beep(64000, 50); } }