Skip to main content

rotational beat estimation model

Project description

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
    

Project details


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.2.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

phasefinder-0.0.2-py3-none-any.whl (146.3 kB view details)

Uploaded Python 3

File details

Details for the file phasefinder-0.0.2.tar.gz.

File metadata

  • Download URL: phasefinder-0.0.2.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for phasefinder-0.0.2.tar.gz
Algorithm Hash digest
SHA256 260185a7600d9cf0ccc9cb2fee79335eac2fb1884e498203bae0e70ae9fbdb70
MD5 08f3b41677cae9334aa08dd57ff6a3b1
BLAKE2b-256 39c15cc8fc51ed9d58067340ead781a1cfd24f5ba66396182be547f3d5345872

See more details on using hashes here.

File details

Details for the file phasefinder-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: phasefinder-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 146.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for phasefinder-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd161cb81d8630bfd06ee7ab5188aee9d17f1041075b0d159765e44fb88a5e72
MD5 600cdc2a4f366d21c5538858ce503be2
BLAKE2b-256 c1db9910d160987400fde0a22a58fe1b072f887b98e5ace5b5c8c9b62a266d43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page