Skip to content
Go back
New Intentional Music engine

New Intentional Music engine

By Michael Earls

Edit page

Engine Overview

MUSE loads song descriptions from JSON and turns them into MIDI compositions. The core flow looks like this:

  1. Load configurationSongLoader deserializes JSON into a Song object (name, duration, tempo, scales, chord progressions, tracks, seed, etc.).
  2. Initialize generatorProgram builds a GenerativeEngine, passing the song and timing information (ticks per second derived from tempo and time division).
  3. Generative logicGenerativeEngine creates one TrackChunk per configured track. It walks the song timeline in seconds, derives active chords from the progression list, and uses a deterministic pseudo-random generator seeded with Song.Seed so that runs are repeatable.
  4. Note rendering – Each note is produced through the MidiExtensions.InsertNote helper. This converts seconds to MIDI ticks and writes Note On/Off events with channel, velocity, and duration.
  5. Metadata – Tempo (SetTempoEvent) and key signature events are written to a meta track so downstream DAWs understand the musical context.

Configuration Anatomy (song_f_minor.json)

{
  "Name": "Nocturne of Shadows",
  "BaseNote": 41,
  "KeySignature": "F Minor",
  "Tempo": 68,
  "Duration": 420,
  "ChordProgressions": [
    {
      "name": "Gathering Gloom",
      "sequence": [ "i", "iv", "i", "VI", "iv", "ii°", "v", "i" ]
    },
    {
      "name": "Midnight Climax",
      "sequence": [ "i", "ii°", "v", "VI", "iv", "ii°", "v", "i" ]
    },
    {
      "name": "Dawn Release",
      "sequence": [ "iv", "VI", "iii", "VII", "i", "iv", "V", "i" ]
    }
  ],
  "Scales": [
    { "name": "F Natural Minor",   "intervals": [ 0, 2, 3, 5, 7, 8, 10 ] },
    { "name": "F Harmonic Minor",  "intervals": [ 0, 2, 3, 5, 7, 8, 11 ] },
    { "name": "F Phrygian",        "intervals": [ 0, 1, 3, 5, 7, 8, 10 ] }
  ],
  "Tracks": [
    {
      "name": "Fog Drone",
      "octave": -1,
      "offset": -3,
      "period": 30,
      "inPosition": 0,
      "outPosition": 240,
      "affluence": 2,
      "chord": [ 0, 2, 5 ]
    },
    {
      "name": "Pulse Undercurrent",
      "octave": 0,
      "offset": -1,
      "period": 12,
      "inPosition": 60,
      "outPosition": 300,
      "affluence": 4,
      "chord": [ 0, 3, 6 ]
    },
    {
      "name": "Embers Fade",
      "octave": 1,
      "offset": 0,
      "period": 20,
      "inPosition": 300,
      "outPosition": 420,
      "affluence": 3,
      "chord": [ 0, 2, 5 ]
    }
  ],
  "Seed": [ 6, 1, 4, 9, 2, 7, 3, 5 ],
  "Algorithm": "D"
}

Make your own “Intentional Music”

Intentional Music Editor Tool


Edit page
Share this post on:

Next Post
Building a Weather Display on the PyPortal Titano