The Music Composer project is a Python-based application designed to assist users in creating and manipulating musical compositions. The project leverages the Pygame library for its graphical interface and integrates MIDI functionalities to handle musical notes and sequences.
These are somewhat old videos. If you can manage to run it you will see a different UI with non working buttons.
output2024-10-14_20-51-15.mp4
output2024-10-14_20-49-18.mp4
output2024-10-14_20-48-06.mp4
output2024-10-14_20-47-22.mp4
output2024-10-14_20-46-52.mp4
output2024-10-14_20-45-22.mp4
output2024-10-14_20-40-19.mp4
output2024-10-14_20-39-59.mp4
output2024-10-14_20-39-37.mp4
output2024-10-14_20-38-49.mp4
output2024-10-14_18-57-02.mp4
output2024-10-14_18-53-02.mp4
output2024-10-14_18-44-36.mp4
output2024-10-14_18-41-03.mp4
output2024-10-14_17-11-29.mp4
- Melody Generation: Automatically generate melodies based on musical progressions, keys, and scales.
- Event Scheduling: Schedule musical events such as notes and rhythms to create complex compositions.
- MIDI Integration: Export compositions as MIDI files for further use in digital audio workstations (DAWs).
The [generateMelody
]function is a core component of the project. It generates a melody based on a given chord progression, key, and scale. The function works as follows:
- Initialization: Sets up the melody channel and initializes lists to store melody notes and lengths.
- Melody Creation: Iterates over 64 bars to create a melody. For every 4th bar, it uses the chord progression to determine the note. For other bars, it randomly selects notes from the scale.
- Note Lengths: For each bar, it assigns random note lengths (whole, half, quarter, eighth) to the melody notes.
The project includes an event scheduler to manage the timing and sequencing of musical events. This allows for precise control over when notes are played, ensuring that the generated melodies and rhythms are synchronized correctly.
-
Run the Main Script: Execute the main script to launch the application.
python main.py
-
Generate Melodies: Use the [
generateMelody
] function to create melodies based on your desired musical parameters. -
Export MIDI: Save your compositions as MIDI files for use in other music production software.
- Piano Roll Interface: Visual interface for composing music.
- Recording: Record your compositions.
- MIDI File Export: Save your compositions as MIDI files.
- Freeplay Mode: Play and record music freely.
-
Clone the repository:
git clone https://github.com/yourusername/music-composer.git cd music-composer
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have the necessary assets in the
Assets/
directory:music.png
export.sf2
LAYLA.MID
-
Run the main script:
python main.py
-
Follow the on-screen instructions to interact with the application:
- Press
r
to restart. - Press
s
to save. - Press
f
to enter freeplay mode. - Press
Ctrl+C
to exit.
- Press
main.py
: Entry point of the application.UIGPT.py
: Contains the UI logic and event handling.Scheduler.py
: Handles scheduling of musical notes.Record.py
: Manages recording functionality.Freeplay.py
: Implements freeplay mode.Assets/
: Contains necessary assets like images and sound fonts.recordings/
: Directory where recordings are saved.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.