A procedural, generative music engine with real-time DSP โ synthesized instruments, smart chord progressions, and live parameter control
Project description
๐ธ Engine La Musique
A procedural, generative music engine built entirely in Python. No samples, no WAV files โ every sound is synthesized in real-time using pure DSP.
Engine La Musique simulates a full band with drums, bass, rhythm, lead, pads, and arpeggios across 4 distinct styles โ all driven by smart music theory and a live conductor system.
โจ Features
- 4 Styles: Rock, Pop, EDM, Classical โ each with unique instrument voicings and arrangements
- Generative Music Theory: Automatic chord progressions, scale mapping, and voice leading
- Synthesized Instruments:
- ๐ธ Guitar โ Karplus-Strong string synthesis with strumming, palm mutes, and distortion
- ๐ฅ Drums โ Procedurally synthesized kick, snare, hi-hats, and toms
- ๐น Synth โ Subtractive synthesis for bass, pads, arps, and piano
- Effects Chain: Distortion, Delay, Reverb, Chorus โ all processed in real-time
- Smart Conductor: Manages tension, intensity, chord progressions, and layer activation
- Musical Outro: 3-phase ending with ritardando, cadential progression (IV โ ii โ V7 โ I), and smooth fade
- Live Control: Change style, key, tempo, effects, and layers in real-time via CLI
๐ฆ Installation
From PyPI
pip install EngineLaMusique
From Source
git clone https://github.com/Anish-MutliTalent/EngineLaMusique.git
cd EngineLaMusique
pip install -e .
Requirements
| Package | Required? | Purpose |
|---|---|---|
numpy |
โ Yes | DSP math โ waveform generation, filtering, mixing |
pyaudio |
โ Yes | Real-time audio output via PortAudio |
scipy |
โก Optional | Better guitar cabinet simulation (Butterworth filters). Install with pip install EngineLaMusique[full] |
Note on PyAudio: On some systems, PyAudio requires PortAudio to be installed first.
- Windows:
pip install pyaudiousually works out of the box.- macOS:
brew install portaudio && pip install pyaudio- Linux (Debian/Ubuntu):
sudo apt install portaudio19-dev && pip install pyaudio
๐ Quick Start
As a CLI
EngineLaMusique
Or run directly:
python -m EngineLaMusique.main
This opens an interactive terminal where you type start to begin playing and control the engine with commands.
As a Python Library
from EngineLaMusique import Conductor, AudioEngine
# Configure the conductor
conductor = Conductor()
conductor.apply_style('rock') # rock, pop, edm, classical
conductor.set_param('key', 'A min') # Any key + maj/min
conductor.set_param('bpm', 120)
conductor.set_param('intensity', 80) # 0-100
# Start playing
conductor.start()
engine = AudioEngine(conductor)
engine.start() # Blocks and plays audio
# To trigger an outro (from another thread):
# conductor.trigger_outro()
๐๏ธ CLI Commands
Once the engine is running, control it in real-time:
| Command | Description | Example |
|---|---|---|
start |
Start the engine | start |
outro |
Trigger the 3-phase ending sequence | outro |
style <name> |
Switch style | style classical |
intensity <0-100> |
Set performance intensity | intensity 80 |
bpm <value> |
Set tempo | bpm 140 |
key <Note> [maj/min] |
Change musical key | key G# min |
section <name> |
Switch section: intro, verse, chorus, build, break |
section chorus |
layer <name> <on/off> |
Toggle layers: kick, snare, bass, rhythm, lead, pad, arp, harmony, riser |
layer arp on |
dist <0-100> |
Set distortion % | dist 70 |
delay <0-100> |
Set delay mix % | delay 40 |
reverb <0-100> |
Set reverb mix % | reverb 50 |
chorus <0-100> |
Set chorus mix % | chorus 30 |
sustain <0-100> |
Set note sustain (0=staccato, 100=legato) | sustain 85 |
status |
Show current engine state | status |
quit |
Stop and exit | quit |
๐ต Styles
Each style configures the instrument layers, effects, and voicings differently:
| Style | Instruments | Character |
|---|---|---|
| Rock | Distorted lead guitar, power chord rhythm, full drums | Heavy, driving, aggressive |
| Pop | Clean guitar with chorus, strumming rhythm, full drums | Bright, catchy, polished |
| EDM | Saw/square synth leads, filter sweeps, arpeggios | Electronic, pulsing, energetic |
| Classical | Piano (Mozart-style), string section, woodwinds, cello | Orchestral, dynamic, expressive |
๐ Effects
All effects are implemented as pure Python DSP โ no external plugins:
| Effect | Description |
|---|---|
| Distortion | Multi-stage tube amp simulation with cabinet IR |
| Delay | Analog-style multi-tap delay with filtered feedback |
| Reverb | Large hall reverb with early reflections, comb filters, and allpass diffusers |
| Chorus | 4-voice chorus with independent LFOs per voice |
๏ฟฝ The Outro System
When you type outro, the engine doesn't just stop โ it performs a musically expressive ending:
- Approach โ Gentle slowdown, IV โ ii chord progression, drums and rhythm layers fade out one by one
- Cadence โ Stronger ritardando, V7 โ I perfect authentic cadence (the classic resolution), only harmonic layers remain
- Ring-out โ Deep deceleration, holds the tonic chord, volume fades smoothly to silence
Each style adds its own flavor during the cadence: rock gets a power chord ring with delay, classical gets a string swell, pop gets chorus shimmer, and EDM gets a filter sweep down.
๏ฟฝ๐๏ธ Architecture
EngineLaMusique/
โโโ main.py # CLI interface and command parsing
โโโ conductor.py # The brain โ state, chords, intensity, 3-phase outro
โโโ audio_engine.py # The heart โ renders audio beat-by-beat, mixes layers
โโโ music_theory.py # Scales, keys, chords, progression generator
โโโ instruments/
โ โโโ guitar.py # Karplus-Strong string synthesis
โ โโโ drums.py # Procedural drum synthesis (kick, snare, hihat, tom)
โ โโโ synthesizer.py # Waveform generation, ADSR envelopes, piano synthesis
โโโ effects/
โโโ __init__.py # Distortion, delay, reverb, chorus DSP
| Component | Role |
|---|---|
| Conductor | Decides chords, manages global state (intensity, style, layers), drives the outro sequence |
| AudioEngine | Renders audio beat-by-beat, mixing all active instrument layers per style |
| Instruments | Pure Python DSP โ Karplus-Strong strings, additive/subtractive synthesis, procedural drums |
| Effects | Real-time audio effects โ distortion, delay, reverb, chorus |
๐ค Contributing
Contributions are welcome! Here are some areas that could use help:
- New styles (jazz, funk, ambient, lo-fi...)
- New instruments (brass, flute, organ...)
- WAV/MP3 export (render to file instead of just live playback)
- MIDI support (input/output)
- Performance optimizations (Cython/Numba for the reverb comb filters)
git clone https://github.com/Anish-MutliTalent/EngineLaMusique.git
cd EngineLaMusique
pip install -e ".[full]"
python -m EngineLaMusique.main
๐ License
MIT License โ see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file enginelamusique-0.1.0.tar.gz.
File metadata
- Download URL: enginelamusique-0.1.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
251d11ca8e10788591990ba53466714d98c2fec37fe4bb6ae4cbbd7b64592530
|
|
| MD5 |
24f42f2416dc124ab45e10fcf0a44dd6
|
|
| BLAKE2b-256 |
ff5936064bfa2f3d424f4d1f2e78570e724b948ff060a2bea277162920e4ae96
|
File details
Details for the file enginelamusique-0.1.0-py3-none-any.whl.
File metadata
- Download URL: enginelamusique-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac992dcb2fe9f1d09f945a5b49f0fcd713077fcc24a53e4ecf0e13f8118e18d2
|
|
| MD5 |
02e1cbcbee0266090b222c767ea1705d
|
|
| BLAKE2b-256 |
60e22394d3f4fa9121c87350a90fa219523b2ee38dd51d78e56213d4e5b921d2
|