Reference
Scenes and reusable material
Organize a set with ordinary Common Lisp definitions, and construct, preview, compare, and activate named multi-channel scenes.
Ordinary Common Lisp definitions are the basic tool for organizing a set, and defscene adds named compositions that span several channels. This page covers both.
Sound-bearing examples on this page use the SuperDirt banks bd, sn, and hh, and need an attached output backend and a working receiver.
A performer can put machinery in functions or variables while leaving concise, high-level forms in the performance buffer. Ordinary Lisp variables and functions can hold reusable musical and visual material, so no separate configuration language is needed.
For example, a variable can hold material that a short channel form then uses:
(defparameter *kit* '("bd" "hh" "sn" "hh"))
(d1! (s ($ (apply #'cat *kit*))))The ($ expression) escape is described in pattern literals. To give reusable material its own named, inspectable pattern class, see extending Mora.
defscene adds named multi-channel compositions:
(defscene verse ()
"A two-channel drum scene."
(d1 (s "bd ~ sn ~"))
(d2 (s "hh*8")))The scene’s body uses the channel forms d1 and d2; see channels, tempo, and transport for channel assignment.
Constructing a scene and activating it are separate operations. Here (verse) constructs the scene, which is then passed to preview-scene and to activate-scene:
(preview-scene (verse))
(activate-scene (verse))scene-diff supports comparing scenes before committing them.