← Back

WorldRhythm: A Unified Framework for Cross-Cultural Rhythm Generation

Keywords: rhythm generation, computational ethnomusicology, cross-cultural music, interlocking patterns, polyrhythm, algorithmic composition, articulation techniques

This paper presents WorldRhythm, a rule-based algorithmic framework for generating rhythmic patterns across ten distinct musical cultures within a unified architecture. Unlike existing approaches that focus on single cultural traditions or rely on machine learning with Western-biased datasets, WorldRhythm employs a four-layer role hierarchy combined with culture-specific preference matrices, specialized engines for unique rhythmic concepts, and an Articulation Profile system for style-specific ornamentation. The system integrates ethnomusicological research from West African polyrhythm, Afro-Cuban clave, Javanese gamelan, Balinese kotekan, Indian tala, and Balkan aksak traditions into a parameterized, interpretable generation system. This paper describes the core architecture, algorithmic processes, specialized engines, humanization mechanisms, and theoretical foundations of the framework.


1. Introduction

1.1 Background

Computational rhythm generation has predominantly focused on Western popular music styles. Major publicly available datasets such as the Groove MIDI Dataset and Magenta's drum transcription corpora consist almost entirely of Western genres including rock, pop, funk, and jazz. Recent research (Mehta et al., 2024) analyzing over one million hours of audio datasets found that 86% focus on Global North music, with 93% of researchers primarily studying Western music. Machine learning approaches such as GrooVAE and Drum RNN, while successful for expressive drum performance generation, are trained primarily on these Western-centric datasets and lack explicit modeling of culture-specific rhythmic principles.

Several computational systems have addressed non-Western musical traditions individually: the CompMusic project (UPF Barcelona) developed datasets and tala detection systems for Carnatic and Hindustani music; Euclidean rhythm generators based on Toussaint's research have been widely implemented; and various gamelan algorithmic composition systems exist. However, these efforts typically target single traditions. Additionally, computational systems for tabla and mridangam transcription have achieved approximately 93% accuracy, demonstrating the viability of modeling specific traditions.

Ethnomusicological research has documented sophisticated rhythmic systems across world cultures, including the timeline concept in West African music, the clave in Afro-Cuban traditions, the colotomic structure in Javanese gamelan, the kotekan interlocking in Balinese music, the tala cycles in Indian classical music, and the aksak asymmetric meters in Balkan folk music. However, these concepts have rarely been unified within a single generative framework.

1.2 Objectives

This research aims to develop an algorithmic system capable of:

  1. Faithfully representing the core characteristics of ten major world music rhythm styles
  2. Supporting variation generation within single styles
  3. Achieving intelligent cross-style mixing that maintains style-specific characteristics while ensuring overall coordination
  4. Providing humanization processing aligned with natural performance characteristics
  5. Implementing culture-specific ornamentation through an Articulation Profile system

2. Related Work

2.1 Cross-Cultural Rhythm Research

Simha Arom (1991) documented complex interlocking structures in Central African music (Banda Linda and Aka Pygmies), revealing the principle of "minimal periodicity" as an analytical tool for non-Western rhythms. It should be noted that Arom's research primarily focuses on Central Africa rather than West Africa where timeline patterns are most prominent, and these regions differ in specific practices despite sharing common principles.

Gerhard Kubik (2010) elaborated the concept of "timeline" in African rhythm—a referential rhythmic pattern that permeates the entire ensemble, around which other parts organize. This concept directly inspired the role-layered architecture of this research.

Fernando Benadon (2006) demonstrated that timing deviations in human jazz performance are not random errors but style-specific expressive devices, providing theoretical foundation for the humanization mechanisms in this research.

2.2 Algorithmic Rhythm Generation

Godfried Toussaint (2013) established mathematical connections between Euclidean algorithms and world music rhythms, discovering that many traditional rhythmic patterns can be generated using specific parameters of the Euclidean algorithm. This research adopts this method as the core of basic rhythm generation.

