Next: , Previous: Treating Multiple Parts as One (File), Up: `.fms' File Examples


6.14 Score Layout

6.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.

layout = orchestra

// parts
part <id fl1, name "Flute 1", inst flute>
part <id fl2, name "Flute 2", inst flute>
part <id cl2, name "Clarinet 1", inst bflat-clarinet>
part <id vln1, name "Violin 1", inst violin>
part <id vln2, name "Violin 2", inst violin>
part <id vc1, name "Cello 1", inst cello>
part <id vc2, name "Cello 2", inst cello>
part <id tba, name Tuba, inst tuba>

// events
part fl1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part fl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part cl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part tba
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

ex042.png

Figure 6.75: Orchestra Layout

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

layout = small-ensemble

// parts
part <id fl1, name "Flute 1", inst flute>
part <id fl2, name "Flute 2", inst flute>
part <id cl2, name "Clarinet 1", inst bflat-clarinet>
part <id vln1, name "Violin 1", inst violin>
part <id vln2, name "Violin 2", inst violin>
part <id vc1, name "Cello 1", inst cello>
part <id vc2, name "Cello 2", inst cello>
part <id tba, name Tuba, inst tuba>

// events
part fl1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part fl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part cl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part tba
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

ex043.png

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

/- `[', `]' and `*' are all strings, so they must be
   surrounded by whitespace -/
layout-def = ([ [ piccolo flute ]
                [ oboe english-horn ]
                [ bflat-clarinet bass-clarinet ]
              ]
              *
              [ tuba ]
              *
              [ [ violin ]
                [ viola ]
                [ cello ]
                [ contrabass ]
              ])

// parts
part <id fl1, name "Flute 1", inst flute>
part <id fl2, name "Flute 2", inst flute>
part <id cl2, name "Clarinet 1", inst bflat-clarinet>
part <id vln1, name "Violin 1", inst violin>
part <id vln2, name "Violin 2", inst violin>
part <id vc1, name "Cello 1", inst cello>
part <id vc2, name "Cello 2", inst cello>
part <id tba, name Tuba, inst tuba>

// events
part fl1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part fl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part cl2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vln2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc1
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part vc2
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

part tba
dur 1
time 0 pitch 60 ;
time 1 pitch 62 ;
time 2 pitch 64 ;

ex079.png

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

6.14.2 Layout Library

If you find yourself reusing the same layouts in multiple files 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.