Skip to content

MarioPaerle/PERLA

Repository files navigation

🎹 PERLA - Algorithmic Music Generation

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.

Featured: StChopiner Generator

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.

🚀 Quick Start

# Install dependencies
pip install -r requirements.txt

# Launch the Chopiner web interface
streamlit run StChopiner.py

The app will open in your browser at http://localhost:8501

An Example generated by StChopiner

Your browser does not support the audio element.

Features

  • 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

How It Works

StChopiner employs music-informed algorithms that:

  1. Pattern Selection: Chooses from predefined melodic and harmonic patterns inspired by classical composition
  2. Harmonic Progression: Applies music theory rules to create coherent chord progressions
  3. Melodic Development: Generates melodies that follow contour principles and scale constraints
  4. Rhythmic Structure: Implements varied rhythmic patterns for musical interest
  5. MIDI Synthesis: Converts the algorithmic output into playable MIDI format

Project Structure

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

🎹 Other Generators

Trapper

A different algorithmic approach to music generation, offering alternative compositional styles and techniques.

COMPOSER Suite

Additional experimental music generation algorithms in the COMPOSER directory.

🛠Requirements

  • Python 3.7+
  • Streamlit
  • mido (MIDI library)
  • Additional dependencies listed in requirements.txt

Usage Examples

Basic StChopiner Usage

streamlit run StChopiner.py

Then use the web interface to:

  1. Select your desired musical key
  2. Adjust tempo and complexity
  3. Click "Generate" to create your composition
  4. Play back the result directly in the browser
  5. Download as MIDI file for further editing

Programmatic Usage

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')

License

This project is open source. Please check the repository for license details.

Background

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.

About

Automating Music Generation via simple music informed algorithm!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages