Class NOTE
Prev | Chapter 4. Objects | Next

## Class NOTE

The `NOTE` object will usually be the only object required to describe musical events that occur in the score. It allows the user to specify pitch, offset and duration as well as which voice the event belongs to. A special slot, `MARKS`, allows for a wide variety of other information including articulations, clef and staff change overrides, "spanners" like slurs or dashed lines with text, etc.. `NOTE`, `REST` and `MARK` objects are all considered "events," and so all of their important accessors begin with an `EVENT-` prefix.

`NOTE` objects are passed to FOMUS by including them either in the `EVENTS` slot list of a `PART` object or in the global `EVENTS` list. `NOTE` objects listed inside a part apply only to that part (unless the `PARTID` slot indicates otherwise). `NOTE` objects in the `EVENTS` list are distributed to parts according to the contents their `PARTID` slot values.

Constructor: `(MAKE-NOTE &key :ID `id` :PARTID `partid` :VOICE `voice` :OFF `off` :DUR `dur` :NOTE `note` :MARKS `marks`)`

Copy Function: `(COPY-NOTE `note` &key :ID `id` :PARTID `partid` :VOICE `voice` :OFF `off` :DUR `dur` :NOTE `note` :MARKS `marks`)`

Predicate Function: `(NOTEP `obj`)`

Accessors:

`OBJ-ID`

  This slot isn't used by FOMUS.

`EVENT-PARTID`

  This is a reference to a particular part or group of parts. If the value of this slot is `NIL`, the event is included in whatever part contains it in its `EVENTS` slot list, or to all parts if it is included in the global `EVENTS` list. If the value is a symbol, number, or list of symbols or numbers, these values are used to lookup which part or parts the event belongs to. Events belonging to multiple parts are effectively copied into these parts.

`EVENT-VOICE`

  This is an integer or a list of integers specifying a voice or selection of voices that this note should belong to. Voice numbers are limited to the integers 1 through 4. The default value `NIL` specifies voice 1. If a list of choices is given, FOMUS's voice distribution algorithm will try to make an intelligent decision based on voice leading, pitch, balance and other factors. Note that `REST` and `MARK` objects are treated slightly differently. Settings with the `VOICE-` prefix can be adjusted to influence FOMUS's voicing decisions. See Settings for more information.

`EVENT-OFF`

  This is a number (real, ratio or integer) specifying the absolute position for the onset for this note. The offset is measured in "beats," which may indicate different notational values depending on what the current time signature is and what value is present in its `BEAT` slot. FOMUS's quantizing algorithm tries to fit all offsets and durations into values that make the best use of tuplets within given constraints while minimizing the amount of error. If this quantizing algorithm is switched off, then the user must insure that all offset and duration values are precise and "notatable" (floating point numbers are not recommended in this case).

`EVENT-DUR`

  This is set to either a number to specify a regular duration or a list to specify a grace note. If it's a number (real, ratio or integer) it indicates the note's duration in beats (see `EVENT-OFF` above). The comments in `EVENT-OFF` on quantization also apply here. If Common Music is present and `USE-CM` is set to `T`, the value of this slot may also be a symbol, which is parsed by CM using its `RHYTHM` function. Symbols in this case designate notational values and not beats, although numbers are still interpreted with respect to beats and not filtered through CM's `RHYTHM` function.

  If a grace note is desired then a list of two elements must be specified, the first element being the duration value described above and the second element being an integer value describing the "position" that the grace note occupies. Grace notes with the same offset are organized with respect to this position number. Lower position grace notes occur earlier in the score than higher position notes. Grace notes with the same position form chords, and notes with negative positions are notated with a slash. The duration value at the front of the list is still interpreted in terms of beats and notated as such even though the note does not take up time in the measure. Specifying a duration of `'(1/4 -1)`, for example, specifies a grace sixteenth note with a slash if the current beat is 1/4 (a quarter note).

`EVENT-NOTE`

  This slot either designates a pitch (with an optional choice of spellings) or a percussion instrument if the part is a percussion part. If specifying a pitch, the value may be either a symbol or a number (real, ratio or integer). If a number is used, 60 represents middle C, as in a MIDI file. Numbers are rounded depending on the whether semitones or quartertones are specified (see the `QUARTERTONES` setting). Symbols are assembled by concatenating a note letter name (`A` through `G`), a `+` or `S` for sharp or a `-` or `F` for flat, and an integer designating the register (`4` is the octave above middle C). A few examples are given here:

  Example 4.3. EVENT-NOTE Slot Setting 1

      'c+4

  Example 4.4. EVENT-NOTE Slot Setting 2

      'ef5

  Quartertones must be specified using numbers. If Common Music is present and `USE-CM` is set to `T`, symbols are filtered through CM's `KEYNUM` function. In this case, the value of `CM-SCALE` will also be passed to the function if it is set to anything other than `NIL`.

  If a list of spelling choices is supplied, FOMUS will try to use the note spellings in this list. To specify one, the value of the `NOTE` slot must be a list, the first element of which is the note number or symbol described above and the rest of which is the list of spelling choices. A spelling choice is represented either by a number or symbol. `1`, `+` or `S` designates using a sharp while `-1`, `-` or `F` designates a flat. `0`, `N` designates a natural while repeating one of the above symbols (for example, `++` or `SS`) designates a double sharp or flat. `2` or `-2` also designates a double sharp or flat. Quartertones spellings are specified using a list of two elements, the first element specifying the semitone alteration and the second element specifying the quartertone alteration (one of the numbers `-1/2`, `0` or `1/2`). A few examples are given here:

  Example 4.5. EVENT-NOTE Slot Setting 3

      '(f4 + --)

  Example 4.6. EVENT-NOTE Slot Setting 4

      '(61.5 (n -1/2))

  If FOMUS's note spelling algorithm is switched off then all note spellings must be supplied by the user (so each `NOTE` slot must contain a list of two elements specifying the pitch and its spelling, unless it is spelled with a natural).

`EVENT-MARKS`

  This slot is nearly equivalent to the `MARKS` slot in the `MARK` class described below. The contents of the `MARKS` slots of `MARK` objects are actually dumped into the `MARKS` slots of `NOTE` and `REST` objects once voices and staves have been decided. See the `MARK` class for more information and Marks for a more detailed explanation of marks and their usage.

Prev | Up | Next
Class KEYSIG | Home | Class REST