Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
-- fade all voices, withtriggered by a script parameter
defineSlotLocal("noteIDs")
noteIDs = {}

function onNote(event)
  local id = postEvent(event)
  table.insert(noteIDs, id)
end

function syncFadeAllVoices()
  for i, id in ipairs(noteIDs) do
      fade(id, nil, 0, 1000, true)
  end
  noteIDs = {}
end

function fadeAllVoices()
  if fadeVoices then
    runSync(syncFadeAllVoices, 1)
  end
end

defineParameter("fadeVoices", "Fade All Voices", false, fadeAllVoices)

...