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

    Function placeDrumPattern

    • Generate a genre-characteristic groove from the pattern dictionary.

      The three dials never fight, because each owns a different step: the genre chooses which figures are candidates, the complexity dials deform the chosen figure, and the difficulty ceiling rejects a figure whose closest pair of strokes is faster than a player at that ceiling sustains. A rejected figure is dropped from the candidates rather than simplified, since a simplified figure is a different figure.

      Parameters

      Returns DrumHit[]

      Percussion onsets in onset order, ties broken by pitch.

      If the bar count, tempo, or time signature is invalid, or the genre is not one this library names.

      import { placeDrumPattern } from '@libraz/libcantus';
      const hits = placeDrumPattern({ bars: 2, genre: 'bossa', ctx: { seed: 7, bpm: 130 } });