mwg API
    Preparing search index...

    Function maxPolyphony

    Generated game music: a scene described as data (mood, tension, key, seed, length, voices) becomes a playable MIDI file, the same one every time. Renderer-free; it builds on core (the seeded generator) and audio (the MIDI file shape and the seed mixing of data sound effects), and what it makes plays through renderMidiToBuffer, a registered engine, or AdaptiveMusic for bar-aligned switches between game states.

    • The most notes sounding at once in a file, counted over every channel. The contract that makes a piece writable for a chip with a fixed number of voices.

      Parameters

      Returns number

      import { composeMusic, maxPolyphony } from '@datamoc/mwg/music';

      const music = composeMusic({ id: 'a', voices: 3 });
      console.log(maxPolyphony(music.file) <= 3); // true