example by Expert Sleepers

Author: Expert Sleepers
Version: 1.0
For AL version: 2.0.0 and above

This example shows how to maintain a simple state machine so that repeated events (here, MIDI note on messages) cause different behaviour.
First event -> tap record start
Second event -> tap record end, input level to 0.0
Third event -> Input level to 1.0 (i.e. enter overdub mode)
Fourth event -> Input level to 0.0, and next event is treated as third event, and so on

A second MIDI event is defined to reset the state, so the next event is treated as the first event.

Download: example.lua

We use cookies and other tracking technologies to improve your experience on this site. We also link to content on external websites which may also gather information about you when you visit them. This is all perfectly normal. You can find out more about cookies (including how to turn them off) here and you can read our Privacy Policy here.