Skip to content
Thomas E. Janzen edited this page Feb 3, 2022 · 5 revisions

Welcome to the TextMIDITools wiki! TextMIDITools is a reworking of tools previously developed by Thomas Janzen. Previously, some of these tools for MIDI (Musical Instrument Digital Interface, esp standard 1.1) had been developed for the Commodore Amiga computer around 1989 to 1993. These include:

  1. AlgoRhythms for the Amiga, rewritten as testmidicgm (textmidi Computer-Generated Music)
  2. smusmidi for the Amiga, which converted Electronic Arts Simple Musical Score (SMUS) files to MIDI binary has been rewritten as smustextmidi, which converts SMUS files to textmidi text language for MIDI, which textmidi can then convert into MIDI standard file format (MIDI 1.1)

Later in 1999 I wrote textmidi, and in 2003, miditext.

  1. textmidi, written about 1990 for linux and improved in 2003 and more recently, converts textmidi language into standard MIDI file format.
  2. miditext, written about 2003 for linux which converts standard MIDI files into textmidi.

In 2021, I wrote the python scripts for textmidiformedit, to make it easier to develop form files for textmidicgm.

ADDITIONAL HISTORY The idea of modulating musical parameters such as pitch range, rhythm duration, loudness etc. with sinusoidal curves may have been proffered by others in the late 1960's, but I conceived it in 1976 after learning about Iannis Xenakis' use of a Gaussian density distribution to guide his work Akrata (if memory serves). In 1976 I watched Leonard Bernsteins' "The Unanswered Question" on television: A quote in the first lecture is "How many of you can listen to forty minutes of a Hindu raga with intelligent comprehension,..." (page 10 in the tenth printing of the book); my reaction was to ask similar questions about a concert audience fully comprehending a Bach fugue or Arnold Schoenberg's fourth string quartet just from hearing them. (I later decided that concert audiences comprise a variety of people, including many with some professional musical preparation.) My answer to those questions was, maybe all those literate contrapuntal techniques don't really affect the effect of the music overall. The radical reduction is, the specific notes and rhythms don't matter, the general character of music matters; this is the position taken by textmidicgm. In 1976 I drew a plot for a new piano piece, and in the spring of 1977 redrew it and wrote the serial and dissonant piano work "Animations" based on it as part of course work in a course called "Composition in Large Forms" in college. "Animations" used a (compromised) serial technique precisely because I did not put importance on the particular notes and motifs. Later in 1982 I wrote a more anodyne piano work in a pentatonic scale also using sinusoidal curves called "Lucy's Dance". "Animations" and "Lucy's Dance" were manually composed. Also in 1979 I wrote a music program for the Radio Shack TRS-80 that could play the notes specified or make white-random pitches and durations, but with no particular guidance.

I acquired a Commodore Amiga in March 1988, and after entering all of my conventionally-notated compositions in Deluxe Music Construction Set, I began to develop "AlgoRhythms", which is described in the paper listed below. AlgoRhythms was a real-time interactive program for random music-making, using sinusoidal curves (on pitch, duration, loudness, and complement) to slowly change the character of the music. This program was distributed as open-source primarily on "Fred Fish" disks or disk images for the Amiga running AmigaDOS. The version here on github is not interactive, is a rewrite, and does not generate MIDI files, but textmidi files instead; these can be converted to MIDI files using the textmidi utility. In short, AlgoRhythms and its rewrite, textmidicgm, compose music the way I would have composed music had I continued composing past 1987. The musical style for the approach taken by AlgoRhythms and textmidicgm is characterized by 2 features: I. Sinusoidal modulation of the mean value and range of pitch, dynamic, rhythmic duration, and the number of instruments (the complement). II. Using white (evenly-distributed) random numbers to select a particular pitch (MIDI key), rhythm duration, and dynamic (MIDI velocity) for each note event. III. A global scale and a global range of rhythmic duration.

Notes:

  1. Either the pitches (MIDI key numbers) are selected from white random distributions over the scale indices, or they walk randomly up and down;
  2. Dynamics (loudness, or MIDI velocity) and rhythmic duration are over a white-random ("evenly-distributed") range. The range of notes is bounded first by the scale, then by high and low notes for each "instrument". The rhythms, when not pulsed, have a fluid, conversational flow; this kind of rhythm interested me in the 1970's.
  3. Texture (or complement, i.e., the number of instruments playing) rises and falls with a sinusoid.

The result is meant to produce music with:

  1. no meter
  2. no harmony
  3. no motifs or melody

NOTE: The reference to a sinusoid (which ordinarily varies from -1 to 1) is to a shifted and scaled sinusoid that varies from 0 to 1.

