Molecular Music Generator

Header for project Molecular Music Generator

Generating music using a set of rules

Algorithmic composition is an automated process where given a set of particular inputs, a unique compositions can be created. The algorithm is deterministic, which implies that the same input will always generate the same output.

The Molecular Music Generator (MMG) can be used to generate musical patterns which can in turn be fed to hardware or software instruments as it exports MIDI files.

The algorithm is based on the Molecular Music Box" by Duncan Lockerby. Experimenting with different note lengths, scales or even time signatures can lead to interesting results!

The algorithm

  • Two different note lengths need to be defined, e.g. "4" and "3" (in quarter notes)
  • a scale needs to be defined, e.g. C major (the white keys on a piano), let's say we start on the E note, the list of notes will then contain : E, F, G, A, B, C a pattern length needs to be defined, e.g. 4 bars
  • The algorithm will then function like so (keeping the above definitions in mind):
  • The first note of the scale (E) is played at the length of the first defined note length (4)
  • Each time the duration of the played note has ended, the NEXT note in the scale (F) is played
  • Once the first pattern length has been reached (4 bars), a new pattern will start
  • The previously "recorded" pattern will loop its contents indefinitely while the new patterns are created / played
  • When a newly played note sounds simultaneously with another note from a PREVIOUS pattern, the note length will change (in above example from 4 to 3)
  • This will be the new note length to use for ALL SUBSEQUENT added notes, until another simultaneously played note is found, leading it to switch back to the previous note length (in above example, back to 4)
  • As the pattern is now played over an existing one, it is likely that notes will be played in unison, leading to the switching of note length
  • As more patterns accumulate, a perfectly mathematical pattern of notes are weaving in and out of the notes of the other patterns

Live preview

All generated compositions can be exported as MIDI files, which can be loaded into a DAW / sequencer software or sent to hardware synthesizers.

In order to facilitate quick experimentation, the application also supports live preview. Using a simple synthesized sound, you can audition the qualities of your composition, while being able to make changes on the fly.

Molecular Music Generator in action

MMG can run directly on any modern browser and offers:

  • Offline support
  • Full mobile support
  • Live audio preview
  • Export to MIDI files