Cursor
Can I have several cursor objects? I want one cursor to go through the score (or a selection). For each element of interest I want another cursor checking forward some 960 midi ticks from this element. After that, the first cursor would continue.
If I create two cursors like this:
var cursor = curScore.newCursor();
var backbeat = curScore.newCursor();
...they become the same cursor. backbeat.next() seems to advance cursor, too.
What I want to do is search for dotted 1/8 notes, where they are on 1/4 beat. So far my code works. When found, I want to check if there's a 1/16 note 360 ticks further from the dotted 1/8. So I thought I could have another cursor searching for such 1/16 note, while the first cursor stays on the dotted 1/8. If found, I would make changes to the note or chord at both spots. Therefore it would be convenient to actually have the two cursors, instead of going back and forth with one cursor. Do I have too great expectations for the cursor object?
Comments
on ms3.6.2
In reply to on ms3.6.2 [inline:2cursors… by msfp
Ok, I made a bad assumption. I wrote this:
backbeat = cursor;
...where I only wanted both to point to same spot in the score. The right method is this:
backbeat.rewindToTick(cursor.tick);
And I'm back on track.