set_tempo_tool
Control Ableton Live's session tempo directly via the MCP server, enabling precise tempo adjustments for AI-assisted music production workflows.
Instructions
Set the tempo of the Ableton session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tempo | Yes |
Implementation Reference
- MCP_Server/server.py:87-90 (handler)MCP tool handler for 'set_tempo_tool' that delegates to the set_tempo helper function.@mcp.tool() def set_tempo_tool(ctx: Context, tempo: float) -> str: """Set the tempo of the Ableton session.""" return set_tempo(ctx, tempo)
- Server-side helper that sends the 'set_tempo' command over the connection to the Ableton remote script.def set_tempo(ctx: Context, tempo: float) -> str: """ Set the tempo of the Ableton session. Parameters: - tempo: The new tempo in BPM """ try: ableton = get_ableton_connection() result = ableton.send_command("set_tempo", {"tempo": tempo}) return f"Set tempo to {tempo} BPM" except Exception as e: logger.error(f"Error setting tempo: {str(e)}") return f"Error setting tempo: {str(e)}"
- Remote script handler that executes the actual Ableton Live API call to set the song tempo.def set_tempo(self, tempo: float) -> dict[str, Any]: """Set the tempo of the session""" try: # Validate tempo value validate_tempo(tempo) self._song.tempo = tempo result = {"tempo": self._song.tempo} return result except Exception as e: self.log_message("Error setting tempo: " + str(e)) raise