Jeff Pressing (1983) proposed a cognitive complexity model for quantifying rhythmic difficulty. This research references this concept in density control and variation generation.

2.3 Limitations of Existing Systems

Existing rhythm generation tools such as Ableton Live's Beat Repeat and Native Instruments' Maschine, while powerful, are primarily designed for electronic music and hip-hop styles. They lack:


3. System Architecture

3.1 Overall Design

WorldRhythm adopts a modular architecture with core components including:

┌─────────────────────────────────────────────────────┐
│                   RhythmEngine                       │
│  ┌───────────┐  ┌───────────┐  ┌───────────────┐   │
│  │  Pattern  │  │  Interlock │  │   Humanize    │   │
│  │ Generator │──│  Manager   │──│    Engine     │   │
│  └───────────┘  └───────────┘  └───────────────┘   │
│        │              │               │             │
│  ┌─────┬─────┐  ┌────┬────┐   ┌─────┬─────┐       │
│  │ Euclidean │  │  Style   │   │  Timing   │       │
│  │ Generator │  │Compat.   │   │  Profile  │       │
│  └───────────┘  └─────────┘   └───────────┘       │
│                                                     │
│  ┌─────────────────────────────────────────────┐   │
│  │            Style-Specific Engines            │   │
│  │  Clave │ Batucada │ Kotekan │ Jazz │ Amen   │   │
│  └─────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────┘

3.2 Four-Layer Role Hierarchy

Inspired by African and Asian percussion traditions, the system divides rhythmic voices into four roles:

RoleFunctionMusical Analogy
TimelineProvides constant reference frameworkWest African bell, Cuban clave
FoundationEstablishes low-frequency foundationBass drum, surdo
GrooveFills mid-frequency spaceCongas, snare
LeadImprovisation and ornamentationSolo instruments

This layering is based on ethnomusicological functional analysis of percussion ensembles, reflecting the "reference-foundation-filling-ornamentation" hierarchical structure present in most traditions.

3.3 Style Parameterization

The system supports ten rhythmic styles, each defined by the following parameters:

struct StyleProfile {
    // Basic parameters
    float baseDensity;          // Base note density
    float swingAmount;          // Swing degree
    int preferredSubdivision;   // Preferred subdivision (8, 12, 16)

    // Rhythmic pattern preferences
    std::vector<int> clavePattern;     // Timeline rhythm pattern
    std::vector<int> accentPattern;    // Accent pattern

    // Interlocking rules
    float avoidanceStrength;    // Avoidance strength
    float complementBoost;      // Complement boost

    // Humanization parameters
    float timingVariance;       // Timing variance (milliseconds)
    float velocityRange;        // Velocity range
    float ghostNoteRatio;       // Ghost note ratio
};

Core characteristics of the ten styles (timing variance based on academic research by Polak & London 2014, Friberg & Sundström 2002, Danielsen et al. 2015):

StyleSubdivisionSwingTiming VarianceCharacteristics
West African12Medium±22ms12/8 polyrhythm, strong interlock
Afro-Cuban16Medium±16msClave-oriented, rich syncopation
Brazilian16High±14msSamba swing, surdo dialogue
BalkanMixedLow±10msIrregular meters, asymmetric accents
Indian16Low±18msTala cycles, tihai endings
GamelanVariableNone±12msColotomic structure, irama levels
Jazz12High±12msTriplet groove, BPM-dependent swing
Electronic16None±5msMachine precision, four-on-floor
Breakbeat16Medium±15msSample slicing, rhythmic breaks
Techno16None±2msMinimal, hypnotic repetition

4. Core Algorithms

4.1 Euclidean Rhythm Generation

Basic rhythmic patterns are generated using Bjorklund's (2003) Euclidean algorithm. Given total steps n and hits k, the algorithm produces the maximum even distribution of k hits across n steps:

