Next: , Previous: Mark Events (Lisp), Up: Lisp Examples


7.8 Grace Notes

7.8.1 Specifying Grace Notes

Grace notes are created by supplying a value to the grace parameter. The time, grace and duration parameters together determine where the grace note appears and how it is spelled rhythmically. time indicates the time of the event before which the grace note appears (grace notes with the same time are beamed together as a group). grace can be thought of as a pseudo-time “within” the normal time specified by time. For example, grace notes with earlier grace values appear before grace notes with later grace values, and grace notes with equivalent grace values are grouped into chords. duration in the context of a grace note is interpreted in a manner consistent with normal note durations. For example, if a duration of 1/2 is normally notated as an eighth note (the default behavior), a grace note with a duration of 1/2 is also notated as a (small-sized) eighth note.

In the example below, the time values of the grace notes determine which quarter notes they appear in front of. grace values in each group begin at 0 and increment by the value of duration, which in this case is always 1/4 (a sixteenth note).

(defun notes (n)
  (loop
     repeat n
     for tim from 0
     do (fms:note :time tim :dur 1
                  :pitch (+ 48 (random 25)))))

(defun gracenotes (n)
  (loop
     repeat n
     for tim from 0
     do (loop
           repeat (random 3)
           for g from 0 by 1/4
           do (fms:note :time tim :dur 1/4
                        :grace g
                        :pitch (+ 48 (random 25))))))

(fms:with-score (:filename *filename*)
  (notes 20)
  (gracenotes 16))

lsp019.png

Figure 7.40: Grace Notes

The following example includes slash marks, and also shows that FOMUS still outputs consecutive grace notes despite the different grace values given (they don't begin at 0 and increment by 1). (The slashes only appear on the single grace notes.)

(defun notes (n)
  (loop
     repeat n
     for tim from 0
     do (fms:note :time tim :dur 1
                  :pitch (+ 48 (random 25)))))

(defun gracenotes (n)
  (loop
     repeat n
     for tim from 0
     do (loop
           repeat (random 3)
           for g from 1
           do (fms:note :time tim :dur 1/4
                        :grace g
                        :pitch (+ 48 (random 25))
                	:marks '("/")))))

(fms:with-score (:filename *filename*)
  (notes 20)
  (gracenotes 16))

lsp053.png

Figure 7.41: Grace Notes with Slashes

Grace note chords are shown in the following example:

(defun notes (n)
  (loop
     repeat n
     for tim from 0
     do (fms:note :time tim :dur 1
                  :pitch (+ 48 (random 25)))))

(defun gracenotes (n)
  (loop
     repeat n
     for tim from 0
     do (loop
           repeat (random 3)
           for g from 0 by 1/4
           do (loop
                 repeat (1+ (random 2))
                 do (fms:note :time tim :dur 1/4
                	      :grace g
                	      :pitch (+ 48 (random 25)))))))

(fms:with-score (:filename *filename*)
  (notes 20)
  (gracenotes 16))

lsp054.png

Figure 7.42: Grace Note Chords