MIDI Agent System
Introduction
My current music project is the development of software that uses the interaction between different agents to generate MIDI notes. This is designed primarily for live use and it enables the performer to change the parameters of the agents that are generating the music in real time. For example, one agent could generate random bar markings, a second could add sequences of notes to these bars, a third could change the velocities of notes in the bars and a fourth could shift the pitches up or down. Many of the agents have knobs that can be set to respond to MIDI controllers and by varying the parameters of the agents it is possible to have real time control over very complex music. This software is written in Java and should run on any operating system. A screenshot is shown in Figure 1.
Figure 1. MIDI Agent System
Architecture
The software uses a sliding buffer to hold the MIDI notes and messages generated by the agents. At each beat the buffer advances and the agents associated with each track are invoked to make their contribution to the buffer until they have all completed their tasks. The buffer is then advanced and the notes are written to MIDI tracks that are played by the sequencer. The agents themselves are dynamically loaded at runtime and new agents can easily be created by extending the agent class.
Agents
The agents that I have currently implemented are listed in Table 1.
| Agent | Description |
|---|---|
| Bar Marker | Writes agent messages that mark the beginning and end of bars. This agent can generate sequences of bars of different lengths - for example 3/4, 4/4, 2/4 etc. - or random bar lengths. A MIDI controllable knob can be used to vary the maximum bar length. |
| Basic Notes | Generates sequences of notes with different positions and lengths. Can be set to restart its sequence at the beginning of the bar. |
| Note Emphasis | Increases or decreases the velocity of notes at set positions. Can be set to restart at the beginning of the bar. |
| Pitch Shifter | Shifts the pitch of notes up or down by a fixed amount set by a MIDI-controllable knob or continuously increases or decreases the pitch. |
| Prolong Notes | Stores note-off messages when the button is pressed, so that all notes are prolonged until the button is pressed again. |
| Simple Notes | Generates a sequence of notes repeating at a particular frequency and pitch without any control from the Bar Marker agent. |
Table 1. Agents currently in the MIDI Agent System
Instrument Samples
Table 2 contains samples of music generated by the MIDI Agent System, using Reactor 4.0 to create the sounds. Some of the changes in timbre are caused by the modification of parameters in the Reactor instruments. None of these samples has any great musical merit and they are pretty badly mixed, but they at least give some idea about the ability of the system to generate and control music.
| Project File | Reactor 4 File | Description | Sample |
|---|---|---|---|
| Project7 | Project7 | Twisted sines and beats using the prolong notes agent to create collapsing slides. | MP3 |
| Project6 | Project6 | Distorted bongos with the timing relationship between the patterns changed by altering their bar markings. | MP3 |
| Project5 | Project5 | The tune is generated using a number of Basic Notes and Bar Marker agents. The pitch of the four sine waves playing the notes is altered using Reactor. | MP3 |
| Project3 | Project3 | House-inspired sounds with an invasion of killer insects. | MP3 |
Table 2. Samples of instruments with accompanying project and Reactor files
Download
The current version is available here.
