Next: , Previous: Setup, Up: Tutorial

4.2 Tutorial of Basic Features

Welcome to the tutorial.

4.2.1 Entering Notes

To start out with, here is a single line of a FOMUS input file. It specifies a single note:

time 0 dur 1 pitch 60 ;


Figure 4.1: Single Note

There are four parts to this note entry or “event.” First the keyword time followed by a ‘0’ indicates that the time for the event being defined is 0. 0 is always the downbeat of the first measure in the score. dur followed by ‘1’ indicates that the duration for the event is 1. The time and duration units are in “beats,” which by default is equivalent to a quarter note (this can easily be changed). pitch followed by ‘60’ indicates that the event has a pitch of 60, which is defined to be middle C or C4. The final ; at the end of the line functions as an enter command, telling FOMUS to take all of the values just specified and create a note event.

Let's add a few more notes:

// this is a comment
/- this is a
   multi-line comment -/

time 0 dur 1 pitch 60 ;
time 1 dur 1 pitch 62 ;
time 2 dur 1 pitch 64 ;
time 3 dur 1 pitch 65 ;
time 4 dur 1 pitch 67 ;
time 5 dur 1 pitch 65 ;
time 6 dur 1 pitch 64 ;
time 7 dur 1 pitch 62 ;
time 8 dur 1 pitch 60 ;


Figure 4.2: More Notes

