waitForRelease()

Description

Function to suspend the execution of the onNote callback until the note that called onNote gets released either by a corresponding note-off or sustain pedal off.

Available in: Processor.

Example

-- print the note length
function onNote(event)
    postEvent(event)
    local noteOnTime = getTime()
    waitForRelease()
    local noteOffTime = getTime()
    local noteLength = noteOffTime - noteOnTime
    print(noteLength.." ms")
end

See Also: wait, waitBeat, spawn, runAsync, runSync