How gautham2529/musicforge works
MusicForge is a procedural music-generation engine. The principal workflow starts in main.py, which creates a Song; Song.generate() builds harmony, melody, bass, and preview drum patterns, while Song.export() uses the arrangement to place section-specific drums and eligible melody or bass before saving MIDI. The graph also preserves documented theory, arranger, effects, and AI capabilities. Effects and AI are described as under development; their runtime wiring is not established by the excerpts, so no connections are asserted for them.
Main entry points: song.py Song coordinator · main.py CLI entry · melody.py Melody generator · bass.py Bass generator
Components 22
Song workflow
- CLI entry
main.py - Song coordinator
song.py
Music theory
- Scale generator
harmony/scales.py - Chord generator
harmony/chords.py - Progression generator
harmony/progression.py
Music generation
- Melody generator
melody/melody.py - Motif library
melody/motifs.py - Arpeggiator
melody/arp.py - Bass generator
bass/bass.py - Groove patterns
bass/groove.py - Drum generators
drums - Drum pattern library
drums/patterns.py
Arrangement and export
- Song structure
arranger/structure.py - Section definitions
arranger - MIDI exporter
midi_export.py
Optional extensions
- Velocity effects
effects/velocity.py - Humanization
effects/humanize.py - Swing engine
effects/swing.py - AI composer
ai/generator.py - AI trainer
ai/trainer.py
Other components
- User
- MIDI-compatible DAW
Connections 15
- User → CLI entry: runs
README.md - CLI entry → Song coordinator: creates
main.py - Song coordinator → Scale generator: generates scale
song.py - Song coordinator → Chord generator: generates chords
song.py - Song coordinator → Progression generator: generates progression
song.py - Song coordinator → Melody generator: generates melody
song.py - Song coordinator → Bass generator: generates bass
song.py - Song coordinator → Drum generators: generates patterns
song.py - Melody generator → Motif library: uses
melody/melody.py - Bass generator → Groove patterns: initializes
bass/bass.py - Drum generators → Drum pattern library: selects patterns
drums/snare.py - Song coordinator → Song structure: creates
song.py - Song structure → Section definitions: instantiates sections
arranger/structure.py - Song coordinator → MIDI exporter: adds tracks and saves
song.py - MIDI exporter → MIDI-compatible DAW: imports MIDI
README.md