mwg API
    Preparing search index...

    Class GrooveHumanizer

    Tier 2: the lite pass plus the groove grid and two musical rules the lite tier has no opinion about. The template supplies the per-slot deviations, rescaled from the tempo it was measured at to the tempo of the file being played, so a groove stays the same shape in time rather than the same number of ticks.

    The two rules are what keep a groove musical instead of merely uneven: kick and bass carry the pulse and stay inside 5 ms however loose the run, while a melody's local peaks are lifted a little so the line still speaks. Without a template the slot term is empty and the run is those rules over the same noise the lite tier uses - this tier is a superset of it, never a different pass.

    import { parseMidi, GrooveHumanizer, type GrooveTemplate } from '@datamoc/mwg/audio';

    declare const midiBytes: ArrayBuffer;
    declare const template: GrooveTemplate;

    const file = parseMidi(midiBytes);
    const engine = new GrooveHumanizer();
    await engine.initialize(); // idempotent; the factory already does this for you
    const swung = await engine.process(file, { intensity: 0.8, grooveTemplate: template, seed: 7 });

    Implements

    Index
    approximateSizeMb: 0.5

    roughly what the tier costs a bundle, in megabytes: lite is code, magenta is a model

    tierName: "groove" = 'groove'

    the tier this engine implements, as HumanizerFactory.create spells it