There are a few convenience features that were easily applied to this model of music-making, and can profoundly change the results:

  1. Pulse: the note starts and stops can be coerced to fall on a "snap" (cf. graphics) or "grid"; textmidicgm has no sense of "meter", i.e., the grouping of pulses by heirarchical accenting. The music sounds more dance-like and is easier to generate a performance score from because the rhythms line up on a 1/16 note or whatever pulse is chosen.
  2. Scale: choosing a particular scale, such as a pretty pentatonic scale or diatonic scale, can have a "windchimes effect", in which almost anything played is pretty to listen to.
  3. The pan position of an instrument can be specified at the form-development phase;
  4. Voices can have High and Low notes, which bound their range so that they can imitate instruments.
  5. Voices may be assigned to MIDI programs, so select particular instrumental sounds;
  6. The overall minimum and maximum note length can be specified to force faster or slower movement overall; that is, the random durations are selected within the range from min note length to max note length;
  7. Walking: voices may walk randomly up and down the scale, rather than jump around with evenly-distributed numbers;
  8. textmidicgm permits specifying a voice as a follower of another voice, by an interval that is selected to be either a scaler interval (in the scale provided) or chromatic (always a fixed interval even if outside the scale notes result). The following feature was written to be very robust. If all the voices follow one another, no music will be written. Some voice has to lead to get note events composed for it and its followers. Following voices need not be higher-numbered voices than leaders.
  9. Track Scrambling: The priorities of the "tuples" of voice+track and be scrambled for the purposes of the texture curve selecting the top priority voices to "play". This does not alter the voice following assignments. The texture curve (or complement, that is, what part of an ensemble is playing) selects the top priority track/voices to play at any given time. If the texture curve is very narrow or thin, only one voice plays. Scrambling the track/voices' priority can change what tracks will be selected by the texture curve. The basic example use case is that if the trackscramblingperiod is equal to the texture period, then each time the texture curve is thin, then a different instrument will play the solo. The algorithms for track scrambling are largely based on C++ library algorithms on containers: for example, reverse, random_shuffle, rotate (left or right), but also pair swap and so on. These are options for textmidicgm, so see those info files.

PHILOSOPHY

The technique of textmidicgm is based on the following ideas:

  1. We overestimate the importance and effectiveness of a composer consciously selecting "the next note";
  2. Random music-making has not been sufficiently investigated since LeJaren Hiller patented Markov Chains for melodies in 1948 (or since Mozart's musical game);
  3. I like the output of textmidicgm; I enjoy the resulting music, at least some of it;
  4. Although I have tried and failed to get textmidicgm or its predecessor to make something like a Bach cantata, I have tried and succeeded in producing a credible piano concerto movement that was at least diverting for its duration; textmidicgm is not a stylistic imitator - it is its own medium.
  5. Using sinusoids to gradually change the character of the music with asynchronous curves that recombine values in different ways during a work of music, makes music that is at least as diverting and interesting as some carefully composed music.

I became interested in using sinusoids to control musical character partly due to Xenakis' Akrata, but also because I had found the expositions of "sonata form" in music theory textbooks essentially deceptively meaningless, that is, sonata form is easy to explain but there are no pieces that use it in the way described (taking the rigid view). At the very least, textbook sonata form is not a useful prescription for what music to write in 1976 when I was thinking it over.

SMUSMIDI In 1993, I became concerned that I had saved all of my own compositions from Deluxe Music Construction Set in a proprietary format, so I made sure to save them also as SMUS files, an open format, and then wrote smusmidi to convert them to MIDI file format. However, Deluxe Music Construction Set for the Amiga was an impressive program for productivity; by alternating mouse moves and hot keys I could enter my old scores very, very quickly.

textmidi was used to type in the Quintet for piano and strings by Robert Schumann; the resulting MIDI file was submitted (with breath-control removed as requested) to the Classical MIDI Archive (now just the Classical Archive). The original smusmidi was ported from AmigaDOS to linux in about 2003 to aid an academic project with their old SMUS files, which they intended to perform once they could convert the files into MIDI and use a scoring program to generate parts for performance. The new program smustextmidi is a heavy rewrite.

DOCUMENTATION The info files for the four programs are in the source code area here as PDFs; you are welcome to download them.

A bibliography for the programs is inserted below (and is from the pdf documentation for TextMIDITools) without the more general references:

• The Complete MIDI 1.0 Detailed Specification. Document version 96.1. Second edition. 1995. Los Angeles. The MIDI Manufacturers Association.

• “AlgoRhythms: Real-Time Algorithmic Composition for a Microcomputer.” (1992) Thomas E. Janzen. Readings in Computer-Generated Music. Denis Baggi, ed. p. 199. 11pp. IEEE Computer Society Press. Los Alamitos, CA.

• AlgoRhythms Version 1.0. 1990. Thomas E. Janzen. Fish disk 356. Fred Fish. Mentioned in Amazing Computing/Amiga Sep. 1990 p. 95.

• AlgoRhythms Version 2.0. 1992. Thomas E. Janzen. Fish disk 606. Fred Fish.

• AlgoRhythms Version 3.1 1996. Thomas E. Janzen. AMINET 12. (DVD). Schatztruhe. Stefan Ossowskis Schatztruhe. Gesellschaft fur Software mbH. eronikastr. 33 D-45131 Essen Germany. GTI GmbH. Zimmersmuhlenweg 73 D-61440 Oberursel Germany.

• SMUS.H; Definitions for Simple MUSical score. Jerry Morrison, Steve Hayes. 1986. Amiga header file for C and C++. Commodore.

• The March Meeting. Bits and Bytes. April 1991. WCAUG: Worcester County Amiga Users group. A review of Thomas Janzen’s presentation of AlgoRhythms for the Amiga Computer.

• Be Bach in a Moment. Music Making for the Non-Musician. Michael Hanish. AMIGA World. April, 1992. IDG Communications.

• SMUSMIDI 1.0. Thomas E. Janzen. Fish disk 537. Fred Fish.

• SMUSMidi 1.0 1996. Thomas E. Janzen. AMINET 12. (DVD). Schatztruhe. Stefan Ossowskis Schatztruhe. Gesellschaft fur Software mbH. Veronikastr. 33 D-45131 Essen Germany. GTI GmbH. Zimmersmuhlenweg 73 D-61440 Oberursel Germany.

• “SMUS IFF Simple Musical Score.” Hyperion Entertainment and contributors. ( https://wiki.amigaos.net/wiki/SMUS_IFF_Simple_Musical_Score)

Clone this wiki locally