std::vector<bool> euclidean(int hits, int steps) {
    std::vector<int> pattern(steps, 0);
    int bucket = 0;

    for (int i = 0; i < steps; i++) {
        bucket += hits;
        if (bucket >= steps) {
            bucket -= steps;
            pattern[i] = 1;
        }
    }
    return pattern;
}

This algorithm can generate many traditional rhythmic patterns:

4.2 Interlocking Generation Algorithm

Interlocking is the key mechanism ensuring multi-part coordination. The system implements three interlocking strategies:

Avoidance Strategy: Foundation avoids Timeline's strong beat positions

float calculateAvoidance(int step, const Pattern& timeline,
                         float avoidanceStrength) {
    if (timeline.hasHit(step)) {
        // Reduce probability when Timeline has hit
        return 1.0f - avoidanceStrength;
    }
    return 1.0f;
}

Complement Strategy: Groove fills gaps between Timeline and Foundation

float calculateComplement(int step, const Pattern& timeline,
                          const Pattern& foundation, float boost) {
    bool hasTimelineHit = timeline.hasHit(step);
    bool hasFoundationHit = foundation.hasHit(step);

    if (!hasTimelineHit && !hasFoundationHit) {
        // Empty positions receive boost
        return boost;
    }
    return 1.0f;
}

Negotiation Strategy: Lead voice considers all other voices

float calculateLeadProbability(int step, const Pattern patterns[3],
                               float baseProb) {
    int activeVoices = 0;
    for (int i = 0; i < 3; i++) {
        if (patterns[i].hasHit(step)) activeVoices++;
    }

    // More active voices, Lead tends to rest
    return baseProb * (1.0f - activeVoices * 0.2f);
}

4.3 Style Compatibility Matrix

When mixing cross-style, the system references a predefined compatibility matrix to determine interlocking strength:

static const float compatibilityMatrix[10][10] = {
    //    WA    AC    BR    BK    IN    GM    JZ    EL    BB    TC
    {1.00, 0.80, 0.70, 0.40, 0.50, 0.60, 0.60, 0.50, 0.60, 0.40}, // West African
    {0.80, 1.00, 0.85, 0.45, 0.50, 0.55, 0.70, 0.60, 0.65, 0.50}, // Afro-Cuban
    {0.70, 0.85, 1.00, 0.40, 0.45, 0.50, 0.75, 0.55, 0.70, 0.45}, // Brazilian
    {0.40, 0.45, 0.40, 1.00, 0.60, 0.35, 0.50, 0.45, 0.45, 0.40}, // Balkan
    {0.50, 0.50, 0.45, 0.60, 1.00, 0.55, 0.55, 0.40, 0.45, 0.35}, // Indian
    {0.60, 0.55, 0.50, 0.35, 0.55, 1.00, 0.50, 0.50, 0.45, 0.50}, // Gamelan
    {0.60, 0.70, 0.75, 0.50, 0.55, 0.50, 1.00, 0.70, 0.75, 0.60}, // Jazz
    {0.50, 0.60, 0.55, 0.45, 0.40, 0.50, 0.70, 1.00, 0.80, 0.85}, // Electronic
    {0.60, 0.65, 0.70, 0.45, 0.45, 0.45, 0.75, 0.80, 1.00, 0.75}, // Breakbeat
    {0.40, 0.50, 0.45, 0.40, 0.35, 0.50, 0.60, 0.85, 0.75, 1.00}  // Techno
};

Compatibility is calculated based on the following principles:

  1. Pulse families: Styles sharing the same basic subdivision have higher compatibility (e.g., 12/8 family: West African, Cuban, Brazilian)
  2. Historical connections: Styles with historical relationships have higher compatibility (e.g., Cuban and Jazz)
  3. Timing characteristics: Styles with similar humanization degrees are easier to mix (e.g., Electronic and Techno)

When compatibility is low, the system automatically enhances interlocking:

