Skip to main content
Glama

beat_track

Analyze the rhythmic content of audio time series by computing its beat track. Use customizable parameters like hop length, start BPM, tightness, and units to extract precise rhythmic analysis for music applications.

Instructions

Computes the beat track of the given audio time series using librosa. The beat track is a representation of the audio signal in terms of its rhythmic content, which is useful for music analysis. The beat track is computed using the following parameters: - hop_length: The number of samples between frames. - start_bpm: The initial estimate of the tempo (in BPM). - tightness: The tightness of the beat tracking (default is 100). - units: The units of the beat track (default is "frames"). It can be frames, samples, time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hop_lengthNo
path_audio_time_series_yYes
start_bpmNo
tightnessNo
unitsNoframes

Implementation Reference

  • The primary handler implementation for the 'beat_track' tool. Decorated with @mcp.tool() for registration. Loads audio y from CSV file, calls librosa.beat.beat_track to compute tempo and beats, returns dict with results. Includes detailed docstring describing parameters.
    @mcp.tool() def beat_track( path_audio_time_series_y: str, hop_length: int = 512, start_bpm: float = 120, tightness: int = 100, units: str = "frames", ) -> str: """ Computes the beat track of the given audio time series using librosa. The beat track is a representation of the audio signal in terms of its rhythmic content, which is useful for music analysis. The beat track is computed using the following parameters: - hop_length: The number of samples between frames. - start_bpm: The initial estimate of the tempo (in BPM). - tightness: The tightness of the beat tracking (default is 100). - units: The units of the beat track (default is "frames"). It can be frames, samples, time. """ y = np.loadtxt(path_audio_time_series_y, delimiter=";") tempo, beats = librosa.beat.beat_track( y=y, hop_length=hop_length, start_bpm=start_bpm, tightness=tightness, units=units, ) return { "tempo": tempo, "beats": beats, }
  • Schema definition for 'beat_track' tool parameters and return type, as listed in the @mcp.prompt() generated user instructions.
    "- beat_track(path_audio_time_series_y: str, hop_length: int = 512, start_bpm: float = 120, " "tightness: int = 100, units: str = 'frames') -> dict\n"
  • The @mcp.tool() decorator registers the beat_track function as an MCP tool with the FastMCP server.
    @mcp.tool()

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