1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

displaying the current position in waveform: problems with long samples

Discussion in 'Scripting Workshop' started by bosone, Mar 31, 2016.

  1. bosone

    bosone NI Product Owner

    Messages:
    164
    i'm trying to visualize the waveform and the current playing position in the performance view.
    i more or less accomlpished what i needed but i found an odd behaviour with long samples

    i'm using the examples from the manual:

    on init
    declare $play_pos
    declare ui_waveform $Waveform(6,6)
    attach_zone ($Waveform,find_zone ("Test"),0)
    end on

    on note
    while ($NOTE_HELD = 1)
    $play_pos := get_event_par($EVENT_ID,$EVENT_PAR_PLAY_POS)
    set_ui_wf_property($Waveform,$UI_WF_PROP_PLAY_CURSOR,0,$play_pos)
    wait (10000)
    end while
    end on

    if the sample is "too long" (e.g. i have 8 bar loops), i notice that $play_pos variables exceed a maximum value (don't know how much...) and the player bar does not reach sample end. Even if the sample is correctly playing, on the waveform display the player bar reset to the sample start and the "current position" displayed is lost.

    is it a bug? do i miss something? is there a workaround?