rotational beat estimation model
Project description
phasefinder is a beat estimation model that predicts metric position as rotational phase, heavily inspired by this paper.
usage
python
from phasefinder import Phasefinder
# initialize model
pf = Phasefinder()
# predict beats
audio_path = "path/to/your/audio/file.[wav/mp3/flac/etc]"
beat_times = pf.predict(audio_path)
# predict beats and BPM
beat_times, bpm = pf.predict(audio_path, include_bpm=True)
# generate a click track
output_path = "output_with_clicks.wav"
pf.make_click_track(audio_path, output_path, beats=beat_times)
cli
basic usage
python -m phasefinder.infer path/to/your/audio/file.wav
This will print the estimated beat times to the console.
options
--bpm
: Include BPM in the output--noclean
: Don't apply the cleaning function to the beat times--format {times,click_track}
: Choose the output format (default: times)times
: Output beat timesclick_track
: Generate an audio file with click track
--audio_output PATH
: Specify the path for the output audio file with clicks (default: output_with_clicks.wav)--json_output PATH
: Save the results to a JSON file
examples
-
Estimate beats and BPM:
python -m phasefinder.infer path/to/audio.wav --bpm
-
Generate a click track:
python -m phasefinder.infer path/to/audio.wav --format click_track --audio_output output.wav
-
Save results to a JSON file:
python -m phasefinder.infer path/to/audio.wav --bpm --json_output results.json
-
Estimate beats without applying the cleaning function:
python -m phasefinder.infer path/to/audio.wav --noclean
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
phasefinder-0.0.1.tar.gz
(1.1 MB
view details)
Built Distribution
phasefinder-0.0.1-py3-none-any.whl
(148.2 kB
view details)
File details
Details for the file phasefinder-0.0.1.tar.gz
.
File metadata
- Download URL: phasefinder-0.0.1.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9166c3eef7715d841043095be22274dcc07956a6d92d23a8ceee463ae8847b33 |
|
MD5 | 8c3950009ddbd5ca39d8d7e1c11615a8 |
|
BLAKE2b-256 | 52ed0f17499651e5cf59a50d03ef69738066adfc36f1e0c8ccb402c53b854767 |
File details
Details for the file phasefinder-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: phasefinder-0.0.1-py3-none-any.whl
- Upload date:
- Size: 148.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b10945efab9f5e6e04e29927242bf10c20fcd47c22200d04bb795bc367ca6d5 |
|
MD5 | c3786a7f5df6c7ff17e9c11c82fb29c3 |
|
BLAKE2b-256 | 43feaabe38c6b60fbdedd6cd25e58a5b93317f8b0ed7b959eb200d7b57b8711d |