This is the most straightforward way of entering note events. Simply list each one, giving all of their attributes followed by ;. Two different ways of entering comments are also shown—either prefix a single line with double slashes (‘//’) to tell FOMUS to skip the rest of the line or surround a block of text with ‘/-’ and ‘-/’ to tell FOMUS to skip that block. In each of these examples FOMUS assumes a default meter signature of 4/4 and a key signature of C major. Later on we will look at how to change these.

dur 1
time 0 pitch c4 ;
time 1 pitch d ;
time 2 pitch e ;
time 3 pitch f ;
time 4 pitch g ;
time 5 pitch f ;
time 6 pitch e ;
time 7 pitch d ;
time 8 pitch c ;


Figure 4.3: Shortcut

In this example, the duration was only given once at the top of the file. There is no ; following it, so no note event is entered after FOMUS reads the first line. The second line specifies the time and pitch and “inputs” the note with a ;. The rest of the note events are entered this way also. When dur is set, then, it behaves as a variable or “placeholder” that retains its value until the next time it occurs in the file. As FOMUS reads the file from top to bottom, it keeps track of dur and uses the last value it read whenever it encounters a ;. A more visual way of understanding this is that dur at the top modifies everything that appears below it (up to the next appearance of dur).

The pitches are also specified as symbols and should be significantly easier to read than the previous example. After specifying C4 (middle C), each of the following note symbols represent the pitch in the octave that is as close as possible to the previous note symbol. Although these don't appear until later, flat alterations are specified with ‘-’ or ‘f’s and sharps are specified with ‘+’ or ‘s’ (these are alterations in pitch and not actual spellings).

The following example contains a chord and an alternate way of specifying time:

time 0 dur 1
  pitch c4 ;
  pitch e ;
  pitch g ;
time + dur 1/2 pitch d ;
time + dur 1 pitch e ;
time + dur 1/2 pitch f ;
time + dur 1/2 pitch g ;
time + dur 1 pitch f ;
time + dur 1/2 pitch e ;
time + dur 1/2 pitch d ;
time + dur 1+1/2 pitch c ;


Figure 4.4: Chord

In the first four lines, time and duration remain the same as three pitches are entered. This forms a chord at time 0. The ‘1/2’'s are rational numbers and the ‘1+1/2’ is a mixed number (1/2 is added to 1). The ‘+’ after the times is a shortcut symbol that means “increment the time by as much as the previous duration.” The time in line 5, then is 1, since the duration of the first event is 1. The next event has a time of 1+1/2, etc..

There are many more shortcuts like this designed to make editing note events easier. See `.fms' File Features for more information.

4.2.2 Parts and Instruments

FOMUS always needs at least one part to be defined to process a score. If none is specified, then FOMUS provides a default part for you. The examples above all have default parts. In the next example, we'll create a part for an oboe and make a little oboe piece.

part <id: mypart inst: oboe>

part mypart
time 1/3 dur 1/3 pitch 70 ;
time + dur 1/3 pitch 69 ;
time + dur 1 pitch 68 ;
time + dur 1/4 pitch 65 ;
time + dur 1/4 pitch 66 ;
time + dur 1/2 pitch 68 ;


Figure 4.5: Part

In .fms files the ‘<’ and ‘>’ signs are used to define “objects.” Anything inside the ‘<’ and ‘>’ is part of the definition of that object and the keyword preceding the ‘<’ specifies the type of object (in this case a part object). In FOMUS, parts, instruments, notes, measures, staves, clefs and the score itself are all objects (for a complete list, see Reference), the majority of which can be defined using this syntax.

In the part being created here there are two “settings,” (id) and (inst). id followed by ‘:’ and then ‘mypart’ specifies that this part is to be referred to as ‘mypart’. The colon is optional, but it helps to distinuish between pairs of keywords and values when there are many of them (colons can also be placed after parameters like time, dur or pitch). inst followed by a another string chooses one of FOMUS's built-in instruments and bases the part on that instrument.

After the part is declared the notes are listed as before. There's a new parameter now, part, which chooses the part that events belongs to by its ID string. Setting part to ‘mypart’ at the top of the file causes all of the following note events to belong to that part (i.e., part is another parameter that behaves like time or pitch).

The next example contains a few more definitions:

title: "Piece for Electric Viola"
author: "David Psenicka"
quartertones: yes

inst <id: elvla template: viola
      name: "Electric Viola" abbr: "evla">
part <id: mypart inst: elvla>

part: mypart
time: 0.0 dur: 0.333 pitch: 70.1 ;
time: 0.333 dur: 0.666 pitch: 65.6 ;
time: 1.0 dur: 2.0 pitch: 68.4 ;


Figure 4.6: Instrument Definition

Some strings are now enclosed in quotes. This is necessary when they contain spaces or characters that might be confused with the surrounding context (like ‘:’ or ‘>’).

Some score settings, title, author and quartertones, are being defined in the example above. The strings following title and author, for example, should appear at the top of the first page of the score. quartertones activates quartertones for the entire piece, meaning any pitch values entered will be quantized to the nearest half of a semitone. The pitch numbers now all have decimal points to demonstrate this. FOMUS quantizes ‘70.1’ to 70 and ‘65.6’ to 65.5, which is a quartertone sharp from note 65. title, author and quartertones are part of the definition of the entire score (or score object)—in a .fms file score settings like these always must appear at the top of the file before anything else is defined.

In this example a new instrument is defined on which our part is based. template specifies that the definition is to be based on FOMUS's built-in viola instrument. name and abbr override the name and abreviated name of the built-in instrument, respectively. These are the texts that appear in the score to the left of the staff systems. Also, since we've set the ID to ‘elvla’, the inst setting in the part definition is now ‘elvla’, referencing the new instrument.

The time values are also different this time because they are floating point numbers with decimal points. FOMUS quantizes these to the closest rhythmic representation it can find, searching through all combinations of metrical divisions and tuplets that it considers valid and choosing the one that provides the closest fit. This allows FOMUS to handle a certain amount of imprecision in its input and find reasonable rhythmic spellings for times durations that aren't obvious as in the example above.

In the next example, equals signs are used instead of the colons of the previous example (you can actually use ‘=’, ‘:’ or nothing for any assignment, depending on your visual preference).

title = "Electric Canon"
layout-def = (elvla piano)

tuplets = 3
min-tupletdur = 1

inst <id = elvla template = viola>

part <id = p1 inst = elvla
      name = "Electric Viola 1" abbr = "evla 1">
part <id = p2 inst = elvla
      name = "Electric Viola 2" abbr = "evla 2">
part <id = acomp inst = piano>

time = 0 dur = 3 ||

part = p1
voice = 1
time = 0 dur = 1/3 pitch = 60 ;
time = + dur = 1/3 pitch = 59 ;
time = + dur = 1 pitch = 58 ;
time = + dur = 1/2 pitch = 55 ;
time = + dur = 1/2 pitch = 56 ;
time = + dur = 1/2 pitch = 58 ;

part = p2
voice = 1
time = 2 dur = 1/3 pitch = 60 ;
time = + dur = 1/3 pitch = 59 ;
time = + dur = 1 pitch = 58 ;
time = + dur = 1/2 pitch = 55 ;
time = + dur = 1/2 pitch = 56 ;
time = + dur = 1/2 pitch = 58 ;

part = acomp
voice = (1 2)
time = 1 dur = 1/3 pitch = 72 ;
time = + dur = 1/3 pitch = 71 ;
time = + dur = 1 pitch = 70 ;
time = + dur = 1/2 pitch = 67 ;
time = + dur = 1/2 pitch = 68 ;
time = + dur = 1/2 pitch = 70 ;

time = 3 dur = 1/3 pitch = 48 ;
time = + dur = 1/3 pitch = 47 ;
time = + dur = 1 pitch = 46 ;
time = + dur = 1/2 pitch = 43 ;
time = + dur = 1/2 pitch = 44 ;
time = + dur = 1/2 pitch = 46 ;


Figure 4.7: Instruments with Layout

layout-def is defines a score “layout” and is set to a list of instrument IDs (denoted with ‘(’ and ‘)’) specifying the order in which instruments should appear in the score. tuplets defines the highest tuplet that FOMUS is allowed to use (a triplet) and min-tupletdur defines the smallest duration a tuplet allowed is allowed to span (in this case no less than a quarter note in duration). This time the ‘name’ and ‘abbr’ settings appear in the parts, overriding the settings defined in the instruments. That enables us to assign separate names and abbrievated names to two different parts based on the same instrument.

A new note parameter, voice is also being used here. Note events in a part may belong to one of several different voices. Since voice wasn't specified up until now, the default value was always ‘1’. The voice in part ‘acomp’ is set to ‘(1 2)’, which specifies a choice. This indicates that the following note events can be in either voice 1 or 2 and that it's up to FOMUS to figure out which one is appropriate. This option of specifying a choice only works with the voice parameter and is most useful when importing data from a file where seperate voices might be mixed together in one track.

The double pipe ‘||’ above the first part signifies the downmbeat of a measure. ‘||’ is just a shortcut for ‘meas <>’, a definition of a measure object with the same basic syntax as the part and inst definitions above. Settings for the measure go in between the two ‘|’'s (examples of this will follow). Measures use two of the same attributes that notes do, time and duration, which is why both appear before the ‘||’. time specifies where the downbeat of the measure falls and dur is simply the duration of the measure. Although it is possible to specify one, there is no time signature given—FOMUS's figures out what the time signature from the duration and several other settings.

Also, only one measure is specified here. FOMUS automatically fills in areas of the score where measures aren't explicitly defined by repeating the measures you've defined. In the example above, FOMUS generates a measure at time 3 by repeating the measure given to it at time 0. You only need to define measures when a significant change occurs—for example, a change in key signature (an example of this appears later).

4.2.3 Marks

Articulations, special techniques, text markings, vocal texts, tremolos, trills and harmonics, and many other score items are created using “marks.” In .fms files, the syntax for a mark is to enclose a symbol within two brackets ‘[]’ and to place this anywhere before the “enter” semicolon. The following example shows how to add a few simple articulation marks.

part <id: mypart inst: violin>

part mypart
dur 1/2
time 1 pitch 67 [.] ;
time + pitch 67 [.] ;
time + pitch 67 [.] ;
time + pitch 67 [.] ;
time +
time + pitch 67 [>] ;
time + pitch 67 [>] ;
time +
time + pitch 67 [/.] ;
time + pitch 67 [/.] ;


Figure 4.8: Articulation Marks

Marks don't “stick” or retain their values like time, duration or other parameter values. They must be placed in every note entry where they are to appear in the score.

Some marks come in pairs, and are referred to in the documentation as “spanners.” Spanners represent markings that are attached to more than one note or extend over a section the score. Examples of such marks are slurs and crescendo wedges, shown here:

duration 1/4
time 0 pitch 55 [(..];
time + pitch 56;
time + pitch 57;
time + pitch 56 [..)];
time + pitch 55 [(..];
time + pitch 56;
time + pitch 57;
time + pitch 56 [(..];
time + pitch 55;
time + pitch 56 [(..];
time + pitch 57 [(..];
time + pitch 56;
time + pitch 55;
time + pitch 56;
time + pitch 57 [..)];
time + pitch 56;
time + pitch 55 [<..];
time + pitch 56;
time + pitch 57;
time + pitch 56 [..<];
time + pitch 55 [>..];
time + pitch 56;
time + pitch 57;
time + pitch 56 [<..];
time + pitch 55;
time + pitch 56 [>..];
time + pitch 57 [<..];
time + pitch 56;
time + pitch 55;
time + pitch 56;
time + pitch 57 [..<];
time + pitch 56;


Figure 4.9: Spanner Marks

Mark symbols that begin a spanner have a ‘..’ appended to them, while symbols ending a spanner have a ‘..’ prepended to them. It is not always necessary to include both. For example, the first slur above is defined with both the begin and end marks, but the second slur is defined with only one begin mark. The end is placed right before the next begin mark on the eighth sixteenth note of the measure. The slur over the tenth note into the measure doesn't appear at all, since it must span a single note and therefore wouldn't make any sense.

The following illustrates several special notations that can be defined using marks:

part <id: vln inst: violin>

dur 1
time 0 pitch 60 [trem] ;
time + pitch 60 [trem 1/2] ;
time + pitch 60 [trem 1/4] ;

dur 1
time 4
  pitch 60 [trem] ;
  pitch 63 [trem2] ;
time +
  pitch 60 [trem 1/2] ;
  pitch 63 [trem2] ;
time +
  pitch 60 [trem 1/4] ;
  pitch 63 [trem2] ;

dur 2
time 8 pitch 60 [longtr] ;
time +
  pitch 62 [longtr] ;
  pitch 64 [longtr2] ;
time +
  pitch 61 [longtr] ;
  pitch 63 [longtr2] ;
time +
  pitch 60 [longtr] ;
  pitch 62 [longtr2] ;

dur 2
time 16
  pitch a5 [natharm-sounding] ;
time +
  pitch b5 [natharm-sounding] ;
time +
  pitch b5 [artharm-sounding] ;


Figure 4.10: Special Marks

The trem marks are examples of marks that take arguments. Mark arguments always appear inside the brackets and after the mark symbol. The 1/2 argument represents the duration of a tremolo repetition (an eighth note in this case) and determines the number of slashes that appear across the note stem. The trem2 mark is used along with trem to denote multiple-note or multiple-chord tremolos. longtr and longtr2 function in a similar fashion to notate trills. natharm-sounding and artharm-sounding denote the sounding pitch of a natural and artificial harmonic, respectively. Although there are other marks for specifying touched, played and open string pitches, in the absence of any other information FOMUS finds the easiest method of playing the harmonic and notates it accordingly.

4.2.4 Settings

Parameters such as name, abbr, title, tuplets, etc. so far have been referred to as “settings.” Besides defining objects and specifying note events, FOMUS's behavior is completely controlled by changing the values of these settings. Where settings appear determine the scope in which they are effective. For example, the tuplets and min-tupletdur settings in the last tutorial section were defined at the score level and are effectively default values for the entire score. The same settings could also appear in a part definition or a measure, overriding the score-level values. By placing settings in different object definitions like this you can control FOMUS's behavior in different sections of the score.

So far settings have been defined in scores (at the top of the file), parts and instruments. The following example shows a few more places where settings can be set:

beat: 1/8
timesig-den: 8

part <id: apart inst: piano>

time: 0 dur: 4 |keysig: dmaj|
  time: 0 dur: 1 pitch: d4 staff: 1 ;
  time: + dur: 1 pitch: e4 staff: 2 ;
  time: + dur: 1 pitch: f+4 ;
  time: + dur: 1 pitch: g4 ;
  time: + dur: 1 pitch: a4 ;
  time: + dur: 1 pitch: b4 ;
time: 8 dur: 4 |keysig: b-maj|
  time: 8 dur: 1 pitch: d4 staff: 1 ;
  time: + dur: 1 pitch: e4 staff: 2 ;
  time: + dur: 1 pitch: f+4 ;
  time: + dur: 1 pitch: g4 ;
  time: + dur: 1 pitch: a4 ;
  time: + dur: 1 pitch: b4 ;


Figure 4.11: Settings in Various Locations

The measures in this example contain keysig settings which have the effect of changing the key signature at that measure. ‘dmaj’ and ‘b-maj’ signify D major and B-flat major. Also attached to some of the notes is the staff setting which forces FOMUS to choose one staff over another (staff 1 is on top and staff two is on the bottom). FOMUS places the notes with staff settings in the requested staff and does its best to make the remaining staff choices fit. Even though ‘staff: 2’ looks like any of the other parameters for note events (i.e., time, dur, pitch, part or voice), it behaves differently. The value doesn't “stick” and must be repeated for every note entry (like a mark).

The global setting beat at the top of the file is extremely useful. It defines 1 beat (i.e., a duration of 1) to be equivalent to an eighth note. timesig-den specifies that all time signatures should have a base denominator of 8.