# Playlist BPM & Flow Calculator AI Agent Connect

> Playlist BPM & Flow Calculator MCP uses BPM, musical keys, and energy levels to order tracks. It acts as a deterministic sequencing engine for your AI client, allowing you to build smooth transitions, energy waves, or steady ascents without manual math.

## Overview
- **Category:** productivity
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_q4uAfuwRrqUZXUMZVPL0HjvHw2It7pnL4obSYKVO/ai-agent-connect
- **Tags:** bpm, playlist, music-theory, sequencing, audio-analysis

## Description

You can stop guessing if two tracks will clash. This MCP gives your AI client the ability to calculate the mathematical relationship between songs. Instead of just listing tracks, your agent can now analyze the BPM, harmonic key, and energy levels of every song in your library to build a logical flow. 

You can instruct your agent to build a playlist that slowly builds tension through a smooth ascent or one that moves in energy waves. If you have a specific set of songs and want to know if they work together, the MCP checks the compatibility of the transition. It also lets you set hard constraints, like ensuring the energy level never jumps too sharply between tracks. It's a precise way to handle music sequencing through natural language.

## Tools

### analyze_transition_compatibility
This tool checks if two specific songs will sound good back to back. It evaluates the relationship between their BPM and keys.

### calculate_optimal_flow
This tool generates a full playlist sequence based on a specific strategy you choose. You can request patterns like energy waves or steady climbs.

### get_alternative_sequence
This tool provides a different way to order your existing songs. It uses a different logic than your first attempt to give you a fresh perspective.

### validate_playlist_constraints
This tool verifies that a sequence follows your rules. It checks if the songs stay within your defined limits for energy or tempo.

## Prompt Examples

**Prompt:** 
```
Generate a smooth ascent playlist from these songs: [{'id': '1', 'bpm': 120, 'key': 'C', 'energy': 0.5, 'durationSeconds': 180}, {'id': '2', 'bpm': 124, 'key': 'G', 'energy': 0.6, 'durationSeconds': 200}]
```

**Response:** 
```
The optimal sequence is song 1 followed by song 2, with a total runtime of 380 seconds and a high compatibility score.
```

**Prompt:** 
```
Are these two songs compatible: Song A (128 BPM, Am, 0.8 energy) and Song B (128 BPM, C, 0.7 energy)?
```

**Response:** 
```
Yes, the transition is smooth because the BPM is identical and the keys are harmonically related.
```

**Prompt:** 
```
Check if this sequence of song IDs [101, 102, 103] violates a max energy delta of 0.2.
```

**Response:** 
```
The sequence is valid and does not violate the energy delta constraint.
```

## Capabilities

### Harmonic Sequencing
Your agent uses musical keys to prevent jarring key changes between tracks.

### Tempo Management
The MCP calculates BPM shifts to ensure smooth rhythmic transitions.

### Energy Level Control
You can define how much the energy fluctuates from one song to the next.

### Constraint Validation
The agent checks your playlist against specific rules you set for tempo or energy.

### Alternative Ordering
Your agent can generate multiple different ways to order the same set of songs.

## Use Cases

### Club Set Preparation
A DJ provides a list of tracks and asks the agent to create a smooth energy ascent for a peak hour set.

### Mood-Based Playlisting
A curator builds a playlist that follows an energy wave pattern for a workout or study session.

### Transition Testing
A producer checks if two specific tracks will clash before adding them to a mix.

### Playlist Auditing
An editor uses the tool to ensure a sequence doesn't violate energy delta constraints.

## Benefits

- Removes the guesswork from harmonic transitions.
- Automates the math behind BPM and energy shifts.
- Enforces strict rules on how a playlist can evolve.
- Provides multiple sequencing logic options for the same tracks.

## How It Works

Connecting this MCP to your AI client gives your agent immediate access to music theory math.

1. Connect the MCP to your client like Claude or Cursor via Vinkius.
2. Provide your agent with a list of songs including their BPM, key, and energy.
3. Tell your agent how you want the songs ordered, such as a smooth ascent.
4. The agent uses the sequencing tools to calculate the best order.
5. Receive the finalized, mathematically optimized playlist sequence.

## Frequently Asked Questions

**How does the MCP calculate playlist flow?**
It uses deterministic logic based on BPM, musical keys, and energy levels to determine the best order for tracks.

**Can I set specific rules for my playlist?**
Yes, you can use the validation tool to ensure your sequence stays within specific energy or tempo limits.

**What AI clients can use this MCP?**
You can use this with any MCP-compatible client, including Claude, Cursor, Windsurf, and VS Code.

**Does this tool analyze the actual audio files?**
No, it works with the musical attributes like BPM and key that you provide to the agent.

**Can I get more than one version of a playlist?**
Yes, you can use the alternative sequence tool to get a different ordering of the same songs using different logic.

**How do I create a smooth playlist?**
You can use the `calculate_optimal_flow` tool with a policy like 'smooth_ascent' to order your songs for a gradual increase in energy.

**Can I check if two songs will sound good together?**
Yes, use `analyze_transition_compatibility` to evaluate the BPM, key, and energy relationship between two songs.

**How can I prevent sudden jumps in my playlist?**
Use `validate_playlist_constraints` to check if your sequence violates maximum allowed deltas for BPM or energy levels.
