can you change position of controlP5 Matrix "playhead" (trigger line)

I am working on a sort of sequencer project where I want to be able to change the trigger line position with a slider so I can show the user what column they are working on.

here is the code for the time controlling slider, where LED_sequence is the Matrix. This code works to trigger the correct columns when the slider is moved, but the blue trigger line for the matrix is not moved.

void timeline(int frame) {
  cp5.get(Matrix.class,"LED_sequence").trigger(frame); //this triggers the column
  cp5.getController("LED_sequence").setValue(frame);  //this seems to do nothing
}
Tagged:

Answers

  • An update - I see from the source code for controlP5 that what I need is to change the value of a protected variable "cnt" whenever I send a trigger command. It is easy to change this in the Java source, but I dont really want to recompile the whole .jar - any suggestions for a quick workaround? can I access a protected variable in the Matrix class directly?

  • edited November 2013

    I figured out how to use the terminal to recompile controlP5 with my new feature - yay! Now if only I could mark this as answered. The answer is no, you cannot move the trigger line w/o changing the source code.

Sign In or Register to comment.