float getInterlockStrength(int styleA, int styleB) {
    float compatibility = getCompatibility(styleA, styleB);
    // Lower compatibility, stronger interlock to maintain overall coordination
    return 1.0f + (1.0f - compatibility) * 0.5f;
}

4.4 Humanization Processing

The humanization engine simulates timing and velocity variations in human performance with style-specific characteristics:

Timing Variation

float getTimingOffset(int step, int styleIndex, float amount) {
    const StyleTimingProfile& profile = profiles[styleIndex];

    // Base variance
    float variance = profile.baseVariance * amount;

    // Role correction (Timeline most stable, Lead most free)
    variance *= profile.roleMultipliers[currentRole];

    // Generate Gaussian-distributed offset
    return gaussianRandom(0, variance);
}

BPM-Dependent Swing

According to research by Friberg & Sundström (2002), jazz swing ratio varies with tempo:

This phenomenon originates from biomechanical limitations—maintaining large uneven subdivisions is difficult at high speeds.

float getSwingRatio(int styleIndex, float bpm) {
    const StyleTimingProfile& profile = profiles[styleIndex];

    float slowRatio = profile.swingRatioSlow;  // Swing at slow tempo
    float fastRatio = profile.swingRatioFast;  // Swing at fast tempo

    // Linear interpolation, 100-180 BPM transition zone
    float t = clamp((bpm - 100.0f) / 80.0f, 0.0f, 1.0f);
    return lerp(slowRatio, fastRatio, t);
}

Relative Ghost Note Velocity

Ghost note velocity is calculated relative to the previous main note rather than as absolute value. According to academic research:

Therefore, ghost note velocity range is set at 25-32%.

float getGhostVelocity(float previousVelocity, int styleIndex) {
    const StyleTimingProfile& profile = profiles[styleIndex];
    // ghostVelocityMin = 0.25, ghostVelocityMax = 0.32 (peer-reviewed)
    float ratio = randomRange(profile.ghostVelocityMin,
                              profile.ghostVelocityMax);
    return previousVelocity * ratio;
}

4.5 Articulation Profile System

To achieve style-specific ornamentation techniques, the system employs an Articulation Profile lookup table based on ethnomusicological research. Each style and role combination has dedicated ornamentation settings.

Articulation Types

enum class ArticulationType {
    None,   // No ornamentation
    Flam,   // Double strike (grace note preceding)
    Drag,   // Double grace notes
    Ruff,   // Triple grace notes
    Buzz    // Buzz roll (continuous fine strokes)
};

Profile Structure

struct ArticulationEntry {
    ArticulationType type;      // Articulation technique type
    float baseProbability;      // Base occurrence probability
    bool onAccentsOnly;         // Trigger only on accents
    bool onStrongBeats;         // Trigger only on strong beats
};

// 10 styles × 4 roles = 40 profile sets
static const ArticulationEntry profiles[10][4];

Style-Specific Design

Each style's Articulation design is based on ethnomusicological literature:

StyleTimelineFoundationGrooveLead
West AfricanFlam medium probabilityDrag low probabilityFlam high probabilityRuff medium probability
Afro-CubanFlam low probabilityNoneFlam medium probabilityDrag high probability
BrazilianFlam medium probabilityDrag low probabilityRuff high probabilityBuzz medium probability
JazzFlam low probabilityDrag low probabilityBuzz medium probabilityRuff high probability
ElectronicNoneNoneFlam low probabilityFlam low probability

Selection Algorithm

ArticulationType selectArticulation(int styleIndex, int roleIndex,
                                    float amount, bool isAccent,
                                    bool isStrongBeat) {
    const ArticulationEntry& entry = profiles[styleIndex][roleIndex];

    // Condition checking
    if (entry.onAccentsOnly && !isAccent) return None;
    if (entry.onStrongBeats && !isStrongBeat) return None;

    // Probability calculation: base probability × user control amount
    float probability = entry.baseProbability * amount;

    if (randomFloat() < probability) {
        return entry.type;
    }
    return None;
}

