Classic Computer Magazine Archive START VOL. 3 NO. 10 / MAY 1989



Algorithmic Composing With Tunesmith


A number of MIDI software programs have been designed as replacements for musical equipment or standard operations. Some classic examples are sequencers, patch editors, echo effects and scoring programs. The end result could be achieved by hand if needed; the computer acts mainly to improve ease of use for the operation rather than contributing to the musical process.

An altogether different situation occurs when software approaches are used to produce music or effects that could not be done in any other way. Synthesizing sounds from first principles, remapping MIDI note and controller information in real time and editing sequencer data to create special effects are all instances where the computer is an integral part of the creative process.

Algorithmic composing is one of the best examples of using computers in a musically creative setting. The basic idea involves constructing musical parts according to a set of predefined rules (even picking random pitches still counts as a rule). The algorithms can apply to the actual note selection, music performance or both. The idea is not new to the computer age; selecting notes with respect to star charts was one of John Cage's approaches. Even Mozart wrote a series of short sketches where the order of performance was determined in real time by rolling dice.

The Ghost in the Machine

Enter Tunesmith, a second-generation algorithmic composing program, developed by Jim Johnson, that can assist with both music creation and performance. The original version was part of the Algorithmic Composer program from Dr. T's for the Commodore 64. This program took on legendary proportions after being endorsed enthusiastically by synthesist Jan Hammer, who bought a C64 system just to run the Algorithmic Composer as a front end to his $80,000-plus Fairlight Series III sampler/sequencer.

Tunesmith's main working screen. Parameters that control the
theme and variation generation are at the top. The actual theme
selector box is mid screen on the right. Accompaniment generator
parameters for the six output voices are at the screen bottom.

As good as its predecessor was, Tunesmith surpasses it by both extending the original concepts and adding numerous new features. In its current format, Tunesmith can generate musical themes and derive accompaniments or variations based on your own music or as a performing instrument of sorts. Even better, it can run as a part of Dr. T's multi-program environment (MPE) and seamlessly trade musical parts back and forth with the Keyboard Controlled Sequencer (KCS). I've come to feel quite at home having my ghostly collaborator kick in some ideas when my own muse deserts me.

As is typical for a Dr. T program, Tunesmith uses key disk copy protection. It can be backed up or installed on a hard drive but you must insert the master disk in drive A during the initial load. A real pain, however, is that it locks out your computer if it detects any desk accessories (other than the Control Panel), memory resident programs or RAM disks. This means that you must reboot twice: once to restore the ST and turn off (or delete) the offending programs and a second time to actually load Tunesmith. Standard GEM is bypassed for proprietary screen and mouse routines that run very quickly. Several help screens can be accessed through the Help button, even while the program is pumping out music. The manual is in the new Dr. T format: readable print, clear writing, plenty of illustrations and an index. Good job!

Structured Programming

The core idea of Tunesmith is to generate a single monophonic phrase of music (theme) based on user-specified parameters and develop it, with five derived accompaniment parts, into six-part output music. Along the way, you can control virtually every aspect of the composing and performance processes, either as preprogrammed control sequences or in real time. Many changes are made with the mouse by clicking on some of the myriad onscreen buttons. Other controls come in from the ST keyboard, or optionally via MIDI keyboard input. Provision is made for receiving control MIDI input on a separate channel from that used to play along with the program.

There are five main components in the music generation process: theme generation, theme/variation selection, accompaniment generation, tonality controls and performance controls. A separate module, the arranger, can act as a general overseer and control the other modules through a command sequence.

An initially confusing aspect is that the composing algorithms do not directly generate customary note data. All pitches selected are with respect to a generalized seven-note scale. The actual conversion to real MIDI note data comes when the pitches are processed through the tonality controls.

A Winning Theme

Themes are created with respect to a set of parameters that put boundaries on rhythm and pitch data. Examples of these include the note range, number of notes to generate, maximum distance between consecutive notes, base timing interval and probability of drawing a rest. The user also selects which of six algorithms to use for composing the theme's rhythmic backbone. Descriptions of these algorithms are given to aid your choice. A variation is a spinoff from a theme, based on one each from four rhythm and four pitch variation algorithms.

At any time, Tunesmith can supply five themes with three variations of each. These are indexed in the selector box as TA (Theme A), VB2 (Variation 2 of Theme B), etc., and chosen by clicking on the name. Themes and variations are computed on the fly, when selected for the first time, from the current parameter values. Clicking on a name with the right mouse button erases any existing phrase and generates a new theme or variation in its place. Parameter changes only take effect when a new theme or variation is selected and do not affect music in progress. Current parameter settings may be memorized as a preset. Up to 26 presets may be kept in memory and recalled at any time with a click of the mouse--that's right, also in real time. Presets may be saved or loaded as independent disk files.

One Gets You Five

The accompaniment generator section of the program takes the current theme and comes up with five accompanying voices. This works with respect to a set of accompaniment parameters, analogous to the theme parameters for theme generation. Unlike their theme counterparts, accompaniment parameter changes take effect immediately. Each voice has an independent set of parameters to specify the rhythm and harmony algorithms used to create it. The entire parameter set may be stored to one of 26 accompaniment presets and recalled at any time. These presets can be saved or loaded as disk files.

Twelve rhythm and 16 harmony algorithms are available. Harmony algorithms are subdivided into 11 for musical voices (e.g.: synths, samplers) and five for drum parts. Each algorithm is described along with a music transcription example in the manual. Some of the more interesting harmony styles are contrary motion, parallel movement and different types of arpeggiation. Individual voice rhythms can be further modulated with a divide parameter that specifies what fraction of notes are to be played. On the harmony side each voice can be independently transposed up or down.

