cursorTrack.selectNext() and cursorTrack.selectPrevious() not working anymore?

Post Reply New Topic
RELATED
PRODUCTS

Post

Hi,

i have a controller script which is several years old, API 10, which i wanted to change and so i decided to replace it with an extension, API 17.

In the first stage i just added a cursor track and a track bank to the extension. With a knob on the controller i can move the cursor track, calling selectNext() and selectPrevious(), and when it reaches the border of the track bank, the bank is following.

I implemented this 4 months ago. Today i wanted to continue working on the extension but for some reason the cursor track, and so the track bank, is not moving anymore, the position value observer is never called and if i print the position of the cursor track to the console the value is always -1.

I checked the old script and there it is the same problem. Does someone have a clue what is going on?

(No idea if this can have any effect but in the meantime i updated to BW5 and then uninstalled it and installed BW 4.4.10)

Edit: This is basically the code im running.

Code: Select all

public void init()
{
      cursorTrack = host.createCursorTrack("xonecrsrtrck", "Xone Cursor Track", 0, 1, false);
      cursorTrack.position().addValueObserver(this::cursorTrackPositionObserver, 0);
}

public void onMidi(final int statusByte, final int data1, final int data2)
{
      if(data2 == 1)
      {
             cursorTrack.selectNext();
      }
      else
      {
             cursorTrack.selectPrevious();
      }
      
      host.println("onMidi: cursorTrack.position: " + cursorTrack.position().get());
}

public void cursorTrackPositionObserver(int position)
{
        host.println("cursorTrackPositionObserver: position: " + position);
}
On extension start the console output is

Code: Select all

cursorTrackPositionObserver: position: -1
On every midi event the output is

Code: Select all

onMidi: cursorTrack.position: -1
selectNext() and selectPrevious() are executed. I verified it with prints.

Post

It seems that

Code: Select all

host.createCursorTrack("xonecrsrtrck", "Xone Cursor Track", 0, 1, false)
is not working. I replaced it with

Code: Select all

host.createCursorTrack(0, 1)
Now i's working fine again.

Post Reply

Return to “Controller Scripting”