Implements Fomus manuscript output to Lilypond, MusicXML and Fomus data files. This class is automatically chosen when you specify a file with a .ly, .xml or .dat extension. To work with Fomus, load it and then compute scores using Fomus objects. Use the package prefix fms to reference Fomus symbols, for example fms:part, fms:note, etc.

fomus-file supports the following slot initializations:

:parts {part | list}
The list of fms:part objects defining the musical parts to be included in the score.
:global {object | list}
A list of global score objects such as time signatures and key signatures.
:view boolean
If true then Fomus will perform its backend post-processing on the computed file, otherwise it will not. The default value is false.

In addition to the initializations listed above, all Fomus keyword settings are also available as keyword initializations to fomus-file. There are lots of these Fomus manuscript settings to keep track of, the function fms:list-fomus-settings will be particularly helpful in this regard.


Example 1. Working with Fomus.

(load "/Lisp/fomus/load")
;; Common Music package detected
;; FOMUS v0.1.1
;; Lisp music notation formatter
;; Copyright (c) 2005 David Psenicka, All Rights Reserved
;; See file "COPYING" for terms of use and distribution.


;;; use rational tempo and beat values to avoid rhythmic quantization
;;; errors.

(defparameter *tempo* 60)

(defparameter *beat* 1/4)

(defparameter *ins*  (new fms:part :instr ':piano
                          :partid ':piano ))

(defun ranpiano (len lb ub )
  (process repeat len
           for r = (rhythm (pick 1/4 1/8 1/16))
           output (new fms:note :off (now)
                      :partid ':piano
                      :note (between lb ub)
                      :dur r)
           wait r))

(events (ranpiano 20 40 80) "test.ly" :parts *ins*)

;;; quarter tones

(events (ranpiano 20 40.0 80.0) "test.ly" :parts (list *ins*)
        :quartertones t
        :title "HiHo!"
        :view t :composer "Anon.")

Example 2. Manuscripting imported MIDI data.

;;; best to override tempo maps with tempo 60 so
;;; Fomus has a fighting chance of parsing the time line correctly.

(defparameter prelude
  (import-events "/Users/hkt/Desktop/Prelude_Suite_no4_BWV1006a_Prelude.mid"
                 :tempo 60 :tracks '(1 2)))

;;; Timesigs and such can be "global" data in Fomus

(defparamater timesig
  (new fms:timesig :off 0 :time '(3 4))

(events prelude "test.ly" :global (list timesig) :view t)

See also: