Tárrega’s waltz — the thirteen notes every Nokia rang — and the waltz they came from.
1# Gran Vals (Francisco Tarrega, 1902), the waltz behind the Nokia tune: a score for one speaker2# https://lab.glossema.dev/play/gran-vals3# A major. The phone rings at 180 bpm; the waltz turns at 143, light on two and three.45:localphone 334ms;6:localwaltz 420ms;78:globalnotes{9"E3"=165;"F#3"=185;"G#3"=208;"A3"=220;"B3"=247;10"C#4"=277;"D4"=294;"D#4"=311;"E4"=330;"F#4"=370;"G#4"=415;"A4"=440;"B4"=494;11"C#5"=554;"D5"=587;"D#5"=622;"E5"=659;"F#5"=74012};1314# a duration is counted in eighths: e q h d; p is a quarter that only taps, the pah of the waltz15:globaleighths{"e"=1;"q"=2;"h"=4;"d"=6;"p"=2};1617# $play "NOTE:dur" beat sounds one note against the given beat; "-" is a rest18:globalplaydo={19:globalnotes;20:globaleighths;21:localcut[:find$1":"];22:localnote[:pick$1 0 $cut];23:localkey[:pick$1($cut+ 1)[:len$1]];24:localslot(($2/ 2)*($eighths->$key));25:locallen($slot- 30ms);26:if($key="p")do={:setlen($slot/ 3);}27:if($note!="-")do={28:beepfrequency=($notes->$note)length=$len;29 }30:delay$slot;31}3233# Ring: the thirteen notes, as the phone said them34:put"Ring";35:localring{36"E5:e";"D5:e";"F#4:q";"G#4:q";37"C#5:e";"B4:e";"D4:q";"E4:q";38"B4:e";"A4:e";"C#4:q";"E4:q";39"A4:d"40};41:foreachnin=$ringdo={$play$n$phone;}4243# Waltz: the first strain, one line per bar, the phrase arriving as its last four bars44:put"Waltz";45:localstrain{46"-:h";"E4:q";47"E4:q";"C#4:p";"C#4:p";48"F#4:q";"C#4:p";"C#4:p";49"F#4:q";"C#4:p";"C#4:p";50"G#4:q";"C#4:p";"C#4:p";51"G#4:h";"A4:q";52"A4:h";"G#4:q";53"F#4:q";"D4:p";"D4:p";54"B3:q";"C#4:q";"D4:q";55"F#4:q";"D4:p";"D4:p";56"G#4:h";"A4:q";57"C#5:q";"G#4:p";"G#4:p";58"B4:q";"G#4:p";"G#4:p";59"E5:e";"D5:e";"F#4:q";"G#4:q";60"C#5:e";"B4:e";"D4:q";"E4:q";61"B4:e";"A4:e";"C#4:q";"E4:q";62"E4:d"63};64:foreachnin=$straindo={$play$n$waltz;}6566# the answering strain, in E: the bass on one, the runs on two and three67:localanswer{68"A3:q";"E5:e";"D#5:e";"F#5:e";"E5:e";69"C#5:q";"G#4:p";"G#4:p";70"E3:e";"B3:e";"E4:e";"G#4:e";"E4:e";"G#4:e";71"A4:q";"D#4:p";"D#4:p";72"B3:q";"F#5:e";"D#5:e";"E5:e";"C#5:e";73"E5:q";"A4:p";"A4:p";74"B3:q";"D#5:e";"B4:e";"C#5:e";"A4:e";75"C#5:q";"G#4:p";"G#4:p";76"E3:q";"E5:e";"D#5:e";"F#5:e";"E5:e";77"C#5:q";"G#4:p";"G#4:p";78"E3:e";"G#3:e";"B3:e";"E4:e";"G#4:e";"B4:e";79"B4:q";"C#4:p";"C#4:p";80"A3:e";"F#3:e";"G#3:e";"A3:e";"B3:e";"C#4:e";81"C#4:q";"E4:q";"E5:q";82"D#5:q";"C#5:q";"D#4:q";83"E4:q";"B3:p";"G#3:p"84};85:foreachnin=$answerdo={$play$n$waltz;}8687# Ring again: a bar of silence, then the phone alone in a pocket88:put"Ring again";89:delay($waltz* 3);90:foreachnin=$ringdo={$play$n$phone;}
/
NoteFreqLine
On the router: paste the script into a terminal, or upload the file and run it.