MUSIC CODES REFERENCE The music node is ASCII 14. MUSIC CODE SYNTAX: ESC[MF (music note) ESC[MB (music note) OCTAVES AND TONES ----------------- A-G Plays A, B, C, ... G in current octave P Pause (rest). # or + After the note specifies sharp - After the note specifies flat > Increases octave by 1. Octave cannot go beyond 6. < Decreases octave by 1. Octave cannot drop below 0. On Sets current octave (0-6). Nn Plays note n (0-84). With seven possible octaves, there are 84 notes total (12 per octave). Note 0 is a rest. TONE DURATION AND TEMPO ----------------------- Ln Sets length of a note (1-64). The value is the denominator of the note: L4 is a quarter note, L1 is a whole note, etc. The length may also follow the note when a change of length only is desired for a particular note. For example: L 4 A A 16 A is the same as L 4 A L 16 A L 4 A Tn Sets number of quarter notes per minute (32-255). The default for n is 120. MS Sets "music staccato" so that each note will play 3/4 of the time determined by the length (L). MN Sets "music normal" so that each note will play 7/8 of the time determined by the length (L). ML Sets "music legato" so that each note will play the full period set by length (L). . A period after a note causes the note to play 3/2 times the length determined by L. The period has the same meaning as in a musical score. Multiple periods can appear after a note. Each period adds a length equal to one half the length of the previous period. For example: "A." plays 1 + 1/2 or 3/2 times the length. "A.." plays 1 + 1/2 + 1/4 or 7/4 times the length. Periods can appear after a pause (P). The pause length is scaled in the same way notes are scaled. OPERATION --------- MF Sets music/sound to run in foreground MB Sets music/sound to run in background SOUND CODES REFERENCE The music node is ASCII 14. SOUND CODE SYNTAX: ESC[MF FREQ; DURA; CYCLES; DELAY; VARI (music note) FREQUENCY A numeric value from 37 to 32,767. Frequency is the desired frequency in hertz. DURATION A numeric value from 0 to 65,535. Duration is how long the tone should play, measured in clock ticks. There are 18.2 clock ticks per second regardless of CPU speed. CYCLES (opt) An integer from 0 to 9,999. Cycles is the number of times to repeat the frequency/duration. DELAY (opt) An integer from 0 to 999,999,999. Delay is the length of pause between cycles. VARIATION (opt) A numeric value from -9,999 to 9,999. Variation will change the FREQUENCY each time the tone is repeated using the CYCLES variable. FREQUENCY will use its current value, add the VARIATION value to itself (per cycle) to get a new FREQUENCY, then play the new FREQUENCY. LISTING OF TONES, both by MUSIC CODES and by SOUND CODES -------------------------------------------------------- Example: The following codes will all yield the same tone... MUSIC CODE ESC[O0 C (music note) MUSIC CODE ESC[N1 (music note) SOUND CODE ESC[65.406;8 (music note) HELMHOLTZ MUSIC SOUND OCTAVE NOTE NOTATION CODE (NOTE) CODE (FREQUENCY) ------ ------ --------- ----------- ---------------- D#,E- - 00038.890 E - 00041.204 F - 00043.654 F#,G- - 00046.250 G - 00049.000 G#,A- - 00051.914 A - 00055.000 A#,B- - 00058.270 B - 00061.736 ---------------------------------------------------------------- 00 C CC N1 00065.406 C#,D- N2 00069.296 D N3 00073.416 D#,E- N4 00077.782 E N5 00082.406 F N6 00087.308 F#,G- N7 00092.498 G N8 00097.998 G#,A- N9 00103.826 A N10 00110.000 A#,B- N11 00116.540 B N12 00123.470 ---------------------------------------------------------------- 01 C C N13 00130.812 C#,D- N14 00138.592 D N15 00146.832 D#,E- N16 00155.564 E N17 00164.821 F N18 00174.614 F#,G- N19 00185.000 G N20 00195.998 G#,A- N21 00207.660 A N22 00220.000 A#,B- N23 00233.080 B N24 00246.940 ---------------------------------------------------------------- 02 C c N25 00261.620 C#,D- N26 00277.180 D N27 00296.660 D#,E- N28 00311.120 E N29 00329.620 F N30 00349.220 F#,G- N31 00370.000 G N32 00392.000 G#,A- N33 00415.300 A N34 00440.000 A#,B- N35 00466.160 B N36 00493.880 ---------------------------------------------------------------- 03 C c' (middle) N37 00523.260 C#,D- N38 00554.360 D N39 00587.320 D#,E- N40 00622.260 E N41 00659.260 F N42 00698.460 F#,G- N43 00739.980 G N44 00784.000 G#,A- N45 00830.600 A N46 00880.000 A#,B- N47 00892.320 B N48 00987.760 ---------------------------------------------------------------- 04 C c'' N49 01046.500 default C#,D- N50 01108.740 octave D N51 01174.660 D#,E- N52 01244.500 E N53 01318.520 F N54 01396.920 F#,G- N55 01479.980 G N56 01567.980 G#,A- N57 01661.220 A N58 01760.000 A#,B- N59 01864.660 B N60 01975.540 ---------------------------------------------------------------- 05 C c''' N61 02093.000 C#,D- N62 02217.400 D N63 02349.400 D#,E- N64 02489.000 E N65 02637.000 F N66 02793.800 F#,G- N67 02960.000 G N68 03136.000 G#,A- N69 03322.400 A N70 03520.000 A#,B- N71 03729.400 B N72 03951.000 ---------------------------------------------------------------- 06 C c'''' N73 04186.000 C#,D- N74 04435.000 D N75 04698.600 D#,E- N76 04978.000 E N77 05274.000 F N78 05587.600 F#,G- N79 05920.000 G N80 06272.000 G#,A- N81 06644.800 A N82 07040.000 A#,B- N83 07458.600 B N84 07902.200 ---------------------------------------------------------------- C cv - 08372.000 C#,D- - 08869.800 D - 09397.200 D#,E- - 09956.000 E - 10548.000 F - 11175.400 F#,G- - 11839.800 G - 12543.800 G#,A- - 13289.800 A - 14080.000 A#,B- - 14917.200 B - 15804.200 ---------------------------------------------------------------- C - 16744.000 C#,D- - 17739.600 D - 18794.600 D#,E- - 19912.200 E - 21096.200 F - 22350.600 F#,G- - 23679.600 G - 25083.800 G#,A- - 26579.400 A - 28160.000 A#,B- - 29834.400 B - 31608.600 * Note: also see the file ANSICODE.TXT for a listing of ANSI escape control codes.