# Rescue Rangers: Zone A (Chip 'n Dale Rescue Rangers, NES), for one speaker # https://lab.glossema.dev/play/rescue-rangers # D major, 150 bpm. Cells that climb and answer; the bass hops in the gaps before the strong beats. :local beat 400ms; :global gap 50ms; # Equal temperament, A4 = 440. The low row is the bass; the rest is the tune. :global notes { "A2"=110; "B2"=123; "D3"=147; "E3"=165; "F#3"=185; "G3"=196; "D4"=294; "E4"=330; "F#4"=370; "G4"=392; "A4"=440; "B4"=494; "C#5"=554; "D5"=587; "E5"=659; "F#5"=740; "G5"=784; "A5"=880; "B5"=988 }; # Sounding lengths; each slot is the length plus the gap: s=100ms e=200ms q=400ms :global durs { "s"=(($beat / 4) - $gap); "e"=(($beat / 2) - $gap); "q"=($beat - $gap) }; # $play "NOTE:dur" sounds one note and waits out its slot; "-" is a rest :global play do={ :global notes; :global durs; :global gap; :local cut [:find $1 ":"]; :local note [:pick $1 0 $cut]; :local key [:pick $1 ($cut + 1) [:len $1]]; :local len ($durs->$key); :if ($note != "-") do={ :beep frequency=($notes->$note) length=$len; } :delay ($len + $gap); } # 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 home :local verse { "-:s"; "D3:s"; "D4:e"; "F#4:e"; "A4:e"; "F#4:e"; "D5:q"; "-:e"; "-:s"; "A2:s"; "D5:e"; "C#5:e"; "B4:e"; "A4:e"; "F#4:q"; "-:e"; "-:s"; "E3:s"; "E4:e"; "G4:e"; "B4:e"; "G4:e"; "E5:q"; "-:e"; "-:s"; "B2:s"; "E5:e"; "D5:e"; "C#5:e"; "B4:e"; "G4:q"; "-:e"; "-:s"; "A2:s"; "E4:e"; "A4:e"; "C#5:e"; "A4:e"; "E5:q"; "-:e"; "-:s"; "E3:s"; "E5:e"; "D5:e"; "C#5:e"; "B4:e"; "A4:q"; "-:e"; "-:s"; "D3:s"; "D5:e"; "C#5:e"; "D5:e"; "-:s"; "A2:s"; "E5:e"; "D5:e"; "E5:e"; "-:s"; "D3:s"; "F#5:e"; "A5:e"; "-:e"; "-:s"; "D3:s"; "D5:q"; "-:e" }; # Answer: the same shape turned over, falling from G, then from A, then from B, and one run down into the verse :local answer { "-:s"; "G3:s"; "G5:e"; "F#5:e"; "E5:e"; "D5:e"; "B4:q"; "-:e"; "-:s"; "G3:s"; "B4:e"; "G4:e"; "B4:e"; "-:s"; "D3:s"; "D5:e"; "B4:e"; "D5:e"; "-:s"; "A2:s"; "A5:e"; "G5:e"; "F#5:e"; "E5:e"; "C#5:q"; "-:e"; "-:s"; "A2:s"; "C#5:e"; "A4:e"; "C#5:e"; "-:s"; "E3:s"; "E5:e"; "C#5:e"; "E5:e"; "-:s"; "B2:s"; "B5:e"; "A5:e"; "G5:e"; "F#5:e"; "D5:q"; "-:e"; "-:s"; "B2:s"; "D5:e"; "B4:e"; "D5:e"; "-:s"; "F#3:s"; "F#5:e"; "D5:e"; "F#5:e"; "-:s"; "A2:s"; "E5:e"; "C#5:e"; "A4:e"; "-:s"; "E3:s"; "E5:e"; "C#5:e"; "A4:e"; "-:s"; "E3:s"; "G5:e"; "F#5:e"; "E5:e"; "D5:e"; "C#5:e"; "B4:e"; "A4:e" }; # The piece: verse, answer, verse again :put "Verse"; :foreach n in=$verse do={ $play $n; } :put "Answer"; :foreach n in=$answer do={ $play $n; } :put "Verse again"; :foreach n in=$verse do={ $play $n; }