Next: , Previous: Treating Multiple Parts as One (SAL), Up: SAL Examples


8.14 Score Layout

8.14.1 Layouts

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.

process myproc-notes (p)
  for n in {60 62 64}
  fms:note(part: p, dur: 1, pitch: n)
  wait 1
end

process myproc-parts (ps)
  for p in ps
  sprout(myproc-notes(p))
end

begin
  with 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"}},
       sets = {:layout "orchestra"}
  sprout(myproc-parts({"fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"}),
         *filename*, parts: parts, sets: sets)
end

sal011.png

Figure 8.68: Orchestra Layout

The layout is changed to ‘small-ensemble’ in this example.

process myproc-notes (p)
  for n in {60 62 64}
  fms:note(part: p, dur: 1, pitch: n)
  wait 1
end

process myproc-parts (ps)
  for p in ps
  sprout(myproc-notes(p))
end

begin
  with 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"}},
       sets = {:layout "small-ensemble"}
  sprout(myproc-parts({"fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"}),
         *filename*, parts: parts, sets: sets)
end

sal012.png

Figure 8.69: 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:

process myproc-notes (p)
  for n in {60 62 64}
  fms:note(part: p, dur: 1, pitch: n)
  wait 1
end

process myproc-parts (ps)
  for p in ps
  sprout(myproc-notes(p))
end

begin
  with 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"}},
       sets = {:layout-def {"[" "[" piccolo flute "]"
        		        "[" oboe english-horn "]"
        		        "[" bflat-clarinet bass-clarinet "]"
        		    "]"
        		    "*"
        		    "[" tuba "]"
        		    "*"
        		    "[" "[" violin "]"
        		        "[" viola "]"
        		        "[" cello "]"
        		        "[" contrabass "]"
        		    "]"}}
  sprout(myproc-parts({"fl1" "fl2" "cl2" "vln1" "vln2" "vc1" "vc2" "tba"}),
         *filename*, parts: parts, sets: sets)
end

sal069.png

Figure 8.70: 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).

8.14.2 Layout Library

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.