Drums are handled somewhat differently, as drum sounds are locked into specific MIDI note assignments. Their voice parts need to be kept stable with respect to final MIDI note output while other standard synth parts are free to transpose and modulate up and down the keyboards. This is done by drawing drum notes from a set of drum tables that can be tailored for each user's drum machine or equivalent. Once set up, these tables can be saved and loaded as disk files.

Performance Controls

These settings add in various MIDI control information to the six output voices: MIDI channel, program number, octave, velocity, mute/unmute, articulation algorithm and delay time. Actually, these are considered by Tunesmith to be part of the accompaniment parameters and are saved, loaded and changed like the others. I found it conceptually easier to separate them out from the program actions that create the additional voices.

Tunesmith handles velocity in a limited fashion. Notes can be at a base velocity or have an accent velocity value added or subtracted from the base value. The theme generator determines which of the three velocity levels a note will have. While individual voices can be changed separately, the ST keypad cursor arrows act as master controls for all voices and do real-time fade-in and fade-out effects. Taking the idea an extra step, particular voices can be exempted from the master fader controls. There are lots of possibilities here.

Typical dialog box for editing one of the 46 available scales used
by Tunesmith to convert internal note representations to actual
output MIDI data. Each scale holds 10 octaves of seven pitches
each. The example shown is for the default harmonic major scale.

The articulation algorithms, eight of them, determine individual note lengths (e.g.: staccato, legato and all in between). Individual voices can be turned on or off by muting or soloing them. A MIDI channel reassign map can be activated from the main program menu that reroutes the MIDI channel number shown in the accompaniment parameter box to any desired destination channel. This is useful if you change your MIDI configuration and don't want to edit all the accompaniment presets to reflect the changes--a very thoughtful feature.

Setting the Tone

And now for the musical nuts and bolts, how does Tunesmith translate its insulated mathematical perambulations into actual notes? The answer is through the tonality controls: scale, mode, key and octave. Each of these controls can be changed while Tunesmith is playing or programmed to change at specific times with the arranger module.

A scale is a series of 70 defined pitches (or, more properly, pitch intervals) running the gauntlet from the bottom to the top of a keyboard. More specifically, these pitches are broken into 10 octaves, each with seven pitches. Tunesmith can draw on any of 46 scales and comes with 38 predefined that represent all possible normal scales. These start with familiar classics like the major and minor, then lead off into the unknown. Some seem to have a certain ethnic tinge associated with them and are correspondingly named--Oriental, Persian, etc. For the experimentally inclined, all 46 of the scales can be changed at will and saved.

Mode refers to which of the seven possible notes in an octave that the scale should start from. Within a given scale, a modal change can have a pronounced effect on the flavor of the music. Key is the root note of the chosen scale. Keeping to a major scale and changing the key through C, F and G would let Tunesmith come up with its own version of "Louie, Louie". Octave is a transposition factor that affects all of Tunesmith's output voices at once.

Putting it All Together

Until now we have looked at the process Tunesmith uses to create music and ways to interact with it in real-time--essentially playing it like a computer musical instrument. An alternative approach is to set up a list of presets, tonality controls and the times to change them in a master control file, the arranger. This is just like invoking a control sequence from Dr. T's KCS. Starting the arranger lets it drive Tunesmith, making whatever changes you programmed at the proper times. This gives you a way to build large song sequences from the smaller themes and variations.

The control list can be spelled out before starting to play or it can record your actions and create a matching control list. The latter is similar to having a spreadsheet learn a macro by recording your actions. Needless to say, just because you use the arranger doesn't mean you are locked into it. You have the ability to force it into looping while you break into a spontaneous solo, prevent it from making particular parameter changes or change any of the programmed steps on the fly.

Odds, Ends and Other Goodies

Tunesmith provides a number of other features and creature comforts designed to make composing fun and easy. Files can be saved in Dr. T format and used as input to the KCS. Other sequencer users can use a Dr. T to MIDI file conversion program available at better MIDI bulletin boards everywhere or from Dr. T directly. A notepad screen can be called up to jot notes during your playing session or to document those all important preset, scale or drum files. Several predefined MIDI control messages (all notes off, local control, omni status, poly/mono) can be sent to any or all MIDI channels with a single mouse click. A variety of global options can be set: internal clock rate, default disk drive, ST keyboard debounce time, support MIDI merge (no rechannelization), metronome, etc.


I strongly recommend this program. An excellent example of a musical application that can only be realized through software, it succeeds on several fronts: it's musically interesting, educational and fun. After even just a little time with Tunesmith, you also realize it was crafted by a musician who uses it extensively. Sure, it can be intimidating with the screens full of numbers, but despite all its power, it's still very simple to use and start making music. On the flip side, its sheer depth guarantees that even confirmed techno-weenies will be kept busy for a long time before exhausting its potential.

I have long respected programmer Jim Johnson's coding and writing abilities. After working with the many facets of Tunesmith, I'm now equally impressed with his organizational skills--how did he ever keep track of everything that went into it?

START Contributing Editor Jim Pierson-Perry is a semi-professional musician and research chemist who lives in Elkton, MD.


Tunesmith version 1.05, $149. Dr. T's Music Software 220 Boylston Street, Suite 306, Chestnut Hill, MA 02167, (617) 244-6954.