Ethnomusicological References

Articulation Profile design references the following research:


5. Style-Specific Engines

Beyond generic algorithms, the system includes specialized engines for specific traditions:

5.1 ClaveEngine (Cuban)

Implements 3-2/2-3 direction switching for Son Clave, Rumba Clave, and Bossa Nova Clave:

enum ClaveType { SON, RUMBA, BOSSA };
enum Direction { THREE_TWO, TWO_THREE };

Pattern generateClave(ClaveType type, Direction dir);
void flipDirection();  // Real-time direction switching

5.2 BatucadaEngine (Brazilian)

Simulates Samba school percussion Surdo trio interlocking:

struct SurdoInterlock {
    Pattern primeira;  // Lead voice
    Pattern segunda;   // Response voice
    Pattern terceira;  // Ornamentation voice
};

SurdoInterlock generateSurdos(SambaStyle style, float swing);

5.3 KotekanEngine (Balinese)

Implements Kotekan interlocking technique in gamelan music:

enum KotekanType { NYOG_CAG, NOROT, TELU, EMPAT, UBIT };

KotekanPair generateKotekan(KotekanType type, int steps);

5.4 JazzBrushEngine (Jazz)

Simulates jazz drummer's brush and stick techniques:

enum PlayingStyle { BRUSHES, STICKS };
enum TempoFeel { BALLAD, MEDIUM, UP_TEMPO, BEBOP };

JazzKit generateComping(PlayingStyle style, TempoFeel feel, float bpm);

5.5 AmenBreakEngine (Breakbeat)

Implements slicing and reassembly of classic Breakbeat samples:

enum BreakType { AMEN, THINK, FUNKY_DRUMMER, APACHE };
enum ChopStyle { ORIGINAL, REVERSE, JUNGLE_1, JUNGLE_2 };

BreakPattern generateBreak(BreakType type);
BreakPattern chopBreak(const BreakPattern& original, ChopStyle style);

6. Experiments and Evaluation

6.1 Experimental Design

To verify algorithmic effectiveness, three mixed-style tests were designed:

Test One: World Music/House Fusion

Test Two: Drum'n'Bass Meets Samba

Test Three: Experimental Low-Compatibility Combination

6.2 Results Analysis

Interlocking Effectiveness

Measuring Timeline-Foundation overlap rate and Groove gap-filling rate:

TestTimeline-Foundation OverlapGroove Fill RateOverall Density
Test 112.5%68.7%62.5%
Test 218.7%71.9%68.7%
Test 36.2%75.0%59.4%

Results show:

Style Feature Retention

By analyzing rhythmic characteristics of each voice (subdivision preference, accent positions, swing degree), core qualities of each style are confirmed to be maintained:

VoiceAssigned StyleSubdivision MatchAccent Match
Timeline (West African)West African91.6%87.5%
Foundation (Electronic)Electronic100%100%
Groove (Afro-Cuban)Afro-Cuban85.4%79.2%
Lead (Jazz)Jazz83.3%75.0%

6.3 Limitations

  1. Cultural Simplification: Simplifying complex musical traditions into parameters inevitably loses some details
  2. Static Compatibility: Compatibility matrix is preset and cannot reflect specific musical contexts
  3. Lack of Pitch Dimension: System focuses on rhythm and does not handle cross-cultural fusion of melody and harmony

7. Conclusion and Future Work

7.1 Conclusion

The WorldRhythm algorithm proposed in this research successfully achieves:

  1. Multi-style Support: Covers ten major world music rhythm traditions
  2. Intelligent Mixing: Achieves cross-style fusion through compatibility matrix and variable-strength interlocking
  3. Humanization Processing: Style-specific timing and velocity variations enhance musicality
  4. Articulation Profile: Ethnomusicologically-based ornamentation system with dedicated settings for each style and role combination
  5. Modular Architecture: Easy to extend with new styles and features

