So I heard you like polyrhythmic MIDI sequences? Well, now you can make your own without all that tedious clicking about in Ableton, and they will loop perfectly.
- Generate polyrhythmic MIDI sequences with customizable parameters
- Create perfectly looping sequences
- Adjust note pitches, durations, and gaps
- Control the number of sweeps and slope aggressiveness
- Automatically generate unique filenames with timestamps
- Python 3.x
- midiutil library
-
Clone the repository (or just grab poly_MIDI.py):
git clone https://github.com/theeasyway/polyrhythmic.git
-
Install the required dependencies:
pip install midiutil
-
Open the
poly_MIDI.py
file in a text editor. -
Modify the parameters in the script according to your preferences:
pitches
: List of MIDI pitch values for the notessweeps
: Number of sweeps in the sequencebase_note_gap
: Gap between the notes at a given pitchnote_length
: Duration of each noteslope_factor
: Multiplier for the number of extra notes (affects slope aggressiveness)start_offset
: Start offset for the first pitchstart_offset_increase
: Increase in start offset for each pitch pair
-
Save the changes to the script.
-
Run the script:
python poly_MIDI.py
-
The generated MIDI file will be saved in the same directory as the script, with a unique filename based on the current timestamp.
See the /examples folder for .mid and .mp3 examples.
The repository also includes a utility script note_to_pitch.py
that converts musical note names to their corresponding MIDI pitches. This can be helpful when working with specific note sequences in your polyrhythmic MIDI sequences.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- The midiutil library for simplifying MIDI file creation in Python.