The first level of Doom: the riff through every bedroom door, in square waves.
1# At Doom's Gate: the E1M1 riff for one speaker2# https://lab.glossema.dev/play/dooms-gate3# Doom, 1993. E minor, 170 bpm: the riff in eighths on a low E, the lead in quarters an octave up.45:localbeat 352ms;67:globalnotes{8"E3"=165;"Bb3"=233;"B3"=247;"C4"=262;"D4"=294;"E4"=330;"G4"=392;9"B4"=494;"D5"=587;"E5"=659;"F#5"=740;"G5"=784;"A5"=880;"B5"=98810};1112:globaldurs{13"w"=($beat* 4);14"h"=($beat* 2);15"q"=$beat;16"e"=($beat/ 2)17};1819# $play "NOTE:dur" sounds one note; "-" is a rest.20# The gap is carved out of the note, not added after it, so the grid holds at 170.21:globalplaydo={22:globalnotes;23:globaldurs;24:localcut[:find$1":"];25:localnote[:pick$1 0 $cut];26:localkey[:pick$1($cut+ 1)[:len$1]];27:locallen($durs->$key);28:if($note!="-")do={29:beepfrequency=($notes->$note)length=($len- 24ms);30 }31:delay$len;32}3334# The riff: two low E's, then the note that walks down, the octave, D, C, B flat, and back up35:localriff{36"E3:e";"E3:e";"E4:e";37"E3:e";"E3:e";"D4:e";38"E3:e";"E3:e";"C4:e";39"E3:e";"E3:e";"Bb3:e";40"E3:e";"E3:e";"B3:e";"C4:e"41};4243# The riff's second half: the walk stops on B flat and holds it44:localheld{45"E3:e";"E3:e";"E4:e";46"E3:e";"E3:e";"D4:e";47"E3:e";"E3:e";"C4:e";48"E3:e";"E3:e";"Bb3:h";"-:e"49};5051# The riff's first bar, then the lead's answer set into the gap where the B flat would hold52:locallead1{53"E3:e";"E3:e";"E4:e";54"E3:e";"E3:e";"D4:e";"E3:e";"E3:e";55"B4:q";"D5:q";"F#5:q";"A5:q";56"F#5:q";"D5:q";"B4:h"57};58:locallead2{59"E3:e";"E3:e";"E4:e";60"E3:e";"E3:e";"D4:e";"E3:e";"E3:e";61"B4:q";"G4:q";"E5:q";"G5:q";62"B5:q";"G5:q";"E5:h"63};6465# 1. Riff: twice in full, hard and even66:put"Riff";67:forifrom=1 to=2 do={68:foreachnin=$riffdo={$play$n;}69:foreachnin=$helddo={$play$n;}70}7172# 2. Lead: the riff, then the lead answers in its gap; twice, the answer climbing73:put"Lead";74:foreachnin=$riffdo={$play$n;}75:foreachnin=$lead1do={$play$n;}76:foreachnin=$riffdo={$play$n;}77:foreachnin=$lead2do={$play$n;}7879# 3. Riff again: once more in full, and the gate shuts on the riff's own first cell80:put"Riff again";81:foreachnin=$riffdo={$play$n;}82:foreachnin=$helddo={$play$n;}83:localshut{"E3:e";"E3:e";"E4:w"};84:foreachnin=$shutdo={$play$n;}
/
NoteFreqLine
On the router: paste the script into a terminal, or upload the file and run it.