Skip to content

v1.2.0

Choose a tag to compare

@danigb danigb released this 06 Nov 23:31
· 2 commits to main since this release
8bacdd4

Added

  • maxVoices option for every instrument: caps how many voices sound at
    once. When a new note would exceed it, the oldest voices are released at the
    new note's start time, fading out over about 10 ms (voices that are already
    releasing go first). If the rest start at the same time, such as the notes of
    a chord, the most recently added are cancelled instead. Notes still fading
    out count until they are silent, and the cap counts voices, not notes.
    Unlimited by default.
  • Voice shaping in presets (group, region and defaults): a full amp envelope
    (ampDelay, ampAttack, ampHold, ampDecay, ampSustain), pan, lpfQ, a
    modulation LFO (pitch, filter, volume), a vibrato LFO, and a modulation envelope
    (pitch, filter). All off by default, so existing instruments sound the same.
    Pitch modulation needs AudioBufferSourceNode.detune and is skipped where it
    is missing (old Safari).

Fixed

  • Soundfont2 now honors a zone's overridingRootKey. Sf2Zone gained an optional
    rootKey?: number, preferred over sample.header.originalPitch in sf2InstrumentToPreset().
    Many real-world SF2 files leave every sample header's originalPitch at a
    stale default and rely entirely on the SF2 "overridingRootKey" generator (id 58) to declare
    each zone's true root key; without reading it, every zone but the one coincidentally rooted at
    that default was pitch-shifted from the wrong base note. createSoundfont implementations
    that parse the raw generator should populate Sf2Zone.rootKey from it - see README.