Stage one of Chip ’n Dale, bouncing along on one speaker.
1# Rescue Rangers: Zone A (Chip 'n Dale Rescue Rangers, NES), for one speaker2# https://lab.glossema.dev/play/rescue-rangers3# D major, 150 bpm. Cells that climb and answer; the bass hops in the gaps before the strong beats.45:localbeat 400ms;6:globalgap 50ms;78# Equal temperament, A4 = 440. The low row is the bass; the rest is the tune.9:globalnotes{10"A2"=110;"B2"=123;"D3"=147;"E3"=165;"F#3"=185;"G3"=196;11"D4"=294;"E4"=330;"F#4"=370;"G4"=392;"A4"=440;"B4"=494;12"C#5"=554;"D5"=587;"E5"=659;"F#5"=740;"G5"=784;"A5"=880;"B5"=98813};1415# Sounding lengths; each slot is the length plus the gap: s=100ms e=200ms q=400ms16:globaldurs{17"s"=(($beat/ 4)-$gap);18"e"=(($beat/ 2)-$gap);19"q"=($beat-$gap)20};2122# $play "NOTE:dur" sounds one note and waits out its slot; "-" is a rest23:globalplaydo={24:globalnotes;25:globaldurs;26:globalgap;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+$gap);35}3637# Verse: a bass hop, then a rising cell on D that lands high and answers falling; the cell climbs to E, then A, and bounces home38:localverse{39"-:s";"D3:s";40"D4:e";"F#4:e";"A4:e";"F#4:e";"D5:q";"-:e";"-:s";"A2:s";41"D5:e";"C#5:e";"B4:e";"A4:e";"F#4:q";"-:e";"-:s";"E3:s";42"E4:e";"G4:e";"B4:e";"G4:e";"E5:q";"-:e";"-:s";"B2:s";43"E5:e";"D5:e";"C#5:e";"B4:e";"G4:q";"-:e";"-:s";"A2:s";44"E4:e";"A4:e";"C#5:e";"A4:e";"E5:q";"-:e";"-:s";"E3:s";45"E5:e";"D5:e";"C#5:e";"B4:e";"A4:q";"-:e";"-:s";"D3:s";46"D5:e";"C#5:e";"D5:e";"-:s";"A2:s";"E5:e";"D5:e";"E5:e";"-:s";"D3:s";47"F#5:e";"A5:e";"-:e";"-:s";"D3:s";"D5:q";"-:e"48};4950# Answer: the same shape turned over, falling from G, then from A, then from B, and one run down into the verse51:localanswer{52"-:s";"G3:s";53"G5:e";"F#5:e";"E5:e";"D5:e";"B4:q";"-:e";"-:s";"G3:s";54"B4:e";"G4:e";"B4:e";"-:s";"D3:s";"D5:e";"B4:e";"D5:e";"-:s";"A2:s";55"A5:e";"G5:e";"F#5:e";"E5:e";"C#5:q";"-:e";"-:s";"A2:s";56"C#5:e";"A4:e";"C#5:e";"-:s";"E3:s";"E5:e";"C#5:e";"E5:e";"-:s";"B2:s";57"B5:e";"A5:e";"G5:e";"F#5:e";"D5:q";"-:e";"-:s";"B2:s";58"D5:e";"B4:e";"D5:e";"-:s";"F#3:s";"F#5:e";"D5:e";"F#5:e";"-:s";"A2:s";59"E5:e";"C#5:e";"A4:e";"-:s";"E3:s";"E5:e";"C#5:e";"A4:e";"-:s";"E3:s";60"G5:e";"F#5:e";"E5:e";"D5:e";"C#5:e";"B4:e";"A4:e"61};6263# The piece: verse, answer, verse again64:put"Verse";65:foreachnin=$versedo={$play$n;}6667:put"Answer";68:foreachnin=$answerdo={$play$n;}6970:put"Verse again";71:foreachnin=$versedo={$play$n;}
/
NoteFreqLine
On the router: paste the script into a terminal, or upload the file and run it.