Overview Clamps Packages CM Dictionary Clamps Dictionary Fomus
Next: cm-svg , Previous: cm-fomus , Up: CM Extensions , Home: General

Clamps Packages

cm-sfz

cm-sfz extends cl-sfz by implemenings the sfz class for Common Music, derived from its event class. Like any other event class in CM an instance is created with the new macro.

(new sfz)
;; => #i(sfz keynum 60 amplitude 1 duration 1
;;           preset :flute-nv oneshot nil pan 0.5 startpos 0 chan 100

Playback of a sfz instance can be achieved with the usual methods of Common Music:

(output (new sfz))
;; => ; No value

(sprout (new sfz :time 0))
;; => nil

(events (new sfz :time 0) *rts-out*)
;; => #<incudine-stream "midi-out1">

Apart from realtime output, backends for LilyPond (see cm-fomus) and SVG output (see cm-svg) are defined:

(events
 (loop
   repeat 10
   for time from 0 by 0.1
   collect (new sfz :time time :keynum (between 60.0 83.0)
             :duration 0.1))
 "/tmp/test.svg")
;; => "/tmp/test.svg"

Note that there are no limitations concerning microtonal output for SVG files and for realtime playback. For lilypond output, the keynums are rounded to the closest quartertone, if the :quartertones option of FOMUS is set:

(events
      (loop
        repeat 8
        for time from 0 by 0.125
        collect (new sfz :time time :keynum (between 60.0 83.0)
                  :duration 0.125))
      "/tmp/test.ly"
      :quartertones t)