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

    Function dropSilentNotes

    • Drop the notes that never sound.

      A MIDI or DAW import routinely carries zero-length artefacts. Every entry point in this library ignores them, but a caller holding such an array still has to decide what to do with it before comparing note counts or indices; this is the one filter to apply.

      Parameters

      • events: readonly NoteEvent[]

        The note events to filter.

      Returns NoteEvent[]

      A new array containing only the notes with a positive duration.

      import { dropSilentNotes } from '@libraz/libcantus';
      dropSilentNotes([{ pitch: 60, startBeat: 0, durationBeat: 0 }]); // []