mcp_opendaw_create_euclidean_rhythm
Distribute onsets evenly across steps to produce Euclidean rhythms like tresillo and samba.
Instructions
Create a Euclidean rhythm — distributes k onsets across n steps as evenly as possible.
The Euclidean algorithm (BJK algorithm) generates most of the world's classic rhythms: E(3,8) = tresillo (Cuban, Arabic, 3-3-2) E(5,8) = cinquillo (Cuban) E(7,16) = samba, rumba E(7,12) = bembé (West African) E(2,5) = tresillo variant E(4,9) = Aksak (Balkan) E(3,7) = Persian/Arabic
onsets: Number of hits (k). 1-32. steps: Total number of steps (n). 2-64. Must be >= onsets. rotation: Rotate the pattern clockwise by N steps. 0 = no rotation. bars: Number of bars to repeat. Each step = one (4/steps)th of a bar. pitch: MIDI pitch for all hits. velocity: Velocity 0-1. Accents (first onset of each group) get +0.15. duration: Note duration in beats.
Returns notes created, pattern as binary string (1=hit, 0=rest), and Euclidean notation E(k,n).
Example: create_euclidean_rhythm(onsets=3, steps=8, track_index=0) # tresillo create_euclidean_rhythm(onsets=7, steps=16, pitch=38, track_index=1) # samba
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bars | No | ||
| pitch | No | ||
| steps | No | ||
| onsets | No | ||
| duration | No | ||
| rotation | No | ||
| velocity | No | ||
| start_beat | No | ||
| unit_index | No | ||
| track_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |