Page tree

Versions Compared

Key

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

...

Code Block
-- play echos after releasing the note
function echoNotes(event, echos)
	local duration = getBeatDuration()
	for i=1, echos do
		wait(duration*0.5)
		playNote(event.note+7*i, event.velocity*1/i, duration*0.25)
	end
	print("Spawn function of Note", event.note, "ended at", getTime())
end

function onNote(event)
	postEvent(event)
	waitForRelease()
	spawn(echoNotes, event, 3)
	print("Note", event.note, "was released at", getTime())
end
Panel

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