The PsyBox
psybox?
The psybox is an algorithmic trance music genrator enclosed in a box and equipped with 5 slide potentiometer controls. The Psybox outputs random and non-random midi messages as a serial stream over USB which can then be routed to various synthesizers.
Algorithmic trance music?
Part of the so called trance-inducing nature in trance music can be attributed not only to repetition, but to adherence to a relatively consistent compositional formula. This affords listeners a sense of expectancy. It also means that musical complexity must be found in the sounds and textures, as opposed to tonal composition. The psybox allows the user to focus entirely on automation of synthesis parameters, leaving the tonal composition and sequencing to be handled by a generative, rule based system.
Implementation
The psybox consists of one arduino deicimilla microprocessor, 5 slide potentiometers, and a box. All midi data is generated by the arduino firmware. The potentiometers are connected to the board as analog input devices. Random numbers are generated using noise on an empty analog pin as a pseudo-random seed.
The Algorithm
This generative ensemble consists of 4 different instruments, each implementing a different logic, but all syncronized to a common sequencer. Trance music is based on a 16 note feel, so 1 tick of the sequencer was used to represent 1 16th note. Measures were implemented as arrays of 16 note values.
- The kick:
We'll start with the obligatory 4/4 kick. This is just a midi noteon note 35 on ch 10 every quarter note (that's every 4 ticks). Every turnaround, the kick pattern switches to a random selection out of 5 predefined "turnaround" patterns. There are two sets of turnaround patterns, one set for the small turnarounds, and one for the bigger turnarounds.
- Percussion:
Other percussion has been determined by a series random binary decisions on a series of booleans that if true allow that particular percussion line to play. For example, if the isOH boolean is taken as true, an open hihat will play on every upbeat, if the isSN boolean is taken as true, a snare will play on every other downbeat, and if the CLOSEDHAT boolean is taken as true, a closed hihat will play every 16th note.
- The bass:
Basslines are based upon rhythmic variations on a pedal bass D2 (midi note 38). This sends a note on 38 message on channel 1 on every tick that isnt a quarter note. This would give a really boring bassline, so we use the velocity value for rhythm. Another array was used to store velocity values for the measure. At each tick of the measure, a random number is generated between 0 and 3. If 0 is generated, then that cell in the array will receive a velocity of 0. if 0 is not generated, then that cell will receive a velocity randomly selected between 60 and 127.
- The lead:
Leads lines are determined by 16 tick arrays consisting of a combination of 4 notes. An initial random seed selects one of a series of scales (natural minor, harmonic minor, minor pentatonic), each of which be specified by an array of midi note values. Once a scale is chosen, 4 note values are randomly selected from that scale to be used as the notes to be played. Another random seed is used to select a multiplier from the set of {1, 2, or 4}. A series is then be generated in which each chosen note is repeated as many times as the multiplier suggests, for example, with the notes {A, D, G, C} and a multiplier of 1 the series is ADGCADGCADGCADGC..., with a multiplier of 2 AADDGGCCAADDGGCC..., and a multiplier of 4 AAAADDDDGGGGCCCC.... The first 16 notes of this series loop as the melody until a new melody is generated. Velocity values are generated by the same method described in the previous section.
- Overall structure:
Each generated groove plays 7 times in entirety. On the 8th measure the lead continues to play, the bass and percussion do not play, and the kick plays one of the small turnaround patterns. The same groove plays again 7 times, and on the 16th measure only the lead plays along with the big turnaround kick pattern. The program then starts over, and a new groove is generated before the next measure.
- Sampler:
Channel 3 of the psybox is implemented as a sort of random sampler channel. It outputs a random number between 35 and 40 as a note on on midi channel 3. For portability purposes, this functionality has not been supported in the current synthesis patch.
The synthesis
-
The psybox is compatible with any system with the ability to parse midi messages from a serial stream. The software implements default general midi program change messages, but can be used with any synthesizer. The current version implements synthesis in pure data.
- Kick:
The kick is synthesized from a single sine wave oscillator with a frequency envelope that drops sharply from a high to a low frequency, and more slowly to a lower frequency.
-
Percussion:
The hats and snare are just filtered white noise with an amplitude envelope. The sounds then pass through an automatable band pass filter.
-
Bass:
The bass is synthesized using simple fm synthesis. The amplitude of the modulation signal is automatable.
-
Lead:
The lead is synthesized using a similar fm synthesis algorithm to the bass, with the inclusion of 2 oscillators multiplied by the modulator signal for lfo effects.
Hardware