Skip to content

Instantly share code, notes, and snippets.

View Jojo-Schmitz's full-sized avatar

Joachim Schmitz Jojo-Schmitz

  • Düsseldorf, Germany
  • 03:58 (UTC +02:00)
View GitHub Profile
@Jojo-Schmitz
Jojo-Schmitz / gist:4202198
Last active October 13, 2015 13:27 — forked from lasconic/gist:975969
Applying a function to each note in a selection or the entire score
// Apply the given function to all notes in selection
// or, if nothing is selected, in the entire score
function applyToNotesInSelection(func) {
if (typeof curScore === 'undefined')
return;
var cursor = new Cursor(curScore);
cursor.goToSelectionStart();
var startStaff = cursor.staff;
cursor.goToSelectionEnd();