Skip to main content

phasefinder is a beat estimation model that predicts metric position as rotational phase, heavily inspired by this paper.

full writeup here

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 times
    • click_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

  1. Estimate beats and BPM:

    python -m phasefinder.infer path/to/audio.wav --bpm
    
  2. Generate a click track:

    python -m phasefinder.infer path/to/audio.wav --format click_track --audio_output output.wav
    
  3. Save results to a JSON file:

    python -m phasefinder.infer path/to/audio.wav --bpm --json_output results.json
    
  4. Estimate beats without applying the cleaning function:

    python -m phasefinder.infer path/to/audio.wav --noclean
    

Metadata

Release files for phasefinder 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phasefinder 0.0.4
File Size Uploaded
phasefinder-0.0.4.tar.gz 136.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for phasefinder 0.0.4
File Interpreter ABI Platform
phasefinder-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 283.7 kB

Release files / phasefinder-0.0.4.tar.gz

Download URL phasefinder-0.0.4.tar.gz
Size 136.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3f735499ac4225b6d26b2d21bc150a48f3b0bc9835844e2377216a5a248e4284
BLAKE2b-256 checksum
How to use checksums
9cdf2afbe341d7073ece5d0cb4a7f106e590f6eafff41a4825186b6245260740
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / phasefinder-0.0.4-py3-none-any.whl

Download URL phasefinder-0.0.4-py3-none-any.whl
Size 147.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eee8e508a1ed9a5844e819075e8925663cf0d93da332e9a0a574be9a2edcdd73
BLAKE2b-256 checksum
How to use checksums
53b71057d08a5d0c224fc135611084a10c1d52523904dc5208464ed9a9133df8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page