Next: Microtonal Notation (Lisp), Previous: Treating Multiple Parts as One (Lisp), Up: Lisp Examples
FOMUS's built-in ‘orchestra’ layout is shown here.
Setting layout
to ‘orchestra’ effectively sorts the parts and groups them so that they appear as they should in an orchestral score.
(defparameter *parts* '((:id "fl1" :name "Flute 1" :inst "flute") (:id "fl2" :name "Flute 2" :inst "flute") (:id "cl2" :name "Clarinet 1" :inst "bflat-clarinet") (:id "vln1" :name "Violin 1" :inst "violin") (:id "vln2" :name "Violin 2" :inst "violin") (:id "vc1" :name "Cello 1" :inst "cello") (:id "vc2" :name "Cello 2" :inst "cello") (:id "tba" :name "Tuba" :inst "tuba"))) (defun notes (p) (loop for tim from 0 for n in '(60 62 64) do (fms:note :part p :time tim :dur 1 :pitch n))) (defun parts (ps) (loop for p in ps do (notes p))) (fms:with-score (:filename *filename* :sets '(:layout "orchestra") :parts *parts*) (parts '("fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"))) |
|
Figure 7.70: Orchestra Layout
The layout is changed to ‘small-ensemble’ in this example.
(defparameter *parts* '((:id "fl1" :name "Flute 1" :inst "flute") (:id "fl2" :name "Flute 2" :inst "flute") (:id "cl2" :name "Clarinet 1" :inst "bflat-clarinet") (:id "vln1" :name "Violin 1" :inst "violin") (:id "vln2" :name "Violin 2" :inst "violin") (:id "vc1" :name "Cello 1" :inst "cello") (:id "vc2" :name "Cello 2" :inst "cello") (:id "tba" :name "Tuba" :inst "tuba"))) (defun notes (p) (loop for tim from 0 for n in '(60 62 64) do (fms:note :part p :time tim :dur 1 :pitch n))) (defun parts (ps) (loop for p in ps do (notes p))) (fms:with-score (:filename *filename* :sets '(:layout "small-ensemble") :parts *parts*) (parts '("fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"))) |
|
Figure 7.71: Ensemble Layout
The two default layouts shown above only work if you also use FOMUS's built-in instruments.
If you define new instruments (with IDs that are different from the built-in ones) and want to order and group them correctly, or
you want a different layout than the default built-in ones, you must set either layout-def
or layout-defs
.
A simple example is shown below:
(defparameter *parts* '((:id "fl1" :name "Flute 1" :inst "flute") (:id "fl2" :name "Flute 2" :inst "flute") (:id "cl2" :name "Clarinet 1" :inst "bflat-clarinet") (:id "vln1" :name "Violin 1" :inst "violin") (:id "vln2" :name "Violin 2" :inst "violin") (:id "vc1" :name "Cello 1" :inst "cello") (:id "vc2" :name "Cello 2" :inst "cello") (:id "tba" :name "Tuba" :inst "tuba"))) (defun notes (p) (loop for tim from 0 for n in '(60 62 64) do (fms:note :part p :time tim :dur 1 :pitch n))) (defun parts (ps) (loop for p in ps do (notes p))) (fms:with-score (:filename *filename* :sets '(:layout-def ([ [ piccolo flute ] [ oboe english-horn ] [ bflat-clarinet bass-clarinet ] ] * [ tuba ] * [ [ violin ] [ viola ] [ cello ] [ contrabass ] ])) :parts *parts*) (parts '("fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"))) |
|
Figure 7.72: Layout Definition
In layout-def
, instrument IDs are listed in the order they should appear in the score.
Instruments are grouped together with a bracket on the left side of the staff system by surrounding the IDs with ‘[’ and ‘]’ (they can also be nested).
The ‘*’ indicates the location where tempo markings and other system-wide marks may appear (there's no need to put a ‘*’ at beginning of the list—FOMUS
always places these marks at the top of the system in addition to the locations you specify).
If you find yourself reusing the same layouts or need to redefine layouts to include your own custom instruments, 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).
layout-defs += (myorchlayout: ([ [ piccolo flute ] [ oboe english-horn ] [ bflat-clarinet bass-clarinet ] ] * [ [ violin ] [ viola ] [ cello ] [ contrabass ] ]))
After you do this, you can then set layout
to ‘myorchlayout’ to specify your custom layout.