OK – I have to admit, when you realize that you are making software choices based on scripting language support you start to get the feeling that there are times when you just have to accept the fact that you are a geek.
Here’s a case in point: I write music as a hobby, and when shopping for a program to write sheet music with, I chose Sibelius because I discovered that they have a really cool scripting language called “ManuScript“. OK – so the name is kind of silly, but it’s pretty cool to write code with.
The way it works is that you create what Silbelius calls a “plug-in”, and you assign it to a category that will be used as the menu under which your plug-in will be displayed. Once you’ve done all that, you can start writing code.
For example, I needed to add sustain pedal MIDI events to an entire piano score, and doing so manually would have been a tedious exercise. So I made my life easier and created a quick plug-in that adds the MIDI events to apply the sustain pedal at full level to the beginning of every measure, and then adds the MIDI events to lift the sustain pedal at the end of every measure:
// Verify that a score is open.
Sibelius.MessageBox(“Please open a score.”);
// Retrieve a score object for the active score.
score = Sibelius.ActiveScore;
// Retrieve an object for the current selection.
selection = score.Selection;
// Loop through the highlighted measures.
for each Bar b in selection
// Add MIDI sustain pedal events.
// Return a status message.
I should point out, however, that this is meant to be a brief example of what you can do. Running this same plug-in on the same selection will re-add the sustain pedal events to your score; I didn’t add any advanced logic to check for the existance of any prior sustain pedal events. If anyone wants to take on that challenge, have fun and don’t forget to share your results!