This Django-based project uses a genetic algorithm to generate optimized MIDI note sequences. Users can create labs to explore the algorithm's performance and view the history of their labs and generations.
-
User Authentication:
- Login, signup, and password reset functionalities.
-
Lab Management:
- Create labs by uploading MIDI files or entering note sequences directly.
- View lab details, including the best note sequence and generations.
-
Generations:
- Track the progress of the genetic algorithm across generations.
- View playable MIDI files for target sequences, best sequences, and each generation's best sequence.
-
Admin Panel:
- Manage users, labs, and generations with a fully customized admin interface.
- Python 3.8+
- Django 4.0+
- MIDI.js (for playing MIDI files in the browser)
- SQLite (default, but configurable)
-
Clone the Repository:
git clone https://github.com/amirkhgraphic/musical-note-generator cd musical-note-generator
-
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Apply Migrations:
python manage.py migrate
-
Run the Development Server:
python manage.py runserver
-
Access the Application: Visit
http://127.0.0.1:8000
in your browser.
- Log in or sign up.
- Go to the "Create Lab" page.
- Upload a MIDI file or enter a comma-separated list of MIDI notes.
- Configure the population size, number of generations, and mutation rate.
- Submit the form to start the genetic algorithm.
- Access the "Lab History" page to view a list of labs you've created.
- Click on a lab to see its details, including target and best sequences and playable MIDI files for each generation.
For development purposes, emails are displayed in the console. Configure the email backend in settings.py
:
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
Access the admin panel at http://127.0.0.1:8000/admin
to manage users, labs, and generations.
Modify settings.py
to configure:
- Database (default is SQLite)
- Static and media files
- Email backend for production
The genetic algorithm implementation can be found in the algorithms/
module. Key features include:
- Fitness calculation
- Population initialization
- One-point and two-point crossover
- Mutation
Contributions are welcome! Please submit a pull request or open an issue for suggestions or bug reports.
This project is licensed under the MIT License. See LICENSE
for more details.
- MIDI.js: For enabling MIDI playback in the browser.
- Django Documentation: For the framework and guidance.