New Intentional Music engine

Intentional Music Banner

Engine Overview

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

  1. Load configuration – SongLoader deserializes JSON into a Song object (name, duration, tempo, scales, chord progressions, tracks, seed, etc.).
  2. Initialize generator – Program builds a GenerativeEngine, passing the song and timing information (ticks per second derived from tempo and time division).
  3. Generative logic – GenerativeEngine 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"
}
  • BaseNote / KeySignature / Tempo / Duration – Global musical context. Duration is in seconds; tempo feeds the ticks-per-second conversion.
  • ChordProgressions – Ordered sets of roman-numeral chords that drive the harmonic timeline. The engine interpolates through these sequences so tracks emphasize appropriate tones.
  • Scales – Pools of intervals the generator can draw from. Multiple scales let a song shift flavor (e.g., natural vs harmonic minor) while staying in key.
  • Tracks – Each entry describes a performance layer. Parameters such as octave, offset, and period define the register, melodic movement frequency, and rhythmic spacing. inPosition/outPosition (seconds) gate when the track plays, and affluence affects density and velocity. Optional chord arrays bias the track toward specific chord tones when the progression calls for them.
  • Seed – Seeding the pseudo-random generator ensures deterministic results; change it to explore new variations without altering structure.
  • Algorithm – Currently D tells the engine to use its chord-aware generative routine.

Make your own “Intentional Music”

Intentional Music Editor Tool

Leave a Reply