The first zone of Sonic, swung eighths and a walking bass.
1# Green Hill Zone: a score for one speaker2# https://lab.glossema.dev/play/green-hill3# Sonic the Hedgehog, 1991 (Masato Nakamura). C major, 130 bpm, swung eighths.45:localbeat 462ms;67:globalnotes{8"C3"=131;"D3"=147;"E3"=165;"F3"=175;9"C4"=262;"D4"=294;"E4"=330;"F4"=349;"G4"=392;"A4"=440;"B4"=494;10"C5"=523;"D5"=587;"E5"=65911};1213# The swing: a long eighth L leads the beat, a short one s follows it; L + s = q14:globaldurs{15"s"=($beat/ 3);16"L"=(($beat* 2)/ 3);17"q"=$beat;18"h"=($beat* 2);19"hs"=(($beat* 2)+($beat/ 3));20"w"=($beat* 4)21};2223# $play "NOTE:dur" sounds one note; "-" is a rest24:globalplaydo={25:globalnotes;26:globaldurs;27:localcut[:find$1":"];28:localnote[:pick$1 0 $cut];29:localkey[:pick$1($cut+ 1)[:len$1]];30:locallen($durs->$key);31:if($note!="-")do={32:beepfrequency=($notes->$note)length=$len;33 }34:delay($len+ 20ms);35}3637# 1. Call: the bass steps on F, the tune rises and turns and lands on G; a pickup, and it lands on G again38:put"Call";39:localcall{40"F3:L";"-:s";41"C5:L";"A4:q";"C5:s";"B4:q";"C5:L";"B4:q";"G4:h";"-:s";42"F3:L";43"G4:s";"E5:L";"D5:q";"C5:s";"B4:q";"C5:L";"B4:q";"G4:h";"-:s"44};45:foreachnin=$calldo={$play$n;}4647# 2. Answer: the same rise, then the bass walks down to D and the tune falls home to C48:put"Answer";49:localanswer{50"F3:L";"-:s";51"C5:L";"A4:q";"C5:s";"B4:q";"C5:L";"B4:q";"G4:h";"-:s";52"D3:L";53"A4:s";"A4:L";"F4:q";"A4:s";"G4:q";"A4:L";"G4:q";"C4:h";"-:s"54};55:foreachnin=$answerdo={$play$n;}5657# 3. Call again: the call once more, closed with the answer's own cadence58:put"Call again";59:localagain{60"F3:L";"-:s";61"C5:L";"A4:q";"C5:s";"B4:q";"C5:L";"B4:q";"G4:h";"-:s";62"F3:L";63"G4:s";"E5:L";"D5:q";"C5:s";"B4:q";"C5:L";"B4:q";"G4:hs";64"A4:L";"G4:q";"C4:w"65};66:foreachnin=$againdo={$play$n;}
/
NoteFreqLine
On the router: paste the script into a terminal, or upload the file and run it.