@libraz/libcantus - v0.9.3
    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; density 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 seed.

      Parameters

      Returns DrumHit[]

      Percussion onsets in bar order.

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