on init
declare const $FADE_TIME := 5
declare %key_ID[128]
declare %key_ID2[128]
declare %key_ID3[128]
end on
on note
{first, check if array 1 is active}
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE) {if first array is taken, has notes}
if (event_status(%key_ID2[$EVENT_NOTE]) = $EVENT_STATUS_INACTIVE) {if so, check if array 2 is empty}
%key_ID2[$EVENT_NOTE] := $EVENT_ID {if it is, enter event note as event ID in array 2}
else
%key_ID3[$EVENT_NOTE] := $EVENT_ID {if not, enter event note as event ID into 3rd array}
end if
else
%key_ID[$EVENT_NOTE] := $EVENT_ID {if first array is free, use it}
end if
{if all arrays have information, fade out first array and then enter current note in there}
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID2[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID3[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE)
fade_out(%key_ID[$EVENT_NOTE],$FADE_TIME*1000,1)
{ and then perhaps wait another 3 seconds, then fade out the second, then the third? That would be good. }
%key_ID[$EVENT_NOTE] := $EVENT_ID
end if
{messages on what´s happening}
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_INACTIVE)
message("Friggintastic, first array is free, entering note nr " & $EVENT_NOTE & "´s EVENT_ID in place of EVENT_NOTE! ")
end if
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID2[$EVENT_NOTE]) = $EVENT_STATUS_INACTIVE)
message("Events found for key nr " & $EVENT_NOTE & " in first array, so checking 2nd array..")
wait(2000000)
message("great, second array is free, entering ID there! ")
end if
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID2[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID3[$EVENT_NOTE]) = $EVENT_STATUS_INACTIVE)
message("Events found for key nr " & $EVENT_NOTE & " in first array, so checking 2nd array..")
wait(2000000)
message("nope, still events, going for third array... ")
wait(2000000)
message("great, third array is free, entering ID there! ")
end if
if (event_status(%key_ID[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID2[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE and event_status(%key_ID3[$EVENT_NOTE]) = $EVENT_STATUS_NOTE_QUEUE)
message("Events found for key nr " & $EVENT_NOTE & " in first array, so checking 2nd array..")
wait(2000000)
message("nope, still events, going for third array... ")
wait(2000000)
message("nope... all slots filled, going for a fadeout of last one there... :/ ")
end if
end on
on release
message("note off, waiting 3 secs, then fading out all, so you can keep watching the array choices! ")
wait(3000000)
fade_out(%key_ID[$EVENT_NOTE],$FADE_TIME*10000,1)
wait(1000000)
fade_out(%key_ID2[$EVENT_NOTE],$FADE_TIME*10000,1)
wait(1000000)
fade_out(%key_ID3[$EVENT_NOTE],$FADE_TIME*10000,1)
end on