Next: , Previous: Some Basic SAL Examples, Up: SAL Examples


8.2 Settings

8.2.1 Score-Level Settings

The following examples contain three score-level settings, title, author and quartertones, which affect the entire score.

All settings in FOMUS can be set at the score level.

process myproc (n, r)
  repeat n
    fms:note(dur: r, pitch: between(48.0, 73.0))
    wait r
end

begin
  with sets = {:title "Random"
               :author "David Psenicka"
               :quartertones #t}
  sprout(myproc(20, 1/2), *filename*)
end

sal034.png

Figure 8.7: Score-Level Settings

function myproc (n, r)
  loop repeat n
    for tim from 0 by r
    fms:note(time: tim, dur: r, pitch: between(48.0, 73.0))
  end
end

fms:new-score(*filename*)

fms:setting(title: "Random")
fms:setting(author: "David Psenicka")
fms:setting(quartertones: #t)

myproc(20, 1/2)

fms:run()

sal035.png

Figure 8.8: Score-Level Settings without sprout

8.2.2 Object Settings

Each list of keyword/argument pairs following the percinsts, insts and parts keywords is the definition for a percussion instrument, instrument or part. See Objects for a better explanation of these objects—the purpose here is only to point out settings. perc-note and perc-name are typical settings for percussion instruments (they specify the note and the text for a percussion change mark). Because they are set in a percussion instrument definition, they affect only that object and any woodblock percussion note events. The settings name and abbr usually belong in an instrument definition (they are the name and abbreviated name of the instrument). When they are defined in a part as they are here, they override the definitions that are in the instrument that they are based on. transpose-part (whether or not to transpose all of the notes in a part) should probably be defined at the score level, but can also exist in instruments or parts (as they are here). id, template, percinsts (inside the instrument definition) and insts (inside the part definitions) aren't really settings—they are special assignments that only affect the instrument or part that they are defined in (see Objects for complete lists and descriptions of these special parameters).

process myproc (maxtim, parts, perc, pnotes)
  while elapsed() < maxtim
  if ( odds(0.666) )
    send("fms:note", part: pick(parts), ; woodwind note
         dur: 1/2,
         pitch: between(72, 79))
  else
    send("fms:note", part: perc, ; percussion note
         dur: 1/2,
         pitch: pick(pnotes))
  end
  wait pick(1/2, 1)
end

begin
  with sets = {:layout "orchestra"},
       percinsts = {{:id "wb1" :template "low-woodblock" :perc-note 57 :perc-name "woodblocks"}
                    {:id "wb2" :template "high-woodblock" :perc-note 64 :perc-name "woodblocks"}},
       insts = {{:id "prcdef" :template "percussion" :percinsts {"wb1" "wb2"}}},
       parts = {{:id "cl1" :name "Bf Clarinet 1" :abbr "cl 1" :inst "bflat-clarinet" :transpose-part #f}
                {:id "cl2" :name "Bf Clarinet 2" :abbr "cl 2" :inst "bflat-clarinet" :transpose-part #f}
                {:id "ob" :name "Oboe" :abbr "ob" :inst "oboe"}
                {:id "prc" :name "Percussion" :abbr "perc" :inst "prcdef"}}
  sprout(myproc(16, {"cl1" "cl2" "ob"}, "prc", {"wb1" "wb2"}), *filename*,
         percinsts: percinsts, insts: insts, parts: parts, sets: sets)
end

sal025.png

Figure 8.9: Object Settings

function myproc (maxtim, parts, perc, pnotes)
  loop
    for tim = 0 then tim + pick(1/2, 1)
    while (tim < maxtim)
    if ( odds(0.666) )
      fms:note(part: pick(parts),
               time: tim,
               dur: 1/2,
               pitch: between(72, 79))
    else
      fms:note(part: perc,
               time: tim,
               dur: 1/2,
               pitch: pick(pnotes))
    end
  end
end

fms:new-score(*filename*)

fms:setting(layout: "orchestra")

fms:percinst(id: "wb1", template: "low-woodblock", perc-note: 57, perc-name: "woodblocks")
fms:percinst(id: "wb2", template: "high-woodblock", perc-note: 64, perc-name: "woodblocks")

fms:inst(id: "prcdef", template: "percussion", percinsts: {"wb1" "wb2"})

fms:part(id: "cl1", name: "Bf Clarinet 1", abbr: "cl 1", inst: "bflat-clarinet", transpose-part: #t)
fms:part(id: "cl2", name: "Bf Clarinet 2", abbr: "cl 2", inst: "bflat-clarinet", transpose-part: #t)
fms:part(id: "ob", name: "Oboe", abbr: "ob", inst: "oboe")
fms:part(id: "prc", name: "Percussion", abbr: "perc", inst: "prcdef")

myproc(16, {"cl1" "cl2" "ob"}, "prc", {"wb1" "wb2"})

fms:run()

sal027.png

Figure 8.10: Object Settings without sprout

8.2.3 Measure/Note Event Settings

This pair of examples shows a few settings being defined in measure and note events. The two settings in the measure definition are comp (compound meter) and keysig (key signature), both of which could be set at the score level or in a part definition instead. The settings in the note events are staff (staff number) and acc (accidental choices), which override any decision FOMUS makes regarding staff and accidental choices. All other keyword/value pairs (e.g., time, dur, pitch, etc.) are not settings, they are special parameters that belong only to that particular event.

process myproc ()
  for n from 0 below 20
  fms:note(dur: 1/3,
           pitch: 55 + (11 * sin(elapsed())),
           staff: #?(n < 10, 2, 1),
           acc: #?(n < 10, {n f}, {n s}))
    wait 1/3
end

process mymeas ()
  repeat 1
  fms:meas(dur: 2, comp: #t, keysig: "gmaj")
end

begin
  sprout( list(mymeas(), myproc()), *filename*)
end

sal036.png

Figure 8.11: Measure/Note Settings

function myproc ()
  loop
    for tim from 0 by 1/3
    for n from 0 below 20
    fms:note(time: tim,
             dur: 1/3,
             pitch: 55 + (11 * sin(tim)),
             staff: #?(n < 10, 2, 1),
             acc: #?(n < 10, {n f}, {n s}))
  end
end

fms:new-score(*filename*)

fms:meas(time: 0, dur: 2, comp: #t, keysig: "gmaj")

myproc()

fms:run()

sal037.png

Figure 8.12: Measure/Note Settings without sprout