FOMUS has many built-in instruments, but you will probably want to modify some of them or define your own.
The electric viola instrument defined here uses the built-in ‘viola’ instrument as a template,
replacing the values of a few typical settings. name and abbr set the name and abbreviated name of the instrument as it
should appear in the score. min-pitch and max-pitch set the minimum and maximum pitch so that FOMUS prints warning messages if the
pitches fall out of range.
open-strings is a list of pitches representing the open strings of the instrument, used by FOMUS to calculate notation for harmonics.
|
|
Figure 6.52: Instrument Definition
The same instrument is defined inline inside the part in this example.
|
|
Figure 6.53: Inline Instrument Definition
The same instrument is defined once again, only this time without using a template (i.e., the template parameter is missing).
Since the definition is not based on a built-in instrument, some essential pieces of information missing in the above examples must be provided
(the staff and clef definitions, which there are more examples of below).
|
|
Figure 6.54: Templateless Instrument Definition
If you find yourself reusing the same instrument definitions in multiple files,
you could insert something resembling the following in your .fomus file
located in your home directory (make sure you use ‘+=’ instead of ‘=’ to append the values to FOMUS's default list).
See the section below on defining staves in instruments for more on the staves parameter that appears in this example.
inst-defs += (<id: ukulele name: "Ukulele"
staves: <clefs: <instclef: treble>>
min-pitch: 60 max-pitch: 81
open-strings: (67 60 64 69)>
<id: banjo name: "Banjo"
staves: <clefs: <instclef: bass>>
min-pitch: 67 max-pitch: 74
open-strings: (67 50 55 59 62)>)
All of FOMUS's built-in instruments are contained in the file fomus.conf, which is located in /install_prefix/shared/
(install_prefix is most likely /usr/local or /usr).
Below is an instrument definition that contains a grand staff and uses a treble and bass clef.
staves is followed by a list of two staff
definitions.
The clefs parameter inside each staff definition is followed by a list of clef
definitions,
each of which actually represents a clef choice in that staff.
The instclef setting is mandatory and determines the clef sign that appears in the score.
Each of the two staves in the instrument below, then, are allowed to display either a treble or bass clef.
The first clef definition to appear in a list is the default clef, which means that in the example below, the default clef
for staff 1 (the top staff) is treble clef and the default for staff 2 (the bottom staff) is bass clef.
The ledgers-up and ledgers-down settings specify how many ledger lines should be allowed to appear before
FOMUS begins to consider switching staves or clefs. octs-up and octs-down specify whether or not octave change signs
are allowed to appear (a value of 1 means an 8va sign is allowed while a value of 2 means 15va is allowed).
clef-preference affects the probability that FOMUS will choose that clef over other choices
(a value of 2, for example, doubles the chance of it being chosen while a value of 1/2 reduces it by one half).
|
|
Figure 6.55: Staves and Clefs
The following example shows how to define an instrument with a grand staff made up of three staves. Three staff objects are created, each one containing two clef objects representing the choices allowed in that staff.
|
|
Figure 6.56: Instrument with Three Staves