palette/sndfile-palette [ Classes ]

[ Top ] [ palette ] [ Classes ]

NAME

 sndfile-palette

 File:             sndfile-palette.lsp

 Class Hierarchy:  named-object -> linked-named-object -> sclist -> 
                   circular-sclist -> assoc-list -> recursive-assoc-list ->
                   palette -> sndfile-palette

 Version:          1.0.0-beta1

 Project:          slippery chicken (algorithmic composition)

 Purpose:          Implementation of the sndfile-palette class, which is a
                   simple palette that checks that all the sound files given
                   in a list for each id exist.  See comments in methods for
                   limitations and special features of this class.

 Author:           Michael Edwards: m@michael-edwards.org

 Creation date:    18th March 2001

 $$ Last modified: 16:47:33 Tue May 15 2012 BST

 SVN ID: $Id: sndfile-palette.lsp 1764 2012-05-17 11:49:59Z medward2 $

sndfile-palette/find-sndfile [ Methods ]

[ Top ] [ sndfile-palette ] [ Methods ]

FUNCTION

 Return the full directory path and file name of a specified sound file,
 from within the directories given in the PATHS slot.

ARGUMENTS

 - A sndfile-palette object.
 - The name of a sound file from within that object. This can be a string or
   a symbol. Unless it is given as a string, it will be handled as a symbol
   and will be converted to lowercase. Inclusion of the file extension is
   optional. 

RETURN VALUE

 Returns the full directory path and file name of the specified sound file
 as a string.

EXAMPLE

(let ((msfp (make-sfp 'sfp-test 
                      '((sndfile-group-1
                         (test-sndfile-1))
                        (sndfile-group-2
                         (test-sndfile-2 test-sndfile-3 
                          (test-sndfile-4 :frequency 261.61)))
                        (sndfile-group-3
                         ((test-sndfile-5 :start 0.006 :end 0.182) 
                          test-sndfile-6)))
                      :paths
                      '("/path/to/sndfiles-dir-1"
                        "/path/to/sndfiles-dir-2"))))
 (find-sndfile msfp 'test-sndfile-4))

=> "/path/to/sndfiles-dir-2/test-sndfile-4.aiff"

SYNOPSIS

(defmethod find-sndfile ((sfp sndfile-palette) sndfile)

sndfile-palette/make-sfp [ Functions ]

[ Top ] [ sndfile-palette ] [ Functions ]

FUNCTION

 Make a sndfile-palette object. This object is a simple palette which checks
 to make sure that all of the sound files in a given list exist for each
 given ID.

 Sound files are given as as single names, without the path and without the
 extension. These can be given using the optional keyword arguments <paths>
 and <extensions>.

ARGUMENTS

 - An ID for the palette.
 - A list of lists that contains IDs for the names of one or more groups of
   sound files, each paired with a list of one or more names of existing
   sound files. The sound file names themselves can be paired with keywords
   from the sndfile class, such as :start, :end, and :frequency, to define
   and describe segments of a given sound file.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :paths. A list of one or more paths to where the sound files are located.
 - :extensions. A list of one or more sound file extensions for the
   specified sound files. The default initialization for this slot of the
   sndfile-palette already contains ("wav" "aiff" "aif" "snd"), so this
   argument can often be left unspecified.
 - :warn-not-found. T or NIL to indicate whether a warning should be printed
   to the Lisp listener if the specified sound file cannot be found. 
   T = print warning. Default = T.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((msfp (make-sfp 'sfp-test 
                      '((sndfile-group-1
                         (test-sndfile-1))
                        (sndfile-group-2
                         (test-sndfile-2 test-sndfile-3 
                          (test-sndfile-4 :frequency 261.61)))
                        (sndfile-group-3
                         ((test-sndfile-5 :start 0.006 :end 0.182) 
                          test-sndfile-6)))
                      :paths '("/path/to/sound-files-dir-1/"
                               "/path/to/sound-files-dir-2/")))))

SYNOPSIS

(defun make-sfp (id sfp &key paths extensions (warn-not-found t))

sndfile-palette/make-sfp-from-groups-in-wavelab-marker-file [ Functions ]

[ Top ] [ sndfile-palette ] [ Functions ]

FUNCTION

ARGUMENTS

OPTIONAL ARGUMENTS

RETURN VALUE

EXAMPLE

SYNOPSIS

(defun make-sfp-from-groups-in-wavelab-marker-file (marker-file sndfile 
                                                    &key
                                                    paths
                                                    extensions
                                                    warn-not-found
                                                    (sampling-rate 44100)
                                                    (print t))

sndfile-palette/make-sfp-from-wavelab-marker-file [ Functions ]

[ Top ] [ sndfile-palette ] [ Functions ]

FUNCTION

 This creates a sndfile-palette with automatic groups with <snds-per-group>
 snds in each auto group and random groups every <random-every>.

 marker-file could be a list of marker files; they would be concatenated.

 NB Beware that marker files created on different operating systems from the
 one one which this function is called might trigger errors due to newline
 character mismatches.

ARGUMENTS

OPTIONAL ARGUMENTS

RETURN VALUE

EXAMPLE

SYNOPSIS

(defun make-sfp-from-wavelab-marker-file (marker-file sndfile 
                                          &key
                                          (snds-per-group 8)
                                          (random-every 999999) ;; i.e. never
                                          paths
                                          (sampling-rate 44100)
                                          extensions
                                          warn-not-found)