Cellular Automata Music in Basic

FreeBasic source:

CApieces.bas: one-dimensional CA midi ensemble (bass, cello and two wind)

Though many state diagrams of the elementary one-dimensional (k=2, r=1.5) cellular automata look rather dull, judicious sampling will reveal their substantial sonic potential.
The particular real time CA-to-midi mapping applied here, is straightforward and intuitive, generating a remarkable range of sturdy rhythms and bouncing motifs from these quietly swopping cells.

Hear The Ensemble windin' its way through a ten-minute long random rule jam. (midi-file, 18 kB zipped)

screenshot

Keys for CApieces.exe (win32):

 

The actual pieces are determined by:

  1. One of 65535 transition rules, try for instance
    18e, 26e sparse triangles, 18r, 73e lounge, 83e march, 60e, 90e polyrhythmic triangles, 105e, 107e favourites, 110e dirges, 193e skin food, 150e, 225e hors catégorie, 167e fat triangles, 9r, 24r, 27r, 130r second order bounces.
    See the complete set of 256 elementary cellular automata, and some second order generalizations.
  2. The initial cell activations. For one rule, different starting states will often lead to different cycles.
  3. The grid size or CA modulus. Even sizes generally favour short repeating motifs (small periods), while odd and prime sizes in particular allow for endless chains of continuously shifting variations.
  4. The column-to-instrument mapping. To vary the rhythmic pattern, you can change both the horizontal position of the grid and the distance between the four voices. Note that the melodies shift accordingly.
  5. The modal scale: press a function key to transpose into another mode, then shuffle the scale to tune up the CA.
  6. The speed.

You can save up to 1000 CA pieces from one session, imaginatively called "piece001.par" to "piece999.par". A few master samples have been included.

 

QBasic source:

CAsounds.bas: continuous-valued CA model of a complex vibrating string (one for each channel).

This program feeds a continuous-valued cellular automaton with sound waves and dumps the updates in a standard .wav file. What happens if a single string must bear the weight of a full chord? The CA being second order accurate only, tremulous little tinkling tones soon ripple the initial signal.
This one was real fun to write. Besides the CA kernel, it contains a barebones three-operator FM-synthesizer and a routine for making diatonic chords. It can mindlessly churn out an endless dominant progression, as well as produce totally insane random noise.

Keys for CAsounds.exe (win32):

 

Node   more CA stuff

 

This work is licensed under a Creative Commons License.

Valid xhtml 1.0! css valide! cc.license SourceForge.net logo Copyright © april 2006 by Sjoerd J. Schaper