A Python package that generates a metronome track from Guitar Pro files.
-
Extracts tempo information from Guitar Pro (
.gp
) files. -
Generates a WAV file containing metronome clicks.
-
Supports variable tempo changes throughout the piece.
-
Supports tempo changes in the middle of a bar.
You can install the package directly from PyPI using pip
:
pip install metronome_extractor
from metronome_extractor import create_metronome_track, save_as_wav
input_file = "input.gp"
output_file = "output.wav"
tempos, total_bars = parse_tempo_changes(extract_gpif(input_file))
metronome_audio = create_metronome_track(tempos, bars=total_bars)
save_as_wav(output_file, metronome_audio)
metronome_extractor input.gp output.wav
-
Extracts the score.gpif file from the Guitar Pro file (XML format).
-
Parses the XML to find tempo changes and their positions.
-
Generates click sounds at appropriate intervals.
-
Creates a WAV file with the metronome track.
-
Sample rate: 44100 Hz
-
Audio format: 16-bit mono WAV
-
Click duration: 0.02 seconds
-
Click frequency: 1000 Hz
-
Default time signature: 4/4 (four beats per bar)
-
Customizable click sounds
- Allow users to select custom sound sources for metronome clicks.
- Support different sounds for the first beat of each bar (accent beat).
-
Extended format support
- Add support for
.mp3
export. - Add compatibility with legacy Guitar Pro formats (
.gpx
,.gp5
). - Implement broader Guitar Pro version compatibility.
- Add support for
Feel free to submit issues and enhancement requests! Contributions are welcome.
-
Fork the repository.
-
Create a new branch for your feature or bugfix.
-
Submit a pull request.
This project is open source and available under the MIT License.