noteOffAll method

void noteOffAll({
  1. int? channel,
  2. bool immediate = false,
})

Stops all the notes. immediate: stop immediately without the release sound.

Implementation

void noteOffAll({int? channel, bool immediate = false}) {
  if (immediate) {
    for (Voice voice in _voices) {
      if (channel == null || voice.channel() == channel) {
        voice.kill();
      }
    }
  } else {
    for (Voice voice in _voices) {
      if (channel == null || voice.channel() == channel) {
        voice.end();
      }
    }
  }
}