mcp_opendaw_create_l_system_melody
Create deterministic, self-similar melodies by applying L-system production rules. Use presets or custom axioms for algorithmic fractal music.
Instructions
Create a melody using an L-system (Lindenmayer system) — a deterministic rewriting system.
L-systems generate self-similar, fractal patterns through recursive production rules. Each symbol in the expanded string maps to a scale step interval. The cumulative sum of intervals determines the melodic contour.
Unlike Markov chains (stochastic, memory-based) or random walk (zero-order), L-systems are fully deterministic — same axiom + rules + iterations always produce the same melody. This makes them ideal for:
Self-similar melodic structures (fractal music)
Deterministic generative composition
Algorithmic music based on mathematical systems
Presets: fibonacci — Fibonacci word (A->AB, B->A), golden ratio self-similarity cantor — Cantor set (A->ABA, B->BBB), gaps and self-similar structure dragon — Dragon curve (A->A+B, B->A-B), jagged contour koch — Koch snowflake (A->A+A-A-A+A), angular melody sierpinski — Sierpinski triangle (A->BA, B->BA), binary pattern
Custom: provide axiom, rules (JSON), and symbol_map (JSON) to define your own L-system.
Args: root: Root note name (C, C#, D, ...). scale: Scale name (major, minor, dorian, phrygian, lydian, mixolydian, harmonic_minor, melodic_minor, pentatonic_major, pentatonic_minor, blues). bars: Number of bars (1-32). octave: Starting MIDI octave (1-6). preset: Preset name (fibonacci, cantor, dragon, koch, sierpinski). axiom: Custom axiom string (overrides preset). rules: Custom rules as JSON {"A": "AB", "B": "A"}. symbol_map: Custom symbol-to-interval map as JSON {"A": 1, "B": -1}. iterations: Number of rule applications (1-8). Higher = more complex. duration: Note duration in beats (0.0625-4.0). velocity: Base velocity 0-1. rest_symbol: Symbol that produces a rest (skip note, advance position). unit_index: AU index. track_index: Note track index. start_beat: Starting beat position.
Returns notes created, L-system string length, and fractal statistics.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bars | No | ||
| root | No | C | |
| axiom | No | ||
| rules | No | ||
| scale | No | minor | |
| octave | No | ||
| preset | No | fibonacci | |
| duration | No | ||
| velocity | No | ||
| iterations | No | ||
| start_beat | No | ||
| symbol_map | No | ||
| unit_index | No | ||
| rest_symbol | No | ||
| track_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |