MIDI Music Box
Algorithmic composition software for the Atari ST (monochrome only)
by David Snow

This is an enhanced version of a do-it-yourself software project that 
appeared in the March 1989 issue of Electronic Musician magazine. MIDI 
Music Box is an algorithmic composition program that can be best 
described as a four-track sequencer that generates its own tracks.  In 
the original bare-bones version, user interaction was minimal: 
pressing "G" on the computer keyboard would cause the program to 
generate four monophonic tracks on MIDI channels 1, 2, 3 and 4; 
pressing the "P" key would play the tracks; and pressing the "T" key 
would allow you to change the playback tempo.  The tracks were 
generated from rhythmic source patterns that were strung together in 
random order; pitches were chosen randomly from a source set.  Since 
the source rhythms and pitches were coded into the program, you had to 
mess around with the BASIC listing if your wanted to alter them.  I 
wrote this version to allow one to more easily change the rhythms and 
pitches, and also to add functions to modify the generated tracks. 
Although it's more user-friendly than the original, it's not exactly 
"intuitive" to operate, so here are brief instructions:

1.  Hook the MIDI output of your ST to a 4-channel multitimbral synth 
(or four single-channel synths) which is set to receive MIDI data on 
channels 1, 2, 3 and 4.  Hook the MIDI out of the synth (or a 
keyboard controller) to the ST's MIDI input.

2.  Run the program (duh).

3.  Before you can make music, you need to program Music Box with 
rhythms and pitches:

	a. Click on the EDIT RHYTHMS button.

	b. You'll see a dialog box with 8 four-note rhythm patterns. 
	The default patterns are all quarter notes, which is very, 
	very boring.  To change a note value in a rhythm pattern, 
	left-click on the note until you get a value you want; you can 
	also change any note into a rest.  If you want to make a 
	rhythm pattern that is shorter than four notes, click on a 
	note until it changes into the "END" icon; the pattern will 
	only play the notes before it. If you want fewer than 8 rhythm 
	patterns, change the first note in any pattern into the "END" 
	icon; it will be skipped when the tracks are generated.

	c. You can save the set of rhythms by clicking on the SAVE 
	button, and reload them later by clicking on the LOAD button 
	(double-duh).  When you're finished editing rhythms, click on 
	the QUIT button.

	d. Click on the ENTER PITCHES button.

	e. Enter pitches using your MIDI keyboard or controller. 
	Note-entry will automatically end if you enter 12 notes.  If 
	you want to enter fewer than 12 notes in your pitch set, quit 
	by pressing the "Esc" key on the computer.  The pitches are 
	displayed on a piano-style grand staff as you enter them.

4.  Along the left side of the screen are ten Function Buttons that 
create or modify the 4 tracks, which are designated A, B, C and D.  To 
make a Function Button affect the desired track, select the A, B, C or 
D button before clicking the Function Button.  To wit:

	RHYTHM: Randomly fill the designated track with patterns from 
	the EDIT RHYTHMS dialog.
	
	PITCH: Assign pitches from the ENTER PITCHES dialog to the 
	randomly created rhythm track.
	
	COPY FROM/COPY TO: Clone one track to another.
	
	TRANSPOSE: Raise or lower the pitch of a selected track by the 
	value indicated in the "Transpose value" edit field; a 
	negative number lowers pitch.
	
	COMPRESS: Divide the rhythm/duration values in a selected 
	track by the factor in the "Compress ratio" edit field.
	
	EXPAND: Multiply the rhythm/duration values in a selected 
	track by the factor in the "Expand ratio" edit field.
	
	SHIFT: Delay the start of a selected track by the value 
	indicated in the "Shift value" edit field.  A value of "24" 
	equals one beat.  Do the math.
	
	INVERT: Turn the pitch intervals in a selected track upside 
	down.
	
	REVERSE: Reverse the order notes in a track.
	
Whenever you click on a Function Button, you change all the notes in 
the selected track; there is no "Undo" function.

The PLAY button does what it says; select playback tracks using the A, 
B, C and D buttons.

The AUTO-GENERATE button generates all 4 tracks and starts playback 
immediately.  The MIDI FILE button saves the tracks in SMF format.

Neat trick:  Edit rhythms and enter pitches as described above, and 
generate the "A" track by clicking on the RHYTHM and PITCH Function 
Buttons.  Copy track A to tracks B, C and D with the COPY FROM/COPY TO 
function.  Enter a value of "96" in the "Shift value" edit field. 
Select the "B" button next to the SHIFT Function Button, then click 
the SHIFT button.  Select the "C" button next to the SHIFT Function 
Button, then click the SHIFT button TWICE.  Select the "D" button next 
to the SHIFT Function Button, then click the SHIFT button THREE TIMES. 
Now play the four tracks: instant 4-part canon.
