Sibelius ManuScript Language Tutorial
13
Notice that bars and staves are numbered from 1 upwards; in the case of bars, this is irrespective of any bar number changes that are in
the score, so the numbering is always unambiguous. In the case of staves, the top staff is no.1, and all staves are counted, even if they’re
hidden. Thus a particular staff has the same number wherever it appears in the score.
The AddText method for bars is documented later, but the first parameter it takes is a rhythmic position in the bar. Each note in a bar
has a rhythmic position that indicates where it is (at the start, one quarter after the start, etc.), but the same is true for all other objects
in bars. This shows where the object is attached to, which in the case of Technique text is also where the left hand side of the text goes.
Thus to put our text at the start of the bar, we used the value 0. To put the text a quarter note after the start of the bar, use 256 (the units
are 1024th notes, so a quarter is 256 units):
bar.AddText(256,text,"Technique");
To avoid having to use obscure numbers like 256 in your program, there are predefined variables representing different note values
(which are listed later), so you could write:
bar.AddText(Quarter,text,"Technique");
or to be quaint you could use the British equivalent:
bar.AddText(Crotchet,text,"Technique");
For a dotted quarter, instead of using 384 you can use another predefined variable:
bar.AddText(DottedQuarter,text,"Technique");
or add two variables:
bar.AddText(Quarter+Eighth,text,"Technique");
This is much clearer than using numbers.
The System Staff
As you know from using Sibelius, some objects don’t apply to a single staff but to all staves. These include titles, tempo text, rehearsal
marks and special barlines; you can tell they apply to all staves because (for instance) they get shown in all the instrumental parts.
All these objects are actually stored in a hidden staff, called the system staff. You can think of it as an invisible staff which is always
above the other staves in a system. The system staff is divided into bars in the same way as the normal staves. So to add the title “Potato”
to our score we’d need the following code in our plug-in:
sys = newscore.SystemStaff; // system staff is a variable
bar = sys.NthBar(1);
bar.AddText(0,"POTATO SONG","Subtitle");
As you can see, SystemStaff is a variable you can get directly from the score. Remember that you have to use a system text style (here
Subtitle is used) when putting text in a bar in the system staff. A staff text style like Technique won’t work. Also, you have to specify
a bar and position in the bar; this may seem slightly superfluous for text centered on the page as titles are (though in reality even this
kind of page-aligned text is always attached to a bar), but for Tempo and Metronome mark text they are obviously required.
Representation of Notes, Rests, Chords, and Other Musical Items
Sibelius represents rests, notes and chords in a consistent way. A rest has no noteheads, a note has 1 notehead and a chord has 2 or more
noteheads. This introduces an extra hierarchy: most of the squiggles you see in a score are actually a special type of Bar object that can
contain even smaller things (namely, noteheads). There’s no overall name for something which can be a rest, note or chord, so we’ve
invented the pretty name NoteRest. A NoteRest with 0, 1 or 2 noteheads is what you normally call a rest, a note or a chord, respec-
tively.
If n is a variable containing a NoteRest, there is a variable n.NoteCount which contains the number of notes, and n.Duration
which is the note-value in 1/256ths of a quarter. You can also get n.Highest and n.Lowest which contain the highest and lowest
notes (assuming n.NoteCount isn’t 0). If you set lownote = n.Lowest, you can then find out things about the lowest note, such
as lownote.Pitch (a number) and lownote.Name (a string). Complete details about all these methods and variables may be found
in Object Reference.
Other musical objects, such as clefs, lines, lyrics and key signatures have corresponding objects in ManuScript, which again have var-
ious variables and methods available. For example, if you have a Line variable ln, then ln.EndPosition gives the rhythmic posi-
tion at which the line ends.