rewind(2) > crash

• Mar 10, 2010 - 18:29
Type
Plugins
Severity
S4 - Minor
Status
closed
Project

Using nightly r.2862 try this code. for a plugin
having a part of the music selected.

function init () {}
function run () {
var cursor = new Cursor(curScore);
cursor.staff = 0;
cursor.voice = 0;
cursor.rewind(1);
var text = new Text(curScore);
text.text = cursor.chord().topNote().name;
cursor.putStaffText(text);

}
var mscorePlugin = {
menu: 'Plugins.cursors',
init: init,
run: run
};
mscorePlugin;

It will show the name of the first note selected.
If you change cursor.rewind(1); to cursor.rewind(2); It should show the name of the last note selected, except museScore crashes.


Comments