mwg API
    Preparing search index...

    Function subdivisionCount

    • How many slots a bar of this signature has on this grid: the number of subdivisions that fit in beats * (4 / beatValue) quarters. It throws when the grid does not tile the bar exactly (an eighth grid against a bar of three sixteenths), because a template with a fractional slot count would wrap onto a position no note can land on.

      Parameters

      Returns number

      import { subdivisionCount } from '@datamoc/mwg/audio';

      console.log(subdivisionCount([4, 4], '16n')); // 16: a bar of 4/4 cut into sixteenths
      console.log(subdivisionCount([6, 8], '8n')); // 6: a bar of 6/8 cut into eighths