# AI MusiMuse

# 009_AI_COMPOSER.md

Version 1.0

---

# Purpose

The AI Composer is the central intelligence of AI MusiMuse.

Its purpose is not to imitate songs.

Its purpose is to create entirely new compositions that statistically resemble the author's musical language.

The Composer never copies existing tracks.

Instead it learns musical thinking.

---

# Overall Pipeline

```
User Request

↓

Style Model

↓

Idea Composer

↓

Structure Composer

↓

Sound Composer

↓

Renderer

↓

Audio
```

---

# Composer Levels

The Composer consists of three independent stages.

```
Ideas

↓

Structure

↓

Sound
```

Each stage operates at a different abstraction level.

---

# Stage 1

Idea Composer

---

Question

```
What should happen?
```

The Idea Composer creates an abstract musical plan.

Example

```
Atmosphere

↓

Expectation

↓

Growth

↓

Release

↓

Reflection
```

No instruments exist yet.

No notes exist yet.

No tempo exists yet.

Only musical intention.

---

Input

Style Model

Random Seed

User Constraints

---

Output

Idea Graph

---

Idea Node

Each node contains

```
id

type

importance

expected_duration

energy_target

emotion_target
```

---

# Stage 2

Structure Composer

---

Question

```
When should everything happen?
```

The Structure Composer converts ideas into sections.

Example

```
Intro

↓

Development

↓

Break

↓

Theme

↓

Outro
```

---

Input

Idea Graph

Style Model

---

Output

Timeline

Sections

Transitions

Energy Curve

Density Curve

---

# Stage 3

Sound Composer

---

Question

```
How should it sound?
```

Only here musical details appear.

Examples

Harmony

Rhythm

Textures

Pads

Bass

Effects

Leads

Noise

Automation

---

Input

Timeline

MusicDNA Statistics

Style Model

---

Output

Musical Events

---

# Musical Events

Every event contains

```
time

duration

category

parameters
```

Examples

```
PadStart

BassEnter

FilterSweep

HarmonyShift

Silence

FXRise
```

---

# Rendering

The renderer converts musical events into audio.

The renderer is replaceable.

Possible renderers

```
FluidSynth

Kontakt

VST

Diffusion Decoder

Neural Renderer
```

---

# Style Model

The Composer never reads individual songs.

It only receives

```
Style Model
```

The Style Model contains

preferred BPM

preferred durations

preferred harmonic movement

preferred dynamics

preferred transitions

preferred density evolution

preferred structures

---

# Random Seed

Randomness only affects generation.

The same

```
Seed

+

Style

+

Constraints
```

always produces identical music.

---

# User Constraints

The Composer supports constraints.

Examples

```
Length

6 minutes

BPM

72

Energy

Low

Key

Minor

Atmosphere

Dark

Development

Slow
```

Constraints guide generation but never override Style completely.

---

# Creativity

The Composer should balance

```
Style

vs

Novelty
```

Too much Style

↓

Copies existing music

Too much Novelty

↓

Loses author's identity

---

# Internal State

The Composer does not remember generated tracks.

Every generation starts from

Style Model

+

Random Seed

+

User Constraints

---

# Long-Term Memory

Only the analysis database grows.

Generated tracks never modify Style automatically.

Future versions may optionally support incremental learning.

---

# Future AI Models

The Composer architecture is model-independent.

Possible implementations

Transformer

Diffusion

VAE

Hierarchical Transformer

State Space Models

Hybrid Architectures

The surrounding architecture remains unchanged.

---

# Design Principles

The Composer never generates raw audio directly.

The Composer never copies songs.

Ideas precede structure.

Structure precedes sound.

Rendering is isolated.

Generation is deterministic for identical seeds.

Analysis and generation remain independent.

---

# Long-Term Goal

AI MusiMuse should eventually compose music in the same way a human composer works.

First an idea appears.

Then the composition develops.

Then instrumentation emerges.

Only at the final stage does sound become audio.