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

    Function syncopate

    • Anticipate beats, one sixteenth early.

      Anticipation is the direction syncopation runs in every genre this library names: the note arrives before the beat it belongs to. It is written as an addition rather than a displacement — the anticipating stroke is softer, and the note it anticipates stays where it was, the way a player ties into the beat rather than abandoning it — because this is one of the dials that only ever add material. Displacing instead would move onsets around under the finger of anyone who puts the dial on a slider, and a saved project reopened one notch along would not contain the piece it was. Which beats are anticipated is fixed by position, so the bar next door is unaffected either way.

      A position already taken blocks the anticipation only within the same stream — the same limb, else the same voice. A ghost snare sitting where the hi-hat wants to anticipate is another hand playing, not an obstacle, and whether two limbs can actually strike together is the playability layer's question rather than this one's.

      Type Parameters

      Parameters

      • events: readonly T[]

        The figure.

      • amount: number | SyncopateOptions

        How much syncopation, in [0, 1], or the amount together with the meter the figure is counted in. The path is variadic, so the meter is named here rather than after it; naming none reads the figure in 4/4, as every built-in figure is written.

      • draw: Draw

        The position-addressed sampler.

      • ...path: readonly (string | number)[]

        Where the figure sits, so the same bar always syncopates alike.

      Returns T[]

      The figure with its anticipations, sorted by position.