Next: , Previous: Settings (SAL), Up: SAL Examples


8.3 Voices, Chords and Polyphony

8.3.1 Voices

Use the voice parameter to specify a voice (numbering starts at 1 and continues up to 128, more than can possibly fit on a staff). If you don't specify one, the default value is 1.

If you explicitly assign voices to note events, keep in mind that the lowest voice number is usually the highest on the staff and vice versa.

process myproc ()
  with h = make-heap({0 3 4 6 8})
  while elapsed() < 12
  fms:note(dur: 1/2, pitch: 67 + next(h), voice: 1)
  fms:note(dur: 1/2, pitch: 55 + next(h), voice: 2)
  wait 1/2
end

sprout(myproc(), *filename*)

sal033.png

Figure 8.13: Voices

8.3.2 Polyphony

FOMUS is given a choice between several voices here by passing a list to the voice parameter.

process myproc ()
  repeat 10
  for tim = random(20.0)
  for dur = 1 + random(3.0)
  fms:note(time: tim, dur: dur,
           pitch: between(60, 85),
           voice: {1 2 3})
end

begin
  with parts = {{:id "apart" :inst "piano"}}
  sprout(myproc(), *filename*, parts: parts)
end

sal007.png

Figure 8.14: Polyphony 1

process myproc (len, minp, maxp)
  repeat len
  fms:note(voice: {1 2},
           pitch: between(minp, maxp),
           dur: 1/4)
  wait 1/4
end

begin
  sprout(list(myproc(40, 50, 80),
              myproc(40, 40, 70)), *filename*)
end

sal013.png

Figure 8.15: Polyphony 2

8.3.3 Chords

Chords are formed when simultaneous or overlapping notes exist in a single voice. In the following example, FOMUS finds it appropriate to create chords in one voice even though it is given a choice:

process myproc ()
  repeat 3
  loop for off from 0 to 10 by 1/2
    fms:note(time: off, dur: #?(off < 10, 1/2, 1),
             pitch: between(48, 73), voice: {1 2})
  end
end

begin
  with parts = {{:id "apart" :inst "piano"}}
  sprout(myproc(), *filename*, parts: parts)
end

sal005.png

Figure 8.16: Chords 1

In this example, FOMUS is forced to fit everything into one voice. FOMUS has no choice but to form chords in this case.

process myproc ()
  repeat 10
  for tim = random(30.0)
  for dur = 1 + random(3.0)
  fms:note(time: tim, dur: dur,
           pitch: between(60, 85))
end

begin
  with parts = {{:id "apart" :inst "piano"}}
  sprout(myproc(), *filename*, parts: parts)
end

sal006.png

Figure 8.17: Chords 2

FOMUS uses a setting called vertmax to determine the maximum number of notes allowed in a chord. For most instruments the appropriate value is 1. FOMUS needs this information when it chooses voices so that it doesn't notate passages that are impossible to play. The place to put vertmax is in an instrument or part definition, though it may also be changed for individual measures or notes.

In the following example, setting vertmax to 1 in the part definition overrides the default of 5 that is defined in the instrument. This forces the output to consist of two individually monophonic voices.

process myproc ()
  with h = make-heap({50 56 61 67})
  while (elapsed() < 12)
  fms:note(part: :prt1, dur: 1/2, pitch: next(h), voice: {1 2})
  fms:note(part: :prt1, dur: 1/2, pitch: next(h), voice: {1 2})
  wait 1/2
end

sprout(myproc(), *filename*,
       parts: {{:id "prt1" :inst "piano" :vertmax 1}}) ; overrides `vertmax' in piano instrument

sal032.png

Figure 8.18: vertmax Setting