General description

The MIDI generator takes text as input (along with several options), and based on the characteristics of the text (including the number and length of the words, and each individual character), produces a MIDI file. The first thing that is determined is a set of tones which act as a sort of 'key' for the piece. If 'harmony' (described below) is chosen, other tones will also be used.

The options:

octaves: Instruments are assigned to the treble and bass clefs alternately. In a future version, I may try to assign each instrument to an appropriate range, or else allow the user to make each assignment. Some instruments sound painfully shrill if they are played across 3 octaves, so the default is 2, but it can be widened to 3.

tempo: should be self-explanatory.

max phrases: Applies only if 'phrases' (described below) is chosen. Fewer phrases leads to more repetition. Actually, there are always at least two phrases generated, but I consider that a bug, and will change it soon.

phrases/no phrases: If 'no phrases' is chosen, then each pair of characters determines a tone and a duration (1/8th note, 1/4 note, etc). The note is then assigned to an instrument based on another nearby character.
If 'phrases' is chosen, then a certain number of musical 'phrases' (from 6 to 9) are generated as above. Then, each character determines which phrase to add. This gives the piece some more repetition.

rests/no rests: This determines how many pauses there will be in the piece. It is a little buggy right now. I recommend 'rests' (the option may disappear).

harmony/no harmony: This is a bit of a misnomer. If 'no harmony' is checked, then each instrument plays a single tone at a time (multiple instruments may play the same or different tones at the same time). If 'harmony' is checked, then each instrument plays 'chords'. The chord may be degenerate (the same note might be picked twice). In the next version, this will probably be renamed 'chord'.

use 'glass'/no 'glass': This is an experiment in minimalism. If "use 'glass'" is checked, then the phrases are lengthened and shortened throughout the piece. That is, the first two notes are played some number of times, then the first three notes, etc, and when the whole phrase is played, then it starts to shorten again. The effect may not be very noticeable unless you explicitly set 'max phrases' to 1.

stagger/no stagger: This spreads out the instruments a little, by adding rests to the beginning of some of the instruments.

percussion/no percussion: This does nothing at this time. It is included for future expansion. There are musical percussion instruments available, whether or not this is selected.

limit time/don't limit time: This does nothing at this time. All of the pieces are limited to the first 60 characters of the input text (though the characteristics of the entire text are used in the initial setup).

generate tone set/key of C/all 12 tones: This allows you to override the tone selection as described above. 'key of C' isn't really, because of a bug.

shift/no shift: Each phrase (or tone) might be played by more than one instrument at a given time. This causes one instrument to shift a little compared to the other. It gives something of a 'canon' effect.

staves: This is the number of 'voices'. Since instrument names are repeated on the list, it is possible to have the same instrument used more than once. If no instruments are selected, then all of the instruments will be 'acoustic grand piano'. 'Extra' instruments are ignored. This part of the interface seems the most klunky to me, and I will probably change it.

There are 127 predefined instruments available for MIDI files. Each of these instruments is listed in at least 2 of the pulldown menus on the MIDI generator page. I split the lists in relatively arbitrary ways, in order to make the pulldowns a little more manageable, and to slightly reduce the size of the page.

bars: is ignored.

text: is the input text. Several words of text should be sufficient. As mentioned above, the entire text string is used in the setup, but only the first 60 characters are actually used to generate tones.

What is this sound generator?

This MIDI generator is the front end to a Perl script that uses a Perl module called MIDI.pm (available from CPAN.
Here are some links to more information about MIDI. I have not looked at them very carefully: I just grabbed some of the more promising hits from google.

The MIDI Manufacturers Association will probably give you more technical info than you thought you wanted.
Harmony Central MIDI info looks like it has lots of links.

MIDI is a special language used to encode musical performance information. Each MIDI file is a description of music, which has to be interpreted by a (software or hardware) synthesizer. In this way, it is different than a digital recording (an MP3, .wav, or .aif file, for example). A digital recording will sound pretty much the same on whatever machine is used to read the file, as long as the machine is capable of reading the format in question. Two MIDI file interpretations may sound quite different, even if they are just produced by two different programs on the same computer, because the programs may have very different sound libraries to use for the music synthesis. Check out the links above if you want to know more.

There are two reasons I am using MIDI for this project: the resulting files are very small (less than 20 KB, compared to 2 MB for an MP3 file, or 20 MB for an uncompressed digital sound file), and the computation used in generation is very small. Your computer is doing all of the 'grunt work' of actually generating and producing the sounds.

If you are interested in the source code, send me an email. This is still a work in progress, and the code is not really in shape for public display, but I'll be happy to send you what I've got.

talk to me
go home