Next: , Previous: Beats and Measures (SAL), Up: SAL Examples


8.13 Treating Multiple Parts as One

8.13.1 Metapart Example

You can treat multiple instruments as one by defining a “metapart.” Metaparts don't appear in the score. Instead, they route events to other parts or metaparts according to which voices they are in. The from-voice and to-voice settings tell FOMUS how to do this. In the example below, events belonging to voice 1 in the ‘vla’ metapart are routed to voice 1 of ‘vla1’, events in voice 2 are routed to ‘vla2’ and events in voice 3 are routed to ‘vla3’. This is done after one of the three voices (1, 2 or 3) has been chosen for each note. Defining the ‘vla’ metapart this way allows the events for the three viola parts to be entered as chords instead of as separate melodic lines.

variable parts
  = {{:id "vla1" :inst "viola"}
     {:id "vla2" :inst "viola"}
     {:id "vla3" :inst "viola"}}

variable metaparts
  = {{:id "vla" :parts {{:part "vla1" :from-voice 1 :to-voice 1}
                        {:part "vla2" :from-voice 2 :to-voice 1}
                        {:part "vla3" :from-voice 3 :to-voice 1}}}}

process aproc (reps, dur, pset)
  with pat = make-heap(pset, limit: reps)
  for c = next(pat)
  until ( eod?(c) )
  loop for k in c
    fms:note(pitch: k, part: "vla", dur: dur,
         voice: {1 2 3})
  end
  wait dur
end

sprout(aproc(10, rhythm("s", 60), {{60 62 64} {61 63 65} {62 64 66}}),
       *filename*,
       parts: parts, metaparts: metaparts)

sal024.png

Figure 8.67: Viola Trio Metapart

TODO: show nested metaparts with transpositions