Programmatic Elegant Rhythmic Lyrical Architect
PERLA is a collection of music generation algorithms that create original compositions without complex AI models. Born from a passion for automating music composition, PERLA demonstrates that elegant, music-theory-informed algorithms can produce compelling musical results.
StChopiner is PERLA's flagship music generator, featuring an interactive Streamlit interface for real-time music composition. Create Chopin-inspired piano pieces with customizable parameters and instant playback.
# Install dependencies
pip install -r requirements.txt
# Launch the Chopiner web interface
streamlit run StChopiner.pyThe app will open in your browser at http://localhost:8501
- Interactive Web Interface: Real-time parameter adjustment with immediate audio feedback
- Chopin-Inspired Compositions: Generate piano pieces influenced by Romantic-era compositional techniques
- Customizable Parameters: Control tempo, key, complexity, and musical structure
- MIDI Export: Download your generated compositions as MIDI files
- Music Theory-Based: Uses established compositional patterns and harmonic progressions
StChopiner employs music-informed algorithms that:
- Pattern Selection: Chooses from predefined melodic and harmonic patterns inspired by classical composition
- Harmonic Progression: Applies music theory rules to create coherent chord progressions
- Melodic Development: Generates melodies that follow contour principles and scale constraints
- Rhythmic Structure: Implements varied rhythmic patterns for musical interest
- MIDI Synthesis: Converts the algorithmic output into playable MIDI format
PERLA/
├── StChopiner.py # Main Streamlit application for the Chopiner generator
├── FUNCTIONS.py # Core music generation functions
├── PATTERNS.py # Predefined musical patterns and templates
├── StringToMidi.py # Converts pattern strings to MIDI format
├── Trapper.py # Alternative music generation algorithm
├── COMPOSER/ # Additional composition modules
├── intomido/ # MIDI utility functions
└── requirements.txt # Python dependencies
A different algorithmic approach to music generation, offering alternative compositional styles and techniques.
Additional experimental music generation algorithms in the COMPOSER directory.
- Python 3.7+
- Streamlit
- mido (MIDI library)
- Additional dependencies listed in
requirements.txt
streamlit run StChopiner.pyThen use the web interface to:
- Select your desired musical key
- Adjust tempo and complexity
- Click "Generate" to create your composition
- Play back the result directly in the browser
- Download as MIDI file for further editing
from FUNCTIONS import generate_composition
from StringToMidi import convert_to_midi
# Generate a composition
composition = generate_composition(
key='C',
tempo=120,
complexity=0.7
)
# Convert to MIDI
midi_file = convert_to_midi(composition)
midi_file.save('my_composition.mid')This project is open source. Please check the repository for license details.
PERLA started as a personal exploration into algorithmic music composition. The goal was to understand if music could be generated through rule-based systems that encode musical knowledge, rather than learning from datasets. The StChopiner generator represents the culmination of this exploration, demonstrating that algorithmic approaches can produce musically coherent and aesthetically pleasing results.