on init
make_perfview
set_ui_color(000000)
set_ui_width_px(999)
set_ui_height_px(300)
set_listener($NI_SIGNAL_TIMER_MS,40000)
declare ui_waveform $wf1(10,10)
set_control_par(get_ui_id($wf1), $CONTROL_PAR_WIDTH, 281)
set_control_par(get_ui_id($wf1), $CONTROL_PAR_HEIGHT,70)
set_control_par(get_ui_id($wf1), $CONTROL_PAR_WAVE_COLOR, 11186870)
set_control_par(get_ui_id($wf1),$CONTROL_PAR_BG_ALPHA,0)
hide_part($wf1,$HIDE_PART_BG)
move_control_px($wf1, 25, 125)
declare ui_waveform $wf2(10,10)
set_control_par(get_ui_id($wf2), $CONTROL_PAR_WIDTH, 281)
set_control_par(get_ui_id($wf2), $CONTROL_PAR_HEIGHT,70)
set_control_par(get_ui_id($wf2), $CONTROL_PAR_WAVE_COLOR, 11186870)
set_control_par(get_ui_id($wf2),$CONTROL_PAR_BG_ALPHA,0)
hide_part($wf2,$HIDE_PART_BG)
move_control_px($wf2, 650, 125)
declare $noteID
declare $noteID2
declare $i
declare %activeevents[500]
end on
on note
$noteID := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
set_event_par_arr($noteID, $EVENT_PAR_ALLOW_GROUP, 0, $ALL_GROUPS)
set_event_par_arr($noteID, $EVENT_PAR_ALLOW_GROUP, 1, 0)
wait(1)
attach_zone($wf1,get_event_par($noteID,$EVENT_PAR_ZONE_ID), 0)
$noteID2 := play_note($EVENT_NOTE,$EVENT_VELOCITY,0,-1)
set_event_par_arr($noteID2, $EVENT_PAR_ALLOW_GROUP, 0, $ALL_GROUPS)
set_event_par_arr($noteID2, $EVENT_PAR_ALLOW_GROUP, 1, 1)
wait(1)
attach_zone($wf2,get_event_par($noteID2,$EVENT_PAR_ZONE_ID), 0)
get_event_ids(%activeevents)
end on
on listener
if ($NI_SIGNAL_TYPE = $NI_SIGNAL_TIMER_MS)
$i := 0
while($i < 500)
if(get_event_par_arr(%activeevents[$i], $EVENT_PAR_ALLOW_GROUP, 0) = 1)
set_ui_wf_property($wf1,$UI_WF_PROP_PLAY_CURSOR,0,get_event_par(%activeevents[$i],$EVENT_PAR_PLAY_POS)-1)
end if
inc($i)
end while
$i := 0
while($i < 500)
if(get_event_par_arr(%activeevents[$i], $EVENT_PAR_ALLOW_GROUP, 1) = 1)
set_ui_wf_property($wf2,$UI_WF_PROP_PLAY_CURSOR,0,get_event_par(%activeevents[$i],$EVENT_PAR_PLAY_POS)-1)
end if
inc($i)
end while
end if
end on