Skip to main content
Glama

tempo

Analyze audio time series to estimate tempo (BPM) with precision using optional offset and duration parameters. Supports customizable hop length, BPM range, and accuracy settings.

Instructions

Estimates the tempo (in BPM) of the given audio time series using librosa. Offset and duration are optional, in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ac_sizeNo
hop_lengthNo
max_tempoNo
path_audio_time_series_yYes
start_bpmNo
std_bpmNo

Implementation Reference

  • The handler function for the 'tempo' MCP tool. It loads the audio time series from a CSV file and uses librosa.feature.tempo to estimate the tempo in BPM.
    @mcp.tool() def tempo( path_audio_time_series_y: str, hop_length: int = 512, start_bpm: float = 120, std_bpm: float = 1.0, ac_size: float = 8.0, max_tempo: float = 320.0, ) -> float: """ Estimates the tempo (in BPM) of the given audio time series using librosa. Offset and duration are optional, in seconds. """ y = np.loadtxt(path_audio_time_series_y, delimiter=";") tempo = librosa.feature.tempo( y=y, hop_length=hop_length, start_bpm=start_bpm, std_bpm=std_bpm, ac_size=ac_size, max_tempo=max_tempo, ) return tempo

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hugohow/mcp-music-analysis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server