# Polyrhythm Calculator MCP

> Polyrhythm Calculator instantly analyzes complex rhythmic patterns, determining precise alignment points and attack timestamps for multi-layered music composition. Use this MCP to calculate exactly when different rhythms coincide, finding the perfect sync point or generating millisecond timelines for every note in a sequence.

## Overview
- **Category:** productivity
- **Price:** Free
- **Tags:** rhythm, polyrhythm, music-theory, tempo, bpm, timing

## Description

Designing music with multiple independent rhythms is tough. You need mathematical precision that goes way beyond simply tapping out a beat. This MCP lets you treat rhythm like a measurable data set. Instead of guessing where two different patterns will fall into sync, it calculates the exact moment they align. You can analyze multi-layered beats—whether simple duple rhythms or highly complex polyphonic structures—to get the detailed temporal information needed for professional composition and sound design. When your agent runs this MCP through Vinkius, you get all that timing data pulled together, letting you focus solely on the art instead of the math.

## Tools

### get_grid_resolution
Calculates the smallest possible time unit needed to accurately represent a given rhythm pattern.

### get_layer_attacks
Generates detailed attack timestamps for every individual layer in a polyrhythm.

### find_sync_point
Determines the exact pulse or point in time where all defined rhythmic layers align completely.

### get_rhythm_complexity
Provides a metric that assesses how intricate and varied the overall rhythm pattern is.

## Prompt Examples

**Prompt:** 
```
At what pulse does a 3:4 polyrhythm reset?
```

**Response:** 
```
A 3:4 polyrhythm reaches its alignment point at pulse 12, which marks the completion of one full rhythmic cycle.
```

**Prompt:** 
```
Give me the attack timestamps for a 2:3 rhythm at 120 BPM for 1 measure.
```

**Response:** 
```
At 120 BPM, the attacks for layer 0 occur at 0.0ms and 500.0ms, while layer 1 attacks occur at 0.0ms, 400.0ms, and 800.0ms.
```

**Prompt:** 
```
What is the grid resolution for a 5:4 rhythm at 100 BPM?
```

**Response:** 
```
The minimum subdivision unit is 20.0ms, with 3 ticks per beat.
```

## Capabilities

### Find rhythmic synchronization points
It identifies the exact pulse where multiple independent rhythms or layers hit their alignment point.

### Calculate layer attack timestamps
The MCP generates precise millisecond timelines for every single note across all defined rhythm layers.

### Determine grid subdivision resolution
It calculates the minimum required time unit (grid resolution) necessary to accurately map a complex rhythm pattern.

### Assess overall rhythm complexity
The MCP gives you a score or measure of how intricate and varied a given rhythmic pattern is, helping guide composition choices.

## Use Cases

### Syncing three conflicting instrument loops
A sound designer needs to make a kick drum loop, a hi-hat pattern, and an arpeggiator hit at the same point repeatedly. Instead of trying to manually adjust BPM until they line up, they use `find_sync_point` to get the exact pulse where all three layers reset.

### Modeling complex ethnic drumming patterns
A composer is researching West African polyrhythms involving five different repeating beats. They run `get_layer_attacks` on each of the five tracks to get a comprehensive, ordered list of attack timestamps for accurate sequencing.

### Analyzing compositional difficulty
A music student is learning about polyrhythms and needs to grade their own composition's mathematical challenge. They use `get_rhythm_complexity` to get an objective metric of the pattern’s density, which they can then cross-reference with the grid resolution.

### Creating a rhythm from scratch at high tempo
A producer needs a repeatable sequence for 180 BPM. They use `get_grid_resolution` first to ensure their timing units are small enough, then they feed that resolution into other tools to build out the full attack list.

## Benefits

- Eliminate manual timing errors. Instead of guessing where rhythms clash, use `find_sync_point` to get the exact pulse where every layer aligns.
- Map out complete rhythmic sequences instantly. Use `get_layer_attacks` to generate millisecond timestamps for dozens of notes across multiple tracks in one go.
- Understand your composition’s density. Run `get_rhythm_complexity` to objectively measure how intricate a pattern is, helping you balance tension and release.
- Set the perfect foundational timing unit. Use `get_grid_resolution` to find the absolute minimum time step needed for accurate digital representation of any rhythm.
- Work with confidence knowing your data is mathematically sound. This MCP removes the guesswork from high-level musical arrangement.

## How It Works

The bottom line is that it takes abstract musical concepts and turns them into concrete, measurable data points you can use immediately.

1. You provide the system with the core parameters: the rhythm layers (e.g., 3 beats against 4 beats), the tempo, and the duration.
2. The MCP processes this data through its internal algorithms to calculate all necessary temporal metrics, like sync points or attack lists.
3. Your agent returns a clean, structured output detailing the precise timing—down to the millisecond—for every element in the polyrhythm.

## Frequently Asked Questions

**How does Polyrhythm Calculator find the sync point?**
It calculates the least common multiple (LCM) of your given rhythms to determine the precise pulse where all layers will align. It outputs this alignment point so you can build on it.

**Do I need to specify BPM when using get_layer_attacks?**
Yes, providing the tempo is critical because attack timestamps are measured in milliseconds relative to a defined beat rate. The MCP requires this for accurate calculation.

**What if my rhythms aren't simple integers (e.g., 5:3)?**
The tool handles complex ratios. You input the ratio, and it calculates the necessary temporal data based on that fractional relationship, giving you a clean sync point.

**Can get_grid_resolution help with tempo changes?**
Yes. By determining the minimum subdivision unit, it ensures your timing grid is fine enough to maintain mathematical integrity even when changing tempos or meters drastically.

**Is Polyrhythm Calculator just for drums?**
No, it's designed for any time-based sequence. You can use it to model anything from machine cycles to vocal phrase timing, provided the input is rhythmic.