mwg API
    Preparing search index...

    Class GrooveConverter

    Writes a template out and reads one back, through JSON (exact) or MIDI (encoded, with the bounds above enforced on the way in). Asking for .agr or .reaper-groove throws naming what is missing rather than returning something that merely resembles them.

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

    declare const template: GrooveTemplate;

    const converter = new GrooveConverter();
    const text = await converter.exportFormat(template, 'json');
    const copy = await converter.importFormat(text, 'json'); // same offsets, same name

    const bytes = await converter.exportFormat(template, 'midi');
    const fromMidi = await converter.importFormat(bytes, 'midi');
    console.log(fromMidi.tempoBpm === template.tempoBpm); // true: tempo travels as microseconds

    Implements

    Index