set_tempo
Change the tempo of your Ableton Live session to a specific BPM value, allowing you to adjust the project speed for music production.
Instructions
Set the tempo of the Ableton session.
Parameters:
tempo: The new tempo in BPM
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tempo | Yes |
Implementation Reference
- MCP_Server/server.py:393-407 (handler)MCP tool handler for set_tempo that forwards the command to the Ableton remote script via socket.@mcp.tool() 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)}"
- Actual implementation in Ableton remote script that sets the Live song tempo using the Live API.def _set_tempo(self, tempo): """Set the tempo of the session""" try: self._song.tempo = tempo result = { "tempo": self._song.tempo } return result except Exception as e: self.log_message("Error setting tempo: " + str(e)) raise
- MCP_Server/server.py:104-109 (helper)Helper check identifying set_tempo as a state-modifying command that requires additional delays and timeouts.is_modifying_command = command_type in [ "create_midi_track", "create_audio_track", "set_track_name", "create_clip", "add_notes_to_clip", "set_clip_name", "set_tempo", "fire_clip", "stop_clip", "set_device_parameter", "start_playback", "stop_playback", "load_instrument_or_effect" ]
- Dispatch logic in remote script command router that calls the _set_tempo handler.elif command_type == "set_tempo": tempo = params.get("tempo", 120.0) result = self._set_tempo(tempo) elif command_type == "fire_clip":