Clamps Packages
Loading sfz files
Clamps maintains an internal registry for sfz files, loading their samples into the system automatically when needed. The registry stores associations between a sfz preset name and the corresponding sfz file. Adding an association is done with the command add-sfz-preset:
(add-sfz-preset :flute-nv "000_Flute_nv.sfz")
Loading a registered sfz-file will happen automatically when playing an sfz sound if its sfz file hasn't been loaded already:
(play-sfz 60 0 3 :preset :fulte-nv) ;; => nil ;; output in the REPL: ;; loading :flute-nv from ~/quicklisp/local-projects/clamps/extra/snd/sfz/Flute-nv/000_Flute-nv.sfz
Loading an sfz file can also be issued directly using get-sfz-preset, ensure-sfz-preset and load-sfz-preset.
get-sfz-preset and ensure-sfz-preset take the preset name as argument and require that the association between preset name and sfz file has already been made. load-sfz-preset takes the preset name and the sfz file as arguments and will register the preset and load the sfz file. If the preset is already registered it will behave exactly like get-sfz-preset or ensure-sfz-preset.
sfz files will be searched recursively in all directories in the *sfz-preset-path* list.
If a preset has already been loaded, it will not get reloaded unless the :force flag is set to non nil.