Allegro

ALLEGRO: A experimental musical composition by a tin eared Welshman. There are three <GO SUB routines>. <GO SUB 100> produces a indefinite musical chord which is interrupted by touching any key. <GO SUB 102> gets a 10 second musical pause. <GO SUB 122> brings prompts to adjust the chord dwell and time duration of a musical interlude. Line numbers 116 and 118 are data lines that contain the absolute frequencies of the musical scale. These notes are played in groups of three. Arrangement of a melody involves the sequencing of scales in the two data statements, using audio frequencies of the notes. Insertion of BEEPS in line 104 can produce other effects.

ALLEGRO

 100 RESTORE VAL "116": LET xx=VAL "4e4": GO TO VAL "104"
102 RESTORE VAL "116": LET xx=VAL "600": GO TO VAL "104"
104 GO SUB VAL "108": SOUND VAL "7",VAL "56": SOUND VAL "0",a1;VAL "1",a2;VAL "8",VAL "12": PAUSE VAL "20": GO SUB VAL "108": SOUND VAL "2",a1;VAL "3",a2;VAL "9",VAL "13": PAUSE VAL "20": GO SUB VAL "108": SOUND VAL "4",a1;VAL "5",a2;VAL "10",VAL "12": PAUSE xx: SOUND VAL "0",VAL "0";VAL "1",VAL "0";VAL "2",VAL "0";VAL "3",VAL "0";VAL "4",VAL "0";VAL "5",VAL "0": RETURN
106 RETURN
108 READ f: IF f=VAL "10" THEN RESTORE VAL "116": READ f
110 LET x7=VAL "1.75"/(f*VAL "10"): LET x7=x7*VAL "1e6"
112 LET a2=INT (x7/VAL "256"): LET a1=INT x7-INT (x7/VAL "256")*VAL "256"
114 RETURN
116 DATA VAL "880",VAL "932.32",VAL "987.76",932.32,VAL "987.76",VAL "830.608",VAL "58.27",VAL "65.406",VAL "130.812",VAL "440", VAL "880",VAL "1760",VAL "92.498",VAL "69.296",VAL "138.592",VAL "97.998",VAL "110",VAL "130.812",VAL "146.832",VAL "82.406",VAL "87.308",VAL "97.998",VAL "146.832",VAL "155.564",VAL "164.812",VAL "195.996",VAL "103.826",VAL "138.592",VAL "1396.928",VAL "1567.968",VAL "1318.496",VAL "2092.992",VAL "2217.472",VAL "2349.312",VAL "1174.656",VAL "1318.496",VAL "1396.928",VAL "493.88",VAL "523.248",VAL "587.328",VAL "233.08",VAL "246.94",VAL "61.624",VAL "10"
118 DATA VAL "3136.936",VAL "297.856",VAL "3520",VAL "698.454",VAL "783.984",VAL "659.248",VAL "55",VAL "87.308",VAL "73.416",VAL "174.816",VAL "194.995",VAL "207.652",VAL "349.232",VAL "391.992",VAL "329.642",VAL "10",VAL "10"
120 LET xx=VAL "4e4": GO SUB VAL "104": GO TO VAL "120"
122 RESTORE VAL "118": INPUT "Note Length (seconds)? ";a: LET xx=a*30: INPUT "Interlude in Minutes? ";b: LET yx=xx*b: FOR n=VAL "1" TO yx: GO SUB VAL "104": NEXT n

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.