Skip to main content
Glama

tempo

Analyze audio files to detect tempo in beats per minute (BPM) using time series data, with configurable parameters for precise measurement.

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
path_audio_time_series_yYes
hop_lengthNo
start_bpmNo
std_bpmNo
ac_sizeNo
max_tempoNo

Implementation Reference

  • The main handler function for the 'tempo' tool. It loads the audio time series from a CSV file and estimates the tempo in BPM using librosa.feature.tempo.
    @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
  • The input schema for the 'tempo' tool as listed in the MCP prompt, defining parameters and return type.
    "- 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\n"
  • The @mcp.tool() decorator registers the tempo function as an MCP tool.
    @mcp.tool()

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