This system provides music creators with a tool to explore cross-cultural rhythmic fusion while maintaining respect and understanding for each tradition.

7.2 Future Work

  1. Machine Learning Integration: Train style models using real performance data to enhance realism
  2. Dynamic Compatibility: Dynamically adjust compatibility judgments based on actual generation results
  3. User Research: Conduct listening tests to evaluate musicality and cultural appropriateness of generated rhythms
  4. Pitch Extension: Add cross-cultural generation capabilities for melody and harmony

References

  1. Arom, S. (1991). African Polyphony and Polyrhythm: Musical Structure and Methodology. Cambridge University Press.
  2. Benadon, F. (2006). Slicing the Beat: Jazz Eighth-Notes as Expressive Microrhythm. Ethnomusicology, 50(1), 73-98.
  3. Bjorklund, E. (2003). The Theory of Rep-Rate Pattern Generation in the SNS Timing System. SNS ASD Technical Note.
  4. Cheng, T.Z., Creel, S.C., & Iversen, J.R. (2022). How Do You Feel the Rhythm: Dynamic Motor-Auditory Interactions Are Involved in the Imagination of Hierarchical Timing. Journal of Neuroscience, 42(3), 500-512.
  5. Danielsen, A., et al. (2015). Effects of instructed timing and tempo on snare drum sound in drum kit performance. Journal of the Acoustical Society of America, 138(4), 2301-2316.
  6. Friberg, A., & Sundström, A. (2002). Swing Ratios and Ensemble Timing in Jazz Performance: Evidence for a Common Rhythmic Pattern. Music Perception, 19(3), 333-349.
  7. Kubik, G. (2010). Theory of African Music, Volume I. University of Chicago Press.
  8. Locke, D. (1982). Principles of Offbeat Timing and Cross-Rhythm in Southern Eve Drumming. Ethnomusicology, 26(2), 217-246.
  9. Matsuo, H., & Sakaguchi, Y. (2024). Effects of Rhythm and Accent Patterns on Tempo-Keeping Property of Finger Tapping. i-Perception. DOI: 10.1177/20592043241276959
  10. Mehta, A., et al. (2024). Missing Melodies: AI Music Generation and the Need for Diverse Training Data. arXiv preprint.
  11. Polak, R., & London, J. (2014). Timing and Meter in Mande Drumming from Mali. Music Theory Online, 20(1).
  12. Pressing, J. (1983). Cognitive Isomorphisms between Pitch and Rhythm in World Musics. Studies in Music, 17, 38-61.
  13. Temperley, D. (2000). Meter and Grouping in African Music: A View from Music Theory. Ethnomusicology, 44(1), 65-96.
  14. Tenzer, M. (2000). Gamelan Gong Kebyar: The Art of Twentieth-Century Balinese Music. University of Chicago Press.
  15. Toussaint, G. T. (2013). The Geometry of Musical Rhythm. CRC Press.

Appendix A: Complete Style Compatibility Matrix

West AfricanAfro-CubanBrazilianBalkanIndianGamelanJazzElectronicBreakbeatTechno
West African100%80%70%40%50%60%60%50%60%40%
Afro-Cuban80%100%85%45%50%55%70%60%65%50%
Brazilian70%85%100%40%45%50%75%55%70%45%
Balkan40%45%40%100%60%35%50%45%45%40%
Indian50%50%45%60%100%55%55%40%45%35%
Gamelan60%55%50%35%55%100%50%50%45%50%
Jazz60%70%75%50%55%50%100%70%75%60%
Electronic50%60%55%45%40%50%70%100%80%85%
Breakbeat60%65%70%45%45%45%75%80%100%75%
Techno40%50%45%40%35%50%60%85%75%100%

Appendix B: Style Family Classification

12/8 Pulse Family

4/4 Pulse Family

Irregular Meter Family

Colotomic Family


This research documents the WorldRhythm v0.20 algorithm, implemented in the VCV Rack module environment.

© 2025 MADZINE. All rights reserved.