Skip to main content

A Python library for BPM adjustment in audio files

Project description

Chbpm: BPM Adjustment Tool

Overview

Chbpm is a Python-based tool designed for analyzing and adjusting the tempo of music tracks. This tool is ideal for fitness enthusiasts, dancers, and anyone who needs music to maintain a consistent BPM for their activities. The primary goal is to adjust the BPM of songs to fit within a target BPM range, facilitating a consistent pace during workouts or dance routines.

Features

  • BPM Analysis: Automatically analyzes the BPM of music files.
  • BPM Adjustment: Adjusts the tempo of music tracks to a target BPM suitable for exercise or dance routines.
  • Dual BPM Handling: For songs within a specified range, it uses the target BPM directly. For songs where double the BPM falls within the range, it adjusts to half the target BPM.
  • File Format Support: Compatible with various audio file formats (e.g., MP3, M4A).
  • Error Logging: Detailed logging for troubleshooting, including optional suppression of verbose ffmpeg metadata output.

Installation

Ensure ffmpeg is installed on your system. Installation inctructions.

For Users

pip install chbpm

For Developers

  1. Install Pipenv:
pip install pipenv
  1. Clone this repository.
git clone https://github.com/dariakriukova/rhythm-is-a-runner.git
  1. Navigate to the Project Directory
  2. Install Dependencies:
pipenv install
  1. Activate the Virtual Environment:
pipenv shell

Usage

Run the tool from the command line, specifying the input folder and other optional parameters:

python -m chbpm path_to_music_folder

Command-Line Options

  • input_path: Path to the input music folder.

  • -o, --output_path: Path to the output folder where adjusted music files will be saved. Defaults to adjusted.

  • -t, --target_bpm: Optional target BPM for tempo adjustment. Defaults to 180.

  • -r, --range_percentage: Percentage for BPM range adjustment. Defaults to 15%. This setting determines the flexibility in BPM adjustment.

  • --log: Set log level. INFO by default.

  • --format: Convert output audio files to given format. By default keeps the original format.

--ffmpeg_options: Control over the audio processing, enabling adjustments to codec, bitrate, and more.

Important Note

The arguments passed through --ffmpeg_options are directly supplied to FFmpeg, so it's essential to ensure they are valid and compatible with the input and output file formats being used. Refer to the FFmpeg documentation for a comprehensive list of available options.

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

chbpm-0.1.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chbpm-0.1.3-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file chbpm-0.1.3.tar.gz.

File metadata

  • Download URL: chbpm-0.1.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for chbpm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 de7d820cb296e02137fa415c956168aebdbc1ea78cf6fbbbef5d4ddb38e995af
MD5 1950ad2a9e126aa45d2ebc13b9439aa0
BLAKE2b-256 aea5cb8ffbe18e2efbd7c50cdad1c1361233e20ee4316f4ea202d75282921d1e

See more details on using hashes here.

File details

Details for the file chbpm-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: chbpm-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for chbpm-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b9c7cc7b720b61e0d3cb4c32fa442d80f694023bd17c7b80d81e82ecd23cb0e
MD5 871ebff0cabf4a153f3bf8e4a3debd7a
BLAKE2b-256 59769631e2a1c2d2bac56d3660b25d3bd84c42b01c3506832c22c1b1bfe01f3e

See more details on using hashes here.

Supported by

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