@libraz/libcantus - v1.1.0
    Preparing search index...

    Function generateDrums

    • Generate a drum performance as a flat list of onsets.

      Every voice (kick, snare, ghost snares, closed/open/foot hi-hats, ride, toms, crash, and auxiliary percussion) is emitted as a DrumHit distinguished by its General MIDI pitch. Groove style selects an internal style and feel; complexity.rhythmic sets the backing-density level; section shapes kick, hi-hat, ghost, and percussion density. 16th-note hi-hats drop to 8ths at or above 150 BPM. When fills is true the final bar is replaced with a fill whose archetype is shaped by nextSection; a fill that would emit nothing on its beat falls back to the normal groove so the phrase end is never silent. euclideanKick overrides the kick with an evenly-spread Euclidean pattern. Output is fully determined by the options plus the context's seed.

      The patterns are 4/4 only — backbeats, hi-hat subdivisions, and fills are all written against a four-beat bar — so beat positions are quarter notes and bar n starts at beat 4n.

      Parameters

      Returns DrumHit[]

      Percussion onsets in onset order, ties broken by pitch.

      import { generateDrums } from '@libraz/libcantus';
      const hits = generateDrums({
      bars: 4,
      style: 'standard',
      section: 'chorus',
      fills: true,
      ctx: { seed: 0, bpm: 120, complexity: { rhythmic: 0.6 } },
      });
      // Fully determined by the options plus the context's seed (defaults to 0).