./../../src/slippery-chicken.lsp

## sc/slippery-chicken [ Classes ]

[ Top ] [ Classes ]

NAME

     slippery-chicken

     File:             slippery-chicken.lsp

     Class Hierarchy:  named-object -> slippery-chicken

     Version:          1.0.0

     Project:          slippery chicken (algorithmic composition)

     Purpose:          Implementation of the slippery-chicken class.

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

     Creation date:    March 19th 2001

     $$ Last modified: 17:10:41 Tue Sep 25 2012 BST

     SVN ID: $Id: slippery-chicken.lsp 3155 2012-12-06 16:19:43Z medward2 $

## slippery-chicken/auto-set-written [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Automatically set the WRITTEN-PITCH-OR-CHORD slot for all events where the
     player plays a transposing instrument (which can change of course).

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :start-bar. NIL or an integer that is the first bar for which the written
       pitch/chord data is to be set. If NIL, start from bar 1. Default = NIL.
     - :end-bar. NIL or an integer that is the last bar for which the written
       pitch/chord data is to be set. If NIL, do all bars. Default = NIL.
     - :players. NIL, the ID or a list of IDs for the player(s) whose part(s)
       are to be affected. If NIL, all players' parts will be affected.
       Default = NIL.

RETURN VALUE

     T

EXAMPLE

    ;;; Create a slippery-chicken object, set all the written-pitch-or-chord
    ;;; slots to NIL and print the results. Apply the method and print the results
    ;;; again to see the difference.
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((hn (french-horn :midi-channel 1))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((hn (1 1 1 1 1))))))))
      (next-event mini 'hn nil 1)
      (loop for ne = (next-event mini 'hn)
         while ne
         do (setf (written-pitch-or-chord ne) nil))
      (next-event mini 'hn nil 1)
      (print
       (loop for ne = (next-event mini 'hn)
          while ne
          collect (written-pitch-or-chord ne)))
      (auto-set-written mini)
      (next-event mini 'hn nil 1)
      (print
       (loop for ne = (next-event mini 'hn)
          while ne
          collect (data (written-pitch-or-chord ne)))))

    =>
    (NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL
     NIL NIL NIL NIL NIL NIL NIL)
    (C4 D4 E4 FS4 G4 C4 D4 E4 FS4 G4 C4 D4 E4 FS4 G4 C4 D4 E4 FS4 G4 C4 D4 E4
     FS4 G4)

SYNOPSIS

    (defmethod auto-set-written ((sc slippery-chicken) &key start-bar end-bar
                                 players)

## slippery-chicken/check-beams [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     See the description, with example, for check-beams in rthm-seq-bar.lsp.

SYNOPSIS

    (defmethod check-beams ((sc slippery-chicken) &key start-bar end-bar players
                            auto-beam print (on-fail #'warn))

## slippery-chicken/check-ties [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Check that all ties are started and ended properly. If the optional
     argument <same-spellings> is set to T, all tied pitches will be forced to
     have the same enharmonic spellings.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     - T or NIL to indicate whether to force all tied pitches to have the same
       enharmonic spellings.

RETURN VALUE

     T if all tie data is ok, otherwise performs the on-fail function and
     returns NIL.

EXAMPLE

    ;;; Create a slippery-chicken object, manually create a problem with the ties, ;
    ;;; and call check-ties with a #'warn as the on-fail function. ;
    (let* ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((cl (b-flat-clarinet :midi-channel 1))))
             :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
             :set-map '((1 (1)))
             :rthm-seq-palette '((1 ((((4 4) { 3 tq tq tq } +q e (s) s)))))
             :rthm-seq-map '((1 ((cl (1)))))))
           (e4 (get-event mini 1 4 'cl)))
      (setf (is-tied-to e4) nil)
      (check-ties mini nil #'warn))

    => WARNING: slippery-chicken::check-ties: bad tie, CL bar 1

SYNOPSIS

    (defmethod check-ties ((sc slippery-chicken)
                           &optional same-spellings (on-fail #'error))

## slippery-chicken/check-time-sigs [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     28-Jan-2011

DESCRIPTION

     Check every bar in the given slippery-chicken object to see if all players
     have the same time signature. Drops into the debugger with an error if not.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     T if all players have the same time signature at the same time, otherwise
     drops into the debugger with an error.

EXAMPLE

    ;; A successful test
    (let* ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((vn (violin :midi-channel 1))
                          (va (viola :midi-channel 2))
                          (vc (cello :midi-channel 3))))
             :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
             :set-map '((1 (1 1 1)))
             :rthm-seq-palette '((1 ((((4 4) { 3 tq tq tq } +q e (s) s)))))
             :rthm-seq-map '((1 ((vn (1 1 1))
                                 (va (1 1 1))
                                 (vc (1 1 1))))))))
      (check-time-sigs mini))

    => T

    ;; A failing test
    (let* ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((vn (violin :midi-channel 1))
                          (va (viola :midi-channel 2))
                          (vc (cello :midi-channel 3))))
             :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
             :set-map '((1 (1 1 1)))
             :rthm-seq-palette '((1 ((((4 4) { 3 tq tq tq } +q e (s) s)))))
             :rthm-seq-map '((1 ((vn (1 1 1))
                                 (va (1 1 1))
                                 (vc (1 1 1))))))))
      (setf (time-sig (get-bar mini 1 'vn)) '(3 4))
      (check-time-sigs mini))

    =>
    slippery-chicken::check-time-sigs: time signatures are not the same at bar 1
       [Condition of type SIMPLE-ERROR]

SYNOPSIS

    (defmethod check-time-sigs ((sc slippery-chicken))

## slippery-chicken/check-tuplets [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Check the qualities of the tuplets brackets in a given slippery-chicken
     object to make sure they are all formatted properly (i.e. each starting
     tuplet bracket has a closing tuplet bracket etc.).  If an error is found,
     the method will try to fix it, then re-check, and only issue an error then
     if another is found.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     - The function to use if something is not ok with the tuplets. This
       defaults to #'error, but could also be #'warn for example

RETURN VALUE

     T if all tuplets brackets are ok, otherwise performs the on-fail function
     and returns NIL.

EXAMPLE

    ;;; Create a slippery-chicken object, manually add an error to the tuplet data ;
    ;;; and call check-tuplets with #'warn as the on-fail function. ;
    (let* ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((cl (b-flat-clarinet :midi-channel 1))))
             :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
             :set-map '((1 (1)))
             :rthm-seq-palette '((1 ((((4 4) { 3 tq tq tq } +q e (s) s)))))
             :rthm-seq-map '((1 ((cl (1)))))))
           (e1 (get-event mini 1 1 'cl)))
      (setf (bracket e1) nil)
      (check-tuplets mini #'warn))

    => rthm-seq-bar::check-tuplets: Can't close non-existent bracket.

SYNOPSIS

    (defmethod check-tuplets ((sc slippery-chicken) &optional (on-fail #'error))

## slippery-chicken/clm-play [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Using the sound files (samples) defined for the given reference (group ID)
     in the sndfile-palette slot of the slippery-chicken object, use CLM to
     generate a new sound file using the pitch and timing information of one or
     more players' parts from the slippery-chicken object.

     NB: The sound file will begin with the first sounding event in the section
         at 0.0 seconds. If there are any leading rests in the player's part,
         these will be omitted in the output file.

     By grouping sound files in the sndfile-palette slot, the user can generate
     a CLM sound file version of the piece in various 'flavours'; perhaps, for
     example, using exclusively source sound files consisting of string samples,
     or percussion sounds, or a variety of sounds, as desired. See below for an
     example of a sndfile-palette.

     By default this method does not attempt to match the pitches of the output
     sound file to those generated for the slippery-chicken object, but rather
     generates its own sequence of pitches based on pitches from the current
     set. Instead of using the pitches of the specified players' parts, which
     might produce extreme sound file transpositions both upwards and downwards,
     it accesses each note of the current set (assigned by the set-map to each
     rthm-seq) from the bottom up, one voice after another. If do-src is T,
     transposition will then be calculated such that the frequency of the sound
     file, if specified, will be shifted to the pitch of the given pitch of the
     set. Since this transposition process may still yield extreme
     transpositions, the note-number keyword can be specified to indicate an
     index into the current set of pitches to serve as the lowest voice
     instead. However, if the number of voices plus this index exceeds the
     number of pitches in the set, the method will wrap around to the lowest
     pitch of the set.

     If instead of the above method the user would like the pitches in the
     resulting sound file to be transposed to match the pitches of the
     slippery-chicken object, the keyword argument :pitch-synchronous can be set
     to T (and do-src should be left set to T as well). This will also work with
     chords.

     See also make-sfp-from-wavelab-marker-file in sndfile-palette.lsp for
     automatically creating a sndfile-palette from markers in a Steinberg
     Wavelab marker file.

     Event amplitudes are as yet unused by this method.

     NB: CLM's nrev instrument must be loaded before calling this method.

ARGUMENTS

     - A slippery chicken object.
     - The ID of the starting section.
     - The IDs of the player(s) whose events are to be used to obtain the
       rhythmic structure (and optionally, pitch content) of the resulting sound
       file. This can be a single symbol for an individual player, a list of
       player IDs, or NIL. If NIL, the event from all players' parts will be
       reflected in the output file. Default = NIL.
     - The ID of the sound file group in the sndfile-palette slot of the
       slippery-chicken object that contains the source sound files from which
       the new sound file is to be generated.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :num-sections. An integer or NIL to indicate how many sections should be
       generated, including the starting section. If NIL, sound file data will
       be generated for all sections of the piece. NB If there are sub-sections
       this will include them in the total, i.e., if section 1 has 3 subsections
       and :num-sections is 2, we'll generate data from the first two
       subsections of section 1, not all subsections of main sections 1 and
       2. Default = NIL.
     - :from-sequence. An integer that is the number of the first sequence
       within the specified starting section to be used to generate the output
       file. This argument can only be used when num-sections = 1. Default = 1.
     - :num-sequences. NIL or an integer that indicates how many sequences are
       to be generated, including that specified by :from-sequence. If NIL, all
       sequences will be played. This argument can only be used when
       num-sections = 1 and the section has no subsections. Default = NIL.
     - :srate. A number that is the sampling rate of the output file
       (independent of the input file). This and the following two arguments
       default to the CLM package globals. See clm.html for more options.
       Default = clm::*clm-srate*.
     - :header-type: A CLM package header-type specification to designate the
       output sound file format. For example, clm::mus-riff will produce .wav
       files, clm::mus-aiff will produce .aiff files. The value of this argument
       defaults to the CLM package globals. See clm.html for more
       options. Default = clm::*clm-header-type*.
     - :data-format. A CLM package data-format specification to designate the
       output sound file sample data format. For example, clm::mus-float will
       produce a 32-bit little-endian floating-point format; clm::mus-l24int
       will produce little-endian 24-bit integer; mus-bshort will produce 16-bit
       big-endian files, and mus-bfloat will produce 32-bit floating-point
       big-endian files. NB: AIFF and AIFC files are not compatible with little
       endian formats.  The value of this argument defaults to the CLM package
       globals. See clm.html for more options.
       Default = clm::*clm-data-format*.
     - :sndfile-extension. NIL or a string that will be the extension of the
       output sound file (e.g. ".wav", ".aif"). If NIL, the method will
       determine the extension automatically based on the header-type. NB: The
       extension does not determine the output sound file format; that is
       determined by :header-type. Default = NIL.
     - :channels. An integer that is the number of channels in the output sound
       file, limited only by the sound file format specified. Note that both
       stereo and mono sounds from the palette will be randomly panned between
       any two adjacent channels. Default = 2.
     - :rev-amt. A number that determines the amount of reverberation for the
       resulting sound file, passed to CLM's nrev.
       NB: 0.1 is a lot. Default = 0.0.
     - time-offset. A number that is an offset time in seconds. This produces a
       lead time of a specified number of seconds of silence prior to the sound
       output.
     - :play. T or NIL to indicate whether CLM should play the output file
       automatically immediately after it has been written.
       T = play. Default = NIL.
     - :inc-start. T or NIL to indicate whether playback of the source sound
       files is to begin at incrementally increasing positions in those files or
       at their respective 0.0 positions every time. If T, the method will
       increment the position in the source sound file from which playback is
       begun such that it reaches the end of the source sound file the last time
       it is 'played'. T = increment start times. Default = NIL.
     - :ignore-rests. T or NIL to indicate whether silence should be
       incorporated into the resulting sound file to correspond with rests in
       the player's parts. If T, the sound files will play over the duration of
       rests. However, this is only true on a bar-by-bar basis; i.e., notes at
       the end of one bar will not be continued over into a rest in the next
       bar. This implies that rests at the start of a bar will not be turned
       into sounding notes. T = ignore resets. Default = T.
     - :sound-file-palette-ref2. The ID of a sound file group in the given
       slippery-chicken object's sndfile-palette slot. If this reference is
       given, the method will invoke fibonacci-transitions to transition from
       the first specified group of source sound files to this one. If NIL, only
       one group of source sound files will be used. Default = NIL.
     - :do-src. T, a number, or a note-name pitch symbol to indicate whether
       transposition of the source sound files for playback will be calculated
       such that the perceived fundamental frequencies of those sound files are
       shifted to match the pitches of the current set. If do-src is a number
       (frequency in Hertz) or a note-name pitch symbol, the method will use
       only that pitch instead of the sound files' frequencies when transposing
       to the events' pitches. NB Whichever is used, after being converted to a
       sample rate conversion factor, this is always multiplied by the
       src-scaler (see below). T = match sound files' frequencies to set
       pitches. Default = T.
     - :pitch-synchronous: T or NIL to indicate whether the source sound files
       are to be transposed to match the pitches of the events in the given
       players' part. This will only be effective if the given source sound file
       has a perceptible frequency that has been specified using the sndfile
       object's :frequency slot in the sndfile-palette. :do-src must also be T
       for this to work. T = match pitches. Default = NIL.
     - :reset-snds-each-rs. T or NIL to indicate whether to begin with the first
       source sound file of the specified group at the beginning of each
       rthm-seq. T = begin with the first sound file. Default = T.
     - :reset-snds-each-player. T or NIL to indicate whether to begin with the
       first source sound file of the specified group for the beginning of each
       player's part. T = begin with the first sound file. Default = T.
     - :play-chance-env. A list of break-point pairs that determines the chance
       that a given even from the source player's part will be reflected in the
       new sound file. It is determined by random selection but uses a fixed
       seed that is re-initialized each time clm-play is called. The following
       default ensures every note will play. Default = '(0 100 100 100).
     - :play-chance-env-exp. A number that will be applied as the exponent to
       the play-chance-env's y values to create an exponential interpolation
       between break-point pairs. Default = 0.5.
     - :max-start-time. A number that is the last time-point in seconds for
       which events will be processed for the output file. If a maximum start
       time is specified here (in seconds), events after this will be
       skipped. The default value of 99999999 seconds (27778 hours) will result
       in all events being reflected in the sound file.
     - :time-scaler. A number that will be the factor by which all start times
       are scaled for the output file (in effect a tempo scaler). If
       :ignore-rests is T, this will also have an indirect effect on
       durations. This argument should not be confused with
       :duration-scaler. Default = 1.0.
     - :duration-scaler. A number that is the factor by which the duration of
       all  events in the output sound file will be scaled. This does not alter
       start times, and will therefore result in overlapping sounds if greater
       than 1.0. This is not to be confused with :time-scaler. Default = 1.0.
     - :normalise. A decimal number that will be the maximum amplitude of the
       resulting output file; i.e., to which the samples will be scaled. Can
       also be NIL, whereupon no normalisation will be performed.
       Default = 0.99
     - :amp-env. A list of break-point pairs that will govern the amplitude
       envelope applied to all source-sound files as it is being written to the
       new output file. NB: If the user wants to maintain the original attack of
       the source sound file and is not employing the :inc-start option, this
       should be set to '(0 1 ...). If :inc-start is T, the resulting sound file
       will probably contain clicks from non-zero crossings.
       Default = '(0 0 5 1 60 1 100 0).
     - :src-width. An integer that reflects the accuracy of the sample-rate
       conversion. The higher the value, the more accurate the transposition,
       but the slower the processing. Values of 100 might be useful for very low
       transpositions. Default = 20.
     - :src-scaler: A number that is the factor by which all sample-rate
       conversion values will be scaled (for increasing or decreasing the
       transposition of the overall resulting sound file). Default = 1.0.
     - :note-number. A number that is an index, representing the the nth pitch
       of the current set or chord (from the bottom) to be used for the lowest
       player. Default = 0.
     - :duration-run-over. T or NIL to indicate whether the method will allow a
       sound file event to extend past the end of specified segment boundaries
       of a sound file in the sndfile-palette. T = allow. Default = NIL.
     - :short-file-names. T or NIL to indicate whether abbreviated output file
       names will be automatically created instead of the usually rather long
       names. T = short. Default = NIL.
     - :output-name-uniquifier. A user-specified string that will be
       incorporated into the file name, either at the end or the beginning
       depending on whether short-file-names is T or NIL. Default = "".
     - :check-overwrite. T or NIL to indicate whether to query the user before
       overwriting existing sound files. T = query. Default = T.
     - :print-secs. T or NIL to indicate whether CLM should print the seconds
       computed as it works. T = print. Default = NIL.
     - :simulate. T or NIL to indicate whether only the sound file sequencing
       information should be calculated and printed for testing purposes,
       without generating a sound file. T = simulate. Default = NIL.
     - :sndfile-palette. NIL or a file name including path and extension that
       contains an external definition of a sndfile-palette. This will replace
       any sndfile-palette defined in the slippery-chicken object. If NIL, the
       one in the slippery-chicken object will be used. Default = NIL.
     - :chords. NIL or a list of lists consisting of note-name symbols to be
       used as the pitches for the resulting sound file in place of the pitches
       from the set-map. There must be one chord specified for each sequence. If
       NIL, the pitches from the set-map will be used. Default = NIL.
     - :chord-accessor. Sometimes the chord stored in the palette is not a
       simple list of data so we need to access the nth of the chord
       list. Default = NIL.

RETURN VALUE

     Total events generated (integer).

EXAMPLE

    ;;; An example using some of the more frequent arguments
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (hn (french-horn :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1 1 1))
                       (2 (1 1 1 1 1 1 1))
                       (3 (1 1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 (2) 3))))
                                (2 ((((4 4) (q) e (s) s h))
                                    :pitch-seq-palette ((1 2 (3)))))
                                (3 ((((4 4) e (s) s h (q)))
                                    :pitch-seq-palette ((2 3 3))))
                                (4 ((((4 4) (s) s h (q) e))
                                    :pitch-seq-palette ((3 (1) 2)))))
            :rthm-seq-map '((1 ((cl (2 3 2 4 1 3 1))
                                (hn (2 4 1 2 3 1 3))
                                (vc (1 2 2 3 4 1 3))))
                            (2 ((cl (4 2 1 3 3 1 2))
                                (hn (2 1 4 3 2 1 3))
                                (vc (2 3 4 3 1 2 1))))
                            (3 ((cl (3 1 2 4 3 1 2))
                                (hn (3 4 2 1 3 2 1))
                                (vc (3 2 3 1 4 2 1)))))
            :snd-output-dir "/tmp/"
            :sndfile-palette '(((sndfile-grp-1
                                 ((test-sndfile-1.aiff)
                                  (test-sndfile-2.aiff)
                                  (test-sndfile-3.aiff)))
                                (sndfile-grp-2
                                 ((test-sndfile-4.aiff :frequency 834)
                                  (test-sndfile-5.aiff)
                                  (test-sndfile-6.aiff))))
                               ("/path/to/sndfiles-dir-1"
                                "/path/to/sndfiles-dir-2")))))
      (clm-play mini 2 '(cl vc) 'sndfile-grp-1
                :num-sections 1
                :srate 48000
                :header-type clm::mus-aiff
                :data-format clm::mus-b24int
                :rev-amt 0.05
                :inc-start t
                :ignore-rests nil
                :sound-file-palette-ref2 'sndfile-grp-2
                :pitch-synchronous t
                :reset-snds-each-rs nil
                :reset-snds-each-player nil))

SYNOPSIS

    #+clm
    (defmethod clm-play ((sc slippery-chicken) section players
                         sound-file-palette-ref
                         &key
                         sound-file-palette-ref2
                         (play-chance-env '(0 100 100 100))
                         (max-start-time 99999999)
                         (play-chance-env-exp 0.5)
                         (time-scaler 1.0)
                         (normalise .99)
                         (simulate nil)
                         (from-sequence 1)
                         (num-sequences nil)
                         (num-sections nil)
                         (ignore-rests t)
                         (time-offset 0.0)
                         (chords nil)
                         (chord-accessor nil)
                         (note-number 0)
                         (play nil)
                         (amp-env '(0 0 5 1 60 1 100 0))
                         (inc-start nil)
                         (src-width 20)
                         (src-scaler 1.0)
                         (do-src t)
                         (pitch-synchronous nil)
                         (rev-amt 0.0)
                         (duration-scaler 1.0)
                         (short-file-names nil)
                         (check-overwrite t)
                         (reset-snds-each-rs t)
                         (reset-snds-each-player t)
                         (duration-run-over nil)
                         (channels 2)
                         (srate clm::*clm-srate*)
                         (header-type clm::*clm-header-type*)
                         (data-format clm::*clm-data-format*)
                         (print-secs nil)
                         (output-name-uniquifier "")
                         (sndfile-extension nil)
                         (sndfile-palette nil))

## slippery-chicken/clone [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Copy (clone) the specified instance and all data associated with the
     slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     A slippery-chicken object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :instrument-palette +slippery-chicken-standard-instrument-palette+
            :ensemble '(((fl (flute :midi-channel 1))))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1)))
            :rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -)))))
            :rthm-seq-map '((1 ((fl (1))))))))
      (clone mini))

SYNOPSIS

    (defmethod clone ((sc slippery-chicken))

## slippery-chicken/cmn-display [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Write the data stored in a given slippery-chicken object to disk as an EPS
     (Encapsulated Postscript) file using CMN.

     Several of the keyword arguments for this method are passed directly to CMN
     and therefore have identical names to CMN functions.

     NB: This might fail if LilyPond files are generated first. If this happens,
         re-evaluate the slippery-chicken object and call cmn-display again.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :file. A string that is the directory path with file name and extension
       for the .eps file to be created. Default = "/tmp/cmn.eps".
     - :players. NIL or a list of player IDs to indicate whether all players'
       parts should be printed to the score. If NIL, all players' parts will be
       written to the score. If a single symbol or a list of player IDs, only
       the parts of those players will be written to the score. Default = NIL.
     - :in-c. T or NIL to indicate whether the output should be printed at
       sounding pitch (in C) or at written pitch. NB: If in C, piccolo and
       double bass maintain their usual octave transpositions.
       T = print at sounding pitch. Default = NIL.
     - :respell-notes. T, a list of player IDs paired with a sequence of bar and
       note numbers, or NIL to indicate whether to the cmn-display method should
       call the respell-notes method to the pitches contained in the
       slippery-chicken object according to slippery chicken's enharmonics
       algorithm. If T, the all of the pitches in the object will be considered
       and slippery chicken will convert a number of the pitches to their
       enharmonic equivalents to create more sensible linear pitch progression
       within bars. If a list of player IDs paired with a sequence of bar and
       event numbers is passed, in the form
       '((vln (13 2) (14 3)) (cl (14 3 t))), only the specified pitches are
       changed; e.g., (13 2) = bar 13 note 2 (1-based and counting tied notes
       but not rests). If an additional T is included after the bar number and
       event number (as in the cl example above), only the spelling of the
       written pitch for that event will be changed (the default is to change
       the sounding note spelling only). Chords are not respelled by the default
       algorithm, so if these need to be respelled, this should be indicated by
       sub-grouping the note number portion of the given bar/note pair into a
       2-item sublist, in which the first number is the position of the chord in
       among the attacked notes of that bar and the second number is the
       position of the desired pitch within the chord, counted from the bottom
       up, e.g. (vln (13 (2 1))). If NIL, no changes will be made. Default = T.
     - :auto-clefs. T or NIL to indicate whether the cmn-display method should
       call the auto-clefs method, which automatically insert clef changes into
       the parts of those instruments that use more than one clef.
       T = automatically place clef changes. Default = T.
     - :start-bar. An integer that indicates the first bar of the object to be
       written to the resulting .eps file. NIL = the first bar. Default = NIL.
     - :end-bar. The last bar to be written to the resulting .eps file. NIL =
       the last bar of the slippery-chicken object. Default = NIL.
     - :title. T, a string, or NIL to indicate whether to write the title of the
       given slippery-chicken object to the resulting .eps file. If T, the TITLE
       slot of the slippery-chicken object will be used. If a string, the
       specified string will be used instead. If NIL, no title will be included
       in the output.  Default = T.
     - :size. A number to indicate the overall size of the symbols in the CMN
       output. Default = 15.
     - :page-nums. T or NIL to indicate whether page numbers are to be written.
       T = write page numbers. Default = T.
     - :empty-staves. T or NIL to indicate whether an empty staff should be
       displayed under each instrument. This can be useful for making editing
       notes by hand. T = print empty staff. Default = NIL.
     - :display-sets. T or NIL to indicate whether to print the set of pitches
       used for each rthm-seq on a separate treble-bass grand staff at the
       bottom of each system in the score. T = print. Default = NIL.
     - :write-section-info. T or NIL to indicate whether to write the section ID
       into the score. NB: This might not work without first regenerating the
       slippery-chicken object. T = write section IDs. Default = NIL.
     - :display-time. T or NIL to indicate whether the elapsed time in
       (mins:secs) should printed above each measure in the resulting score.
       T = print time. Default = NIL.
     - :staff-separation. A number that governs the amount of white space to be
       placed between staves, measured in CMN's units. Default = 3.
     - :line-separation. A number that governs the amount of white space to be
       placed between systems (i.e. not groups, but a line of music for the
       whole ensemble), measured in CMN's units. Default = 5.
     - :group-separation. A number that governs the amount of white space placed
       between groups in a system, measured in CMN's units. Default = 2.
     - :system-separation. An indication for how CMN determines the amount of
       white space between systems. If cmn::page-mark, only one system will be
       written per page. Default cmn::line-mark.
     - :page-height. A number to indicate the height of the page in centimeters.
       Default = 29.7.
     - :page-width. A number to indicate the width of the page in
       centimeters. Default = 21.0.
     - :all-output-in-one-file. T or NIL to indicate whether to write a separate
       file for each page of the resulting score. T = write all pages to the
       same multi-page file. Default = T.
     - :one-line-per-page. T or NIL to indicate whether to write just one line
       (system) to each page. T = one line per page. Default = NIL.
     - :start-bar-numbering. An integer that indicates the number to be given as
       the first bar number in the resulting EPS file. The bars will be numbered
       every five bars starting from this number. NB: The value of this argument
       is passed directly to a CMN function. If a value is given for this
       argument, slippery chicken's own bar-number writing function will be
       disabled. NB: It is recommended that a value not be passed for this
       argument if a value is given for :auto-bar-nums. NIL = bar 1. Default =
       NIL.
     - :auto-bar-nums. An integer or NIL to indicate a secondary bar numbering
       interval. This is separate from and in addition to the bar-number written
       in every part every 5 bars. It corresponds to CMN's
       automatic-measure-numbers. If set to e.g. 1, a bar number will be printed
       for every measure at the top of each system, or if :by-line, a bar number
       will be printed at the start of each line. NB: The value of this argument
       is passed directly to a CMN function. If a value is given for this
       argument, slippery chicken's own bar-number writing function will be
       disabled. NB: It is recommended that a value not be passed for this
       argument if a value is given for :start-bar-numbering. NIL = no secondary
       bar numbering. Default = NIL.
     - :rehearsal-letters-all-players. T or NIL to indicate whether rehearsal
       letters should be placed above the staves of all instruments in a score
       (this can be useful when generating parts). If NIL, rehearsal letters are
       only placed above the staves of the instruments at the top of each
       group. T = place rehearsal letters above all instruments. Default = NIL.
     - :tempi-all-players. T or NIL to indicate whether to print the tempo above
       all players' parts in the score. T = print above all players' parts.
       Default = NIL.
     - :process-event-fun. A user-defined function that takes one argument,
       namely an event object. The specified function will then be called for
       each event in the piece. This could be used, for example, to
       algorithmically add accents, dynamics, or change the colour of notes,
       etc. If NIL, no function will be applied. Default = NIL.
     - :automatic-octave-signs. T or NIL to indicate whether ottava signs should
       be inserted automatically when notes would otherwise need many ledger
       lines. T = automatically insert. Default = NIL.
     - :multi-bar-rests. T or NIL to indicate whether multiple bars of wrests
       should be consolidated when writing parts. T = consolidate. NIL = write
       each consecutive rest bar separately. Default = NIL.
     - :display-marks-in-part. T or NIL to indicate whether to print the marks
       stored in the MARKS-IN-PART slot of each rhythm object in the score. If
       NIL, the indications stored in the MARKS-IN-PART slot are added to parts
       only. T = also print to score. Default = NIL.
     - :add-postscript. NIL or postscript code to be added to the .eps file
       after it has been generated. See the add-ps-to-file function for details.
       Default = NIL.

RETURN VALUE

     Always T.

EXAMPLE

    ;;; The simplest usage
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :title "mini"
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1)))
            :rthm-seq-palette '((1 ((((2 4) (s) (s) e e e))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((vn (1))))))))
      (cmn-display mini :file "/tmp/mini.eps"))

    ;;; Used with some of the more frequently implemented keyword arguments
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (hn (french-horn :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5)))
                           (2 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5)))
                           (3 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (2 2 2 2 2))
                       (3 (3 3 3 3 3)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5))))
                                (2 ((((4 4) q e s s h))
                                    :pitch-seq-palette ((1 2 3 4 5))))
                                (3 ((((4 4) e s s h q))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((cl (1 3 2 1 2))
                                (hn (3 1 1 2 2))
                                (vc (1 1 3 2 2))))
                            (2 ((cl (3 1 1 2 2))
                                (hn (1 3 1 2 2))
                                (vc (3 2 2 1 1))))
                            (3 ((cl (1 1 3 2 2))
                                (hn (2 1 1 2 3))
                                (vc (3 1 1 2 2))))))))
      (cmn-display mini
                   :file "/tmp/cmn.eps"
                   :players '(cl vc)
                   :in-c nil
                   :respell-notes nil
                   :auto-clefs nil
                   :start-bar 8
                   :end-bar 13
                   :title "CMN Fragment"
                   :size 13
                   :page-nums nil
                   :empty-staves t
                   :display-sets t
                   :write-section-info t
                   :display-time t
                   :staff-separation 2
                   :line-separation 3))

    => T

SYNOPSIS

    #+cmn
    (defmethod cmn-display ((sc slippery-chicken)
                            &key
                            (respell-notes t)
                            (start-bar nil)
                            (start-bar-numbering nil)
                            (end-bar nil)
                            ;; MDE Fri Apr  6 13:27:08 2012
                            (title t)
                            (file "/tmp/cmn.eps")
                            (all-output-in-one-file t)
                            (one-line-per-page nil)
                            (staff-separation 3)
                            (line-separation 5)
                            (empty-staves nil)
                            (write-section-info nil)
                            (group-separation 2)
                            (system-separation cmn::line-mark)
                            (process-event-fun nil)
                            (display-sets nil)
                            (rehearsal-letters-all-players nil)
                            (display-marks-in-part nil)
                            (tempi-all-players nil)
                            (players nil)
                            (page-height 29.7)
                            (page-width 21.0)
                            (size 15)
                            (auto-bar-nums nil)
                            (page-nums t)
                            (in-c nil)
                            (auto-clefs t)
                            (multi-bar-rests nil)
                            (automatic-octave-signs nil)
                            (display-time nil)
                            (add-postscript nil))

## slippery-chicken/count-notes [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Returns the number of notes between start-bar and end-bar (both
     inclusive).

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the first bar in which notes will be counted.
     - An integer that is the last bar in which notes will be counted.

OPTIONAL ARGUMENTS

     - T or NIL to indicate whether to count just the number of attacked notes
       (not including ties) or the number of note events (including ties).
       T = just attacked notes. Default = NIL.
       NB: A chord counts as one note only.
     - NIL or a list of one or more IDs of the players whose notes should be
       counted. This can be a single symbol or a list of players. If NIL, the
       notes in all players' parts will be counted. Default = NIL.

RETURN VALUE

     An integer that is the number of notes.

EXAMPLE

    ;;; Using defaults
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s)
                                     (q (e) s +s h)
                                     ((e) s (s) (q) h))
                                    :pitch-seq-palette ((1 2 3 4 5 1 3 2)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (count-notes mini 2 11))

    => 62

    ;;; Counting all notes just for player 'vc
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s)
                                     (q (e) s +s h)
                                     ((e) s (s) (q) h))
                                    :pitch-seq-palette ((1 2 3 4 5 1 3 2)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (count-notes mini 2 11 nil 'vc))

    => 31

    ;;; Counting just the attacked notes for player 'vc
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s)
                                     (q (e) s +s h)
                                     ((e) s (s) (q) h))
                                    :pitch-seq-palette ((1 2 3 4 5 1 3 2)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (count-notes mini 2 11 t 'vc))

    => 27

SYNOPSIS

    (defmethod count-notes ((sc slippery-chicken) start-bar end-bar
                            &optional just-attacks players)

## slippery-chicken/find-note [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     09-Apr-2011

DESCRIPTION

     Print to the Listener the numbers of all bars in a specified player's part
     of a given slippery-chicken object in which the specified pitch is found.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.
     - A note-name pitch symbol or a list of note-name pitch symbols for the
       pitch to be sought. If a list, this will be handled as a chord.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :written. T or NIL to indicate whether to look for the specified pitch as
       as a written note only. T = as written only. Default = NIL.
     - :start-bar. An integer that is the first bar in which to search for the
       given pitch. This number is inclusive. Default = 1.
     - :end-bar. An integer that is the last bar in which to search for the
       given pitch. This number is inclusive. Default = number of bars in the
       given slippery-chicken object.

RETURN VALUE

     Returns a list of all corresponding event objects found. Prints the bar
     numbers of the results directly to the Lisp listener.

EXAMPLE

    ;;; Prints the bar number for all occurrences in the entire piece by default
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s)
                                     (q (e) s +s h)
                                     ((e) s (s) (q) h))
                                    :pitch-seq-palette ((1 2 3 4 5 1 3 2)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (find-note mini 'vc 'f4))

    =>
    bar 1
    bar 3
    bar 4
    bar 6
    bar 7
    bar 9
    bar 10
    bar 12
    bar 13
    bar 15
    bar 16
    bar 18
    bar 19
    bar 21
    bar 22
    bar 24
    bar 25
    bar 27
    bar 28
    bar 30
    bar 31
    bar 33
    bar 34
    bar 36
    bar 37
    bar 39
    bar 40
    bar 42
    bar 43
    bar 45

    ;;; Examples of use specifying the optional arguments
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s)
                                     (q (e) s +s h)
                                     ((e) s (s) (q) h))
                                    :pitch-seq-palette ((1 2 3 4 5 1 3 2)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (find-note mini 'cl 'f3)
      (find-note mini 'cl 'f3 :written t)
      (find-note mini 'vc 'f4 :start-bar 3 :end-bar 17))

SYNOPSIS

    (defmethod find-note ((sc slippery-chicken) player note &key (written nil)
                          start-bar end-bar)

## slippery-chicken/find-rehearsal-letters [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return in list form the numbers of bars in the given slippery-chicken
     object that have rehearsal letters.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     A list of numbers.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 60)))
            :rehearsal-letters '(2 5 7)
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((2 4) (s) (s) e e e))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((vn (1 1 1 1 1 1 1))))))))
      (find-rehearsal-letters mini))

    => (2 5 7)

SYNOPSIS

    (defmethod find-rehearsal-letters ((sc slippery-chicken))

## slippery-chicken/get-all-section-refs [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return all section IDs as a list of lists. Subsection IDs will be contained
     in the same sublists as their enclosing sections.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     A list of lists.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1))
                       (2 (1 1 1))
                       (3 ((a (1 1 1))
                           (b ((x (1 1 1))
                               (y (1 1 1))))))
                       (4 ((a (1 1 1))
                           (b (1 1 1))
                           (c (1 1 1 1))))
                       (5 (1 1 1))
                       (6 (1 1 1))
                       (7 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1))))
                            (2 ((sax (1 1 1))))
                            (3 ((a ((sax (1 1 1))))
                                (b ((x ((sax (1 1 1))))
                                    (y ((sax (1 1 1))))))))
                            (4 ((a ((sax (1 1 1))))
                                (b ((sax (1 1 1))))
                                (c ((sax (1 1 1 1))))))
                            (5 ((sax (1 1 1))))
                            (6 ((sax (1 1 1))))
                            (7 ((sax (1 1 1))))))))
       (get-all-section-refs mini))

    => ((1) (2) (3 A) (3 B X) (3 B Y) (4 A) (4 B) (4 C) (5) (6) (7))

SYNOPSIS

    (defmethod get-all-section-refs ((sc slippery-chicken))

## slippery-chicken/get-bar [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get the rthm-seq-bar object located at a specified bar number within a
     given player's part.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of the bar within the overall piece for
       which the rthm-seq-bar object is sought.
     - The ID of the player from whose part the rthm-seq-bar object is
       sought. If this is passed as NIL, the method will return the rthm-seq-bar
       objects for all players in the ensemble at the specified bar number.
       NB: Although listed as an optional argument, the player ID is actually
       required. It is listed as optional due to method inheritance.

OPTIONAL ARGUMENTS

     - (see the comment on the <player> argument above.

RETURN VALUE

     A rthm-seq-bar object (or objects).

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s)
                                     (q e s s h)
                                     (e s s q h))
                                    :pitch-seq-palette ((1 2 3 4 5
                                                           1 3 2 4 5
                                                           3 5 2 4 1)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (get-bar mini 17 'cl))

    =>
    RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: NIL, bar-num: 17,
                  old-bar-nums: NIL, write-bar-num: NIL, start-time: 64.000,
                  start-time-qtrs: 64.0, is-rest-bar: NIL, multi-bar-rest: NIL,
                  show-rest: T, notes-needed: 5,
                  tuplets: NIL, nudge-factor: 0.35, beams: NIL,
                  current-time-sig: 2, write-time-sig: NIL, num-rests: 0,
                  num-rhythms: 5, num-score-notes: 5, parent-start-end: NIL,
                  missing-duration: NIL, bar-line-type: 0,
                  player-section-ref: (2 CL), nth-seq: 0, nth-bar: 1,
                  rehearsal-letter: NIL, all-time-sigs: (too long to print)
                  sounding-duration: 4.000,
                  rhythms: (
    [...]

SYNOPSIS

    (defmethod get-bar ((sc slippery-chicken) bar-num &optional player)

## slippery-chicken/get-bar-from-ref [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return a rthm-seq-bar object from the piece by specifying its section,
     sequence number, bar number, and the player. Sequenz-num and bar-num are
     1-based.

ARGUMENTS

     - A slippery-chicken object.
     - A section ID (number or list).
     - A player ID.
     - An integer that is the number of the sequence in the section from which
       the bar is to be returned (1-based).
     - An integer that is the number of the bar within the given sequence
       (1-based).

RETURN VALUE

     A rthm-seq-bar object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s)
                                     (q e s s h)
                                     (e s s q h))
                                    :pitch-seq-palette ((1 2 3 4 5
                                                           1 3 2 4 5
                                                           3 5 2 4 1)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (get-bar-from-ref mini 2 'vc 3 2))

    =>
    RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: NIL, bar-num: 23,
                  old-bar-nums: NIL, write-bar-num: NIL, start-time: 88.000,
                  start-time-qtrs: 88.0, is-rest-bar: NIL, multi-bar-rest: NIL,
                  show-rest: T, notes-needed: 5,
                  tuplets: NIL, nudge-factor: 0.35, beams: NIL,
                  current-time-sig: 2, write-time-sig: NIL, num-rests: 0,
                  num-rhythms: 5, num-score-notes: 5, parent-start-end: NIL,
                  missing-duration: NIL, bar-line-type: 0,
                  player-section-ref: (2 VC), nth-seq: 2, nth-bar: 1,
                  rehearsal-letter: NIL, all-time-sigs: (too long to print)
                  sounding-duration: 4.000,
                  rhythms: (
    [...]

SYNOPSIS

    (defmethod get-bar-from-ref ((sc slippery-chicken) section player
                                 sequenz-num bar-num)

## slippery-chicken/get-bar-num-from-ref [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get the bar number of a given rthm-seq-bar object by specifying the
     section, sequenz, and number of the bar within that sequenz.

ARGUMENTS

     - A slippery-chicken object.
     - The ID of the section in which the given rthm-seq-bar object is located.
     - An integer that is the number of the sequence within that section in
       which the rthm-seq-bar object is located.
     - The number of the bar within the given rthm-seq-bar object for which the
       overall bar number (within the entire piece) is sought.

RETURN VALUE

     An integer.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s)
                                     (q e s s h)
                                     (e s s q h))
                                    :pitch-seq-palette ((1 2 3 4 5
                                                           1 3 2 4 5
                                                           3 5 2 4 1)))))
            :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (2 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))
                            (3 ((cl (1 1 1 1 1))
                                (vc (1 1 1 1 1))))))))
      (get-bar-num-from-ref mini 2 4 3))

    => 27

SYNOPSIS

    (defmethod get-bar-num-from-ref ((sc slippery-chicken) section
                                     sequenz-num bar-num)

## slippery-chicken/get-clef [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     11-Apr-2011

DESCRIPTION

     Get the clef symbol attached to a specified event.

     NB: The very first clef symbol in the very first measure of a given
         player's part is determined by the corresponding instrument object and
         attached to differently; as such, it cannot be retrieved using this
         method.
     NB: All clef symbols after the starting clef are added using the auto-clefs
         method, either directly or by default in the cmn-display or
         write-lp-data-for-all methods.

ARGUMENTS

     - A slippery-chicken object.
     - (NB: The optional arguments are actually required.)

OPTIONAL ARGUMENTS

     NB: The optional arguments are actually required.
     - An integer that is the number of the bar from which to return the clef
       symbol.
     - An integer that is the number of the event object within that bar from
       which to retrieve the clef symbol.
     - The ID of the player from whose part the clef symbol is to be returned.

RETURN VALUE

     A clef symbol.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vc (cello :midi-channel 1))))
            :tempo-map '((1 (q 96)))
            :set-palette '((1 ((g2 f4 e5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((5 4) e e e e e e e e e e))
                                    :pitch-seq-palette ((1 1 2 2 2 2 3 3 3 1)))))
            :rthm-seq-map '((1 ((vc (1 1 1))))))))
      (auto-clefs mini)
      (get-clef mini 1 3 'vc))

    => TENOR

SYNOPSIS

    (defmethod get-clef ((sc slippery-chicken) &optional bar-num event-num player)

## slippery-chicken/get-current-instrument-for-player [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get the currently active instrument for a given player in a specified
     sequence of a slippery-chicken object, as defined in the
     instrument-change-map.

ARGUMENTS

     - The ID of the section from which to retrieve the current instrument for
       the specified player. This can also be a reference, e.g. in the form
       '(2 1).
     - The ID of the player for whom the current instrument is sought.
     - The number of the sequence from which to retrieve the current
       instrument. This is a 1-based number.  A slippery-chicken object.

RETURN VALUE

     An instrument object.

EXAMPLE

    (let ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))
                          (db (double-bass :midi-channel 2))))
             :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                      (2 ((sax ((2 alto-sax) (5 tenor-sax))))))
             :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
             :set-map '((1 (1 1 1 1 1))
                        (2 (1 1 1 1 1)))
             :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                     :pitch-seq-palette ((1 2 3 4 5)))))
             :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                 (db (1 1 1 1 1))))
                             (2 ((sax (1 1 1 1 1))
                                 (db (1 1 1 1 1))))))))
      (get-current-instrument-for-player 2 'sax 3 mini))

    =>
    INSTRUMENT: lowest-written: BF3, highest-written: FS6
                lowest-sounding: CS3, highest-sounding: A5
                starting-clef: TREBLE, clefs: (TREBLE), clefs-in-c: (TREBLE)
                prefers-notes: NIL, midi-program: 66
                transposition: EF, transposition-semitones: -9
                score-write-in-c: NIL, score-write-bar-line: NIL
                chords: NIL, chord-function: NIL,
                total-bars: 5 total-notes: 25, total-duration: 20.000
                total-degrees: 2920, microtones: T
                missing-notes: (BQF3 BQF4), subset-id: NIL
                staff-name: alto saxophone, staff-short-name: alt sax,

                largest-fast-leap: 999, tessitura: BQF3
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: ALTO-SAX, tag: NIL,
    data: NIL

SYNOPSIS

    (defmethod get-current-instrument-for-player (section player sequence
                                                  (sc slippery-chicken))

## slippery-chicken/get-event [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Retrieve a specified event object from a slippery-chicken object, giving
     bar number, event number, and player.

     NB: This counts returns event objects, regardless of whether they are notes
         or rests.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of the bar from which the event object is
       to be returned.
     - An integer that is the number of the event object to be returned from
       that bar. This number is 1-based and counts all events, including notes,
       rests, and tied notes.

RETURN VALUE

     An event object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((2 4) (e) e+e. 32 (32)))
                                    :pitch-seq-palette (((1) 2)))))
            :rthm-seq-map '((1 ((vn (1 1 1))
                                (vc (1 1 1))))))))
      (get-event mini 2 4 'vn))

    =>
    EVENT: start-time: 3.750, end-time: 3.875,
           duration-in-tempo: 0.125,
           compound-duration-in-tempo: 0.125,
           amplitude: 0.700
           bar-num: 2, marks-before: NIL,
           tempo-change: NIL
           instrument-change: NIL
           display-tempo: NIL, start-time-qtrs: 3.750,
           midi-time-sig: NIL, midi-program-changes: NIL,
           8va: 0
           pitch-or-chord:
    PITCH: frequency: 293.665, midi-note: 62, midi-channel: 1
           pitch-bend: 0.0
           degree: 124, data-consistent: T, white-note: D4
           nearest-chromatic: D4
           src: 1.122462, src-ref-pitch: C4, score-note: D4
           qtr-sharp: NIL, qtr-flat: NIL, qtr-tone: NIL,
           micro-tone: NIL,
           sharp: NIL, flat: NIL, natural: T,
           octave: 4, c5ths: 0, no-8ve: D, no-8ve-no-acc: D
           show-accidental: T, white-degree: 29,
           accidental: N,
           accidental-in-parentheses: NIL, marks: NIL
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: D4, tag: NIL,
    data: D4
    **************

           written-pitch-or-chord: NIL
    RHYTHM: value: 32.000, duration: 0.125, rq: 1/8, is-rest: NIL,
            score-rthm: 32.0, undotted-value: 32, num-flags: 3, num-dots: 0,
            is-tied-to: NIL, is-tied-from: NIL, compound-duration: 0.125,
            is-grace-note: NIL, needs-new-note: T, beam: NIL, bracket: NIL,
            rqq-note: NIL, rqq-info: NIL, marks: NIL, marks-in-part: NIL,
            letter-value: 32, tuplet-scaler: 1, grace-note-duration: 0.05
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: 32, tag: NIL,
    data: 32

SYNOPSIS

    (defmethod get-event ((sc slippery-chicken) bar-num event-num player)

## slippery-chicken/get-events-from-to [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     22-Jul-2011 (Pula)

DESCRIPTION

     Return a list of event objects for a given player, specifying the region by
     bar and event number.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.
     - An integer (1-based) that is the first bar from which to return events.
     - An integer (1-based) that is the first event object in the start-bar to
       return.
     - An integer (1-based) that is the last bar from which to return events.

OPTIONAL ARGUMENTS

     - An integer (1-based) that is the last event within the end-bar to
       return.

RETURN VALUE

     A list of event objects.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))
                         (db (double-bass :midi-channel 2))))
            :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                     (2 ((sax ((2 alto-sax) (5 tenor-sax))))))
            :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))
                            (2 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))))))
      (get-events-from-to mini 'sax 3 2 5 3))

    =>
    (
     EVENT: start-time: 10.000, end-time: 11.000,
            duration-in-tempo: 1.000,
            compound-duration-in-tempo: 1.000,
            amplitude: 0.700
            bar-num: 3, marks-before: NIL,
            tempo-change: NIL
            instrument-change: NIL
            display-tempo: NIL, start-time-qtrs: 10.000,
            midi-time-sig: NIL, midi-program-changes: NIL,
            8va: 0
            pitch-or-chord:
            PITCH: frequency: 164.814, midi-note: 52, midi-channel: 1
            pitch-bend: 0.0
            degree: 104, data-consistent: T, white-note: E3
            nearest-chromatic: E3
            src: 0.62996054, src-ref-pitch: C4, score-note: E3
            qtr-sharp: NIL, qtr-flat: NIL, qtr-tone: NIL,
            micro-tone: NIL,
            sharp: NIL, flat: NIL, natural: T,
            octave: 3, c5ths: 0, no-8ve: E, no-8ve-no-acc: E
            show-accidental: T, white-degree: 23,
            accidental: N,
            accidental-in-parentheses: NIL, marks: NIL
            LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
            NAMED-OBJECT: id: E3, tag: NIL,
            data: E3
            **************

            written-pitch-or-chord:
            PITCH: frequency: 369.994, midi-note: 66, midi-channel: 1
            pitch-bend: 0.0
            degree: 132, data-consistent: T, white-note: F4
            nearest-chromatic: FS4
            src: 1.4142135, src-ref-pitch: C4, score-note: FS4
            qtr-sharp: NIL, qtr-flat: NIL, qtr-tone: NIL,
            micro-tone: NIL,
            sharp: T, flat: NIL, natural: NIL,
            octave: 4, c5ths: 1, no-8ve: FS, no-8ve-no-acc: F
            show-accidental: T, white-degree: 31,
            accidental: S,
            accidental-in-parentheses: NIL, marks: NIL
            LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
            NAMED-OBJECT: id: FS4, tag: NIL,
            data: FS4
            **************

            RHYTHM: value: 4.000, duration: 1.000, rq: 1, is-rest: NIL,
            score-rthm: 4.0, undotted-value: 4, num-flags: 0, num-dots: 0,
            is-tied-to: NIL, is-tied-from: NIL, compound-duration: 1.000,
            is-grace-note: NIL, needs-new-note: T, beam: NIL, bracket: NIL,
            rqq-note: NIL, rqq-info: NIL, marks: NIL, marks-in-part: NIL,
            letter-value: 4, tuplet-scaler: 1, grace-note-duration: 0.05
            LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
            NAMED-OBJECT: id: Q, tag: NIL,
            data: Q
            **************

            EVENT: start-time: 11.000, end-time: 11.500,
            [...]

SYNOPSIS

    (defmethod get-events-from-to ((sc slippery-chicken) player start-bar
                                   start-event end-bar &optional end-event)

## slippery-chicken/get-instrument-for-player-at-bar [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     09-Feb-2011

DESCRIPTION

     Get the current instrument for a specified player at a specified bar number
     in a slippery-chicken object, as defined in the instrument-change-map.

ARGUMENTS

     - The ID of a player in the slippery-chicken object.
     - An integer that is the number of the bar from which to get the current
       instrument.
     - A slippery-chicken object.

RETURN VALUE

     An instrument object.

EXAMPLE

    (let* ((mini
            (make-slippery-chicken
             '+mini+
             :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))
                          (db (double-bass :midi-channel 2))))
             :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                      (2 ((sax ((2 alto-sax) (5 tenor-sax))))))
             :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
             :set-map '((1 (1 1 1 1 1))
                        (2 (1 1 1 1 1)))
             :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                     :pitch-seq-palette ((1 2 3 4 5)))))
             :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                 (db (1 1 1 1 1))))
                             (2 ((sax (1 1 1 1 1))
                                 (db (1 1 1 1 1))))))))
      (get-instrument-for-player-at-bar 'sax 3 mini))

    =>
    INSTRUMENT: lowest-written: BF3, highest-written: FS6
                lowest-sounding: AF2, highest-sounding: E5
                starting-clef: TREBLE, clefs: (TREBLE), clefs-in-c: (BASS TREBLE)
                prefers-notes: NIL, midi-program: 67
                transposition: BF, transposition-semitones: -14
                score-write-in-c: NIL, score-write-bar-line: NIL
                chords: NIL, chord-function: NIL,
                total-bars: 5 total-notes: 25, total-duration: 20.000
                total-degrees: 2710, microtones: T
                missing-notes: (FQS3 FQS4), subset-id: NIL
                staff-name: tenor sax, staff-short-name: ten sax,

                largest-fast-leap: 999, tessitura: FS3
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: TENOR-SAX, tag: NIL,
    data: NIL

SYNOPSIS

    (defmethod get-instrument-for-player-at-bar (player bar (sc slippery-chicken))

## slippery-chicken/get-note [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get a numbered event from a specified bar of a given player's part within a
     slippery-chicken object.

     NB: Slippery-chicken doesn't have 'note' and 'rest' classes, rather both of
         these are events. The nomenclature 'note' and 'rest' are thus used here
         and elsewhere merely for convenience, to distinguish between sounding
         and non-sounding events.

     See also rthm-seq-bar methods for accessing notes by other means.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of the bar from which to get the note
       (counting from 1).
     - An integer that is the number of the note to get within that bar,
       counting tied notes (counting from 1). This can also be a list of numbers
       if accessing pitches in a chord (see below).
     - The ID of the player from whose part the note is to be retrieved.

OPTIONAL ARGUMENTS

     - T or NIL to indicate whether, when accessing a pitch in a chord, to
       return the written or sounding pitch. T = written. Default = NIL.

RETURN VALUE

     An event object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1)))
            :rthm-seq-palette '((1 ((((2 4) (e) e+e. 32 (32)))
                                    :pitch-seq-palette (((1) 2)))))
            :rthm-seq-map '((1 ((vn (1))))))))
      (print (data (get-rest mini 1 2 'vn)))
      (print (data (get-note mini 1 2 'vn)))
      (print (data (get-note mini 1 '(2 1) 'vn)))
      (print (data (get-note mini 1 '(2 2) 'vn)))
      (print (is-tied-from (get-note mini 1 1 'vn))))

    =>
    32
    "E."
    C4
    A4
    T

SYNOPSIS

    (defmethod get-note ((sc slippery-chicken) bar-num note-num player
                         &optional written)

## slippery-chicken/get-num-sections [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the number of sections in the given slippery-chicken object, as
     defined in e.g. in the set-map.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     An integer that is the number of section.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1 1))
                       (2 (1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1))))
                            (2 ((sax (1 1 1))))
                            (3 ((sax (1 1 1 1 1))))))))
      (get-num-sections mini))

    => 3

SYNOPSIS

    (defmethod get-num-sections ((sc slippery-chicken))

## slippery-chicken/get-player [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the player object for the specified player.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.

RETURN VALUE

     A player object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((fl (flute :midi-channel 1))
                         (tp (b-flat-trumpet :midi-channel 2))
                         (vn (violin :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((fl (1 1 1 1 1))
                                (tp (1 1 1 1 1))
                                (vn (1 1 1 1 1))))))))
      (get-player mini 'vn))

    =>
    PLAYER: (id instrument-palette): SLIPPERY-CHICKEN-STANDARD-INSTRUMENT-PALETTE
    doubles: NIL, cmn-staff-args: NIL, total-notes: 25, total-degrees: 3548,
    total-duration: 20.000, total-bars: 5, tessitura: B4
    LINKED-NAMED-OBJECT: previous: (TP), this: (VN), next: NIL
    NAMED-OBJECT: id: VN, tag: NIL,
    data:
    INSTRUMENT: lowest-written: G3, highest-written: C7
                lowest-sounding: G3, highest-sounding: C7
                starting-clef: TREBLE, clefs: (TREBLE), clefs-in-c: (TREBLE)
                prefers-notes: NIL, midi-program: 41
                transposition: C, transposition-semitones: 0
                score-write-in-c: NIL, score-write-bar-line: NIL
                chords: T, chord-function: VIOLIN-CHORD-SELECTION-FUN,
                total-bars: 5 total-notes: 25, total-duration: 20.000
                total-degrees: 3548, microtones: T
                missing-notes: NIL, subset-id: NIL
                staff-name: violin, staff-short-name: vln,

                largest-fast-leap: 13, tessitura: B4
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: VIOLIN, tag: NIL,
    data: NIL

SYNOPSIS

    (defmethod get-player ((sc slippery-chicken) player)

## slippery-chicken/get-rest [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Retrieve the event object that contains the specified rest in a
     slippery-chicken object by giving bar number, rest number and player.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of the bar from which to retrieve the rest
       event object.
     - An integer that is the number of the rest (not the number of the event)
       within that bar, counting from 1.
     - The ID of the player from whose part to retrieve the rest object.

RETURN VALUE

     An event object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))
                         (vc (cello :midi-channel 2))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((2 4) (e) e+e. 32 (32)))
                                    :pitch-seq-palette (((1) 2)))))
            :rthm-seq-map '((1 ((vn (1 1 1))
                                (vc (1 1 1))))))))
      (get-rest mini 2 1 'vc))

    =>
    EVENT: start-time: 2.000, end-time: 2.500,
           duration-in-tempo: 0.500,
           compound-duration-in-tempo: 0.500,
           amplitude: 0.700
           bar-num: 2, marks-before: NIL,
           tempo-change: NIL
           instrument-change: NIL
           display-tempo: NIL, start-time-qtrs: 2.000,
           midi-time-sig: NIL, midi-program-changes: NIL,
           8va: 0
           pitch-or-chord: NIL
           written-pitch-or-chord: NIL
    RHYTHM: value: 8.000, duration: 0.500, rq: 1/2, is-rest: T,
            score-rthm: 8.0, undotted-value: 8, num-flags: 1, num-dots: 0,
            is-tied-to: NIL, is-tied-from: NIL, compound-duration: 0.500,
            is-grace-note: NIL, needs-new-note: NIL, beam: NIL, bracket: NIL,
            rqq-note: NIL, rqq-info: NIL, marks: NIL, marks-in-part: NIL,
            letter-value: 8, tuplet-scaler: 1, grace-note-duration: 0.05
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: E, tag: NIL,
    data: E

SYNOPSIS

    (defmethod get-rest ((sc slippery-chicken) bar-num rest-num player)

## slippery-chicken/get-section [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the section object with the specified reference ID.

ARGUMENTS

     - A slippery-chicken object.
     - A reference ID.

RETURN VALUE

     A section object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))
                         (db (double-bass :midi-channel 2))))
            :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))
                            (2 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))))))
      (get-section mini 2))

    =>
    SECTION:
    RECURSIVE-ASSOC-LIST: recurse-simple-data: NIL
    num-data: 2
    linked: T
    full-ref: (2)
    ASSOC-LIST: warn-not-found NIL
    CIRCULAR-SCLIST: current 0
    SCLIST: sclist-length: 2, bounds-alert: T, copy: T
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    BAR-HOLDER:
    start-bar: 6
    end-bar: 10
    num-bars: 5
    start-time: 20.0
    end-time: 40.0
    start-time-qtrs: 0
    end-time-qtrs: 40.0
    num-notes (attacked notes, not tied): 50
    num-score-notes (tied notes counted separately): 50
    num-rests: 0
    duration-qtrs: 20.0
    duration: 20.0 (20.000)

SYNOPSIS

    (defmethod get-section ((sc slippery-chicken) reference)

## slippery-chicken/get-section-refs [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     07-May-2012

DESCRIPTION

     Return the reference IDs for all section and subsections of a given
     slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the first top-level section for which to return the
       reference IDs. As this number refers to the number of top-level sections
       only, any subsections will be contained in these and only count as 1.
     - An integer that is the number of consecutive sections to return section
       reference IDs.

RETURN VALUE

     A list of lists containing the section reference IDs of the specified
     range in the slippery-chicken object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1))
                       (2 (1 1 1))
                       (3 ((a (1 1 1))
                           (b ((x (1 1 1))
                               (y (1 1 1))))))
                       (4 ((a (1 1 1))
                           (b (1 1 1))
                           (c (1 1 1 1))))
                       (5 (1 1 1))
                       (6 (1 1 1))
                       (7 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1))))
                            (2 ((sax (1 1 1))))
                            (3 ((a ((sax (1 1 1))))
                                (b ((x ((sax (1 1 1))))
                                    (y ((sax (1 1 1))))))))
                            (4 ((a ((sax (1 1 1))))
                                (b ((sax (1 1 1))))
                                (c ((sax (1 1 1 1))))))
                            (5 ((sax (1 1 1))))
                            (6 ((sax (1 1 1))))
                            (7 ((sax (1 1 1))))))))
      (get-section-refs mini 2 4))

    => ((2) (3 A) (3 B X) (3 B Y) (4 A) (4 B) (4 C) (5))

SYNOPSIS

    (defmethod get-section-refs ((sc slippery-chicken) start-section num-sections)

## slippery-chicken/get-sequenz-from-section [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

ARGUMENTS

OPTIONAL ARGUMENTS

RETURN VALUE

EXAMPLE

SYNOPSIS

    (defmethod get-sequenz-from-section ((sc slippery-chicken)
                                         section-ref player-ref seq-num) ; 1-based

## slippery-chicken/get-starting-ins [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the instrument object that is the first instrument object used by a
     specified player in a given slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.

RETURN VALUE

     An instrument object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))
                         (db (double-bass :midi-channel 2))))
            :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                     (2 ((sax ((2 alto-sax) (5 tenor-sax))))))
            :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))
                            (2 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))))))
      (get-starting-ins mini 'sax))

    =>
    INSTRUMENT: lowest-written: BF3, highest-written: FS6
    lowest-sounding: CS3, highest-sounding: A5
    starting-clef: TREBLE, clefs: (TREBLE), clefs-in-c: (TREBLE)
    prefers-notes: NIL, midi-program: 66
    transposition: EF, transposition-semitones: -9
    score-write-in-c: NIL, score-write-bar-line: NIL
    chords: NIL, chord-function: NIL,
    total-bars: 5 total-notes: 25, total-duration: 20.000
    total-degrees: 2920, microtones: T
    missing-notes: (BQF3 BQF4), subset-id: NIL
    staff-name: alto saxophone, staff-short-name: alt sax,

    largest-fast-leap: 999, tessitura: BQF3
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: ALTO-SAX, tag: NIL,
    data: NIL

SYNOPSIS

    (defmethod get-starting-ins ((sc slippery-chicken) player) ; symbol

## slippery-chicken/get-tempo [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the tempo object in effect for a specified bar of a given
     slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of a bar within that slippery-chicken
       object.

RETURN VALUE

     A tempo object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :tempo-map '((1 (q 60)) (5 (e 72)) (7 (q. 176 "prestissimo")))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1 1 1 1))))))))
      (get-tempo mini 6))

    =>
    TEMPO: bpm: 72, beat: E, beat-value: 8.0, qtr-dur: 1.6666666
           qtr-bpm: 36.0, usecs: 1666666, description: NIL
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: NIL, tag: NIL,
    data: 72

SYNOPSIS

    (defmethod get-tempo ((sc slippery-chicken) bar-num)

## slippery-chicken/get-time-sig [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get the time-sig object associate with a specified bar number in a given
     slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.
     - An integer that is the number of the bar for which to the time-sig object
       is to be returned. NB: Although this argument is listed as optional in
       the method definition (due to inheritance), it is actually required.

OPTIONAL ARGUMENTS

     - (see above).

RETURN VALUE

     A time-sig object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s)
                                     ((5 8) q e s s e)
                                     ((3 16) s e))
                                    :pitch-seq-palette ((1 2 3 4 5 1 2 3 4 5 1
                                                           2)))))
            :rthm-seq-map '((1 ((sax (1 1 1))))))))
      (get-time-sig mini 2))

    =>
    TIME-SIG: num: 5, denom: 8, duration: 2.5, compound: NIL, midi-clocks: 24, num-beats: 5
    SCLIST: sclist-length: 2, bounds-alert: T, copy: T
    LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
    NAMED-OBJECT: id: "0508", tag: NIL,
    data: (5 8)

SYNOPSIS

    (defmethod get-time-sig ((sc slippery-chicken) &optional bar-num)

## slippery-chicken/get-transposition-at-bar [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     24-Mar-2011

DESCRIPTION

     Return the number of semitones difference between the sounding pitches and
     written pitches of a given player's part in a specified bar within a
     slippery-chicken object; e.g. bass clarinet = -14.

ARGUMENTS

     - The ID of the player for whom the transposition value is sought.
     - An integer which is the number of the bar for which the transposition
       value is sought.
     - A slippery-chicken object.

RETURN VALUE

     An integer.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
             :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
             :set-map '((1 (1 1 1)))
             :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                     :pitch-seq-palette ((1 2 3 4 5)))))
             :rthm-seq-map '((1 ((sax (1 1 1))))))))
      (get-transposition-at-bar 'sax 2 mini))

    => -9

SYNOPSIS

    (defmethod get-transposition-at-bar (player bar (sc slippery-chicken))

## slippery-chicken/make-slippery-chicken [ Functions ]

[ Top ] [ slippery-chicken ] [ Functions ]

DESCRIPTION

     Make a slippery-chicken object using the specified data. This is the
     function that will be used most often to "put it all together", and many of
     its slots require full objects of other classes rather than just straight
     data. These objects, such as rthm-seq-palette, rthm-seq-map etc, are also
     documented in detail elsewhere in the robodoc and the user's manual.

ARGUMENTS

     - A symbol that is the name/ID of the object. The value passed to this
       argument will be made into a global variable, so that the newly created
       slippery-chicken object and the data it contains remain in memory and can
       be accessed and modified after the object is generated.

OPTIONAL ARGUMENTS

     keyword arguments:
     NB: Although these arguments are technically optional, the slippery-chicken
         object will only be complete and make musical sense if many of the core
         elements are present.
     - :title. A string that will be used as the title of the piece. The value
       given for this object will be used as both the header for the printable
       output as well as the base for any file names generated by the
       write-lp-data-for-all method.  Default = "slippery-chicken-piece".
     - :instrument-palette. An instrument-palette object. This will be the
       palette of instrument objects available to the players of in the given
       slippery-chicken object's ensemble slot.
       Default = +slippery-chicken-standard-instrument-palette+.
     - :ensemble. A recursive association list that will be used as the data to
       create an ensemble object populated with player objects within the
       slippery-chicken object. The format of this list will be a list of
       user-defined player IDs each coupled with a list of instrument object IDs
       from the current instrument-palette and various player object
       parameters. See the user's manual and robodoc entries on the ensemble and
       player classes for more detail.
     - :set-palette. A recursive association list that will be used as the data
       to create a set-palette object within the slippery-chicken object. This
       object is where the collections of possible pitches for any given
       sequence are defined. The format of this list will be a list of IDs for
       each set of pitches, each coupled with a list of note-name symbols for
       the pitches that will be used to make that set. See the user's manual and
       the robodoc entry on the set-palette class for more detail.
     - :set-map. A recursive association list that will be used as the data to
       create a set-map object within the slippery-chicken object. This is where
       the order in which the pitch collections defined in the set-palette will
       be used in the piece. The format of this list will be a list of IDs from
       the given slippery-chicken object's structure coupled with a list of IDs
       from those given to the sets in the set-palette. There must be an equal
       number of sections in this list as there are in the rthm-seq-map, and
       they must have identical names. There must be an equal number of
       individual set IDs in each list paired with the section IDs as there are
       in the corresponding lists of the rthm-seq-map. See the user's manual and
       the robodoc entries for the set-map and sc-map for more detail.
     - :rthm-seq-palette. A recursive association list that will be used as the
       data to create a rthm-seq-palette object within the slippery-chicken
       object. This object is where the collections of possible rhythm sequences
       for any given sequence in the piece are defined. This list will take the
       format of a list of IDs paired with a list of data for individual
       rthm-seq objects. These in turn will consist of one or more lists of
       rhythm data for rthm-seq-bar objects, as well pitch-seq-palettes and
       marks data for the individual rthm-seq objects to be created. See the
       user's manual as well as the robodoc entries for rthm-seq-palette,
       rthm-seq, rthm-seq-bar, rhythm, and pitch-seq-palette for more detail.
     - :rthm-seq-map. A recursive association list that will be used as the data
       to create a rthm-seq-map object within the slippery-chicken object. This
       is where the order in which the rhythm sequences defined in the
       rthm-seq-palette will be used in the piece. It will take the format of a
       list of section IDs, of which there must be an equal number as are given
       in the set-map, each coupled with a list of player IDs, as defined in the
       ensemble slot of the given slippery-chicken object. The player IDs in
       turn are coupled with a list of IDs for rthm-seq objects, as defined in
       the rthm-seq-palette. Each of these lists must contain the same number of
       elements as are contained in each of the set-map sections. See the user's
       manual and robodoc entries for rthm-seq-map and sc-map for more details.
     - :snd-output-dir. A string that will be used as the directory path for any
       output generated by clm-play in conjunction with sound files listed in
       the sndfile-palette (see below). Default = "/tmp/".
     - :sndfile-palette. A recursive association list that will be used as the
       data to create a sndfile-palette object within the slippery-chicken
       object. This is where the list is defined that contains all possible
       source sound files which may be used in conjunction with output generated
       by clm-play. This list will take the format of a list of IDs for
       sound-file groups, coupled with lists of file names and various other
       parameters associated with the sndfile class. The list of sound-file
       groups is followed by a list of directory paths where the given sound
       files are located and an optional list of file extensions. See the user's
       manual and the robodoc entries on sndfile-palette, sndfile, and clm-play
       for more detail.
     - :tempo-map. A recursive association list that will be used as the data to
       create tempo objects within the slippery-chicken object. This is one of
       two options for specifying the sequence of tempo changes for a given
       piece (also see tempo-curve below). The format will be a list of integers
       that are measure numbers within the piece, each coupled with tempo
       indications in the form (beat-unit bpm). See the user's manual as well as
       the robodoc entry for tempo-map for more detail. NB: This slot cannot be
       used together with :tempo-curve.
     - :tempo-curve. A list of data that will be used to create tempo objects
       within the slippery-chicken object, based on an interpolated list of
       break-point pairs.  This is one of two options for specifying the
       sequence of tempo changes for a given piece (also see tempo-map above.)
       The first item in the list will be the number of bars between each new
       tempo object. The second item is the beat basis for the tempo objects
       made. The third and final argument is the list of break-point pairs, of
       which the first is a value on an arbitrary x-axis and the second is a
       number of beats-per-minute. See the user's manual and the robodoc entry
       for tempo-curve for more detail. NB: This slot cannot be used together
       with :tempo-map.
     - :staff-groupings. A list of integers that indicate the placement of group
       brackets for the printable output. Each number represents a consecutive
       number of players, in the order they appear in the ensemble object, that
       will be included in each consecutive group. The sum of the numbers in
       this list must be equal to the number of players in the ensemble. See the
       user's manual for more detail.
     - :instrument-change-map. A recursive association list that will be used as
       the data to create an instrument-change-map object within the
       slippery-chicken object. This will be used to indicate where those
       players in the ensemble that play multiple instruments will change
       instruments. The format will be a list of section IDs coupled with a list
       of player IDs, each of which in turn is coupled with a list of 2-item
       lists consisting of a sequence number paired with the ID (name) of one of
       the instrument objects assigned to that player in the ensemble
       object. See the user's manual and the robodoc entries for
       instrument-change-map for more detail.
     - :set-limits-high. A recursive association list that will be used to limit
       the uppermost pitches of either the parts of individual players or of the
       entire ensemble. The format will be a list of player IDs, as defined in
       the ensemble object, each paired with a list of break-point pairs that
       consist of a value on an arbitrary x-axis paired with a note-name pitch
       symbol. These break-point envelopes are applied to the entire duration of
       the piece. See the user's manual for more detail.
     - :set-limits-low. A recursive association list that will be used to limit
       the lowermost pitches of either the parts of individual players or of the
       entire ensemble. The format will be a list of player IDs, as defined in
       the ensemble object, each paired with a list of break-point pairs that
       consist of a value on an arbitrary x-axis paired with a note-name pitch
       symbol. These break-point envelopes are applied to the entire duration of
       the piece. See the user's manual for more detail.
     - :fast-leap-threshold. A number that is the longest duration of a note in
       seconds that can be followed by a leap of a large interval, as defined in
       the largest-fast-leaps slot of the instrument objects. Default = 0.125.
     - :instruments-hierarchy. A list of player IDs from the given
       slippery-chicken object's ensemble that will specify the order in which
       slippery chicken's pitch selection algorithm will choose pitches for the
       instruments. By default (when NIL) this order follows the order in which
       the instrument objects appear in the ensemble object. See the user's
       manual for more detail. Default = NIL.
     - :rehearsal-letters. A list of numbers that are measure numbers at which
       consecutive rehearsal letters will be placed. Since rehearsal letters are
       technically actually place on the right-hand bar line of the previous
       measure, measure 1 cannot be entered here. Slippery chicken automatically
       proceeds consecutively through the alphabet, so only numbers are required
       here. See the user's manual for more detail. If NIL, no rehearsal letters
       will be added to the score. Default = NIL.
     - :avoid-melodic-octaves. T or NIL to indicate whether two linearly
       consecutive pitches in the part of a given player may be of the same
       pitch class but a different octave. T = avoid melodic octaves.
       Default = T.
     - :instruments-write-bar-nums. A list of player IDs above whose parts in
       the score bar numbers should be written. If NIL, bar numbers will be
       written above the top player in each group. NB: This slot affects CMN
       output only. Default = NIL.
     - :pitch-seq-index-scaler-min. A decimal number that affects the likelihood
       that slippery-chicken's pitch selection algorithm will choose pitches for
       an instrument that have also already been assigned to other players. In
       general terms, the higher this number is, the more likely it will be that
       instruments may be assigned the same pitches, though this will of course
       also be dependent on other factors, such as the characteristics of those
       instruments and the pitches in the current set. See the user's manual on
       pitches and the robodoc entries for pitch-seq for more detail.
       Default = 0.5.
     - :bars-per-system-map. A list of 2-item lists, each of which consists of a
       measure number coupled with a number of measures to be placed in each
       system starting at that measure number. NB: This list only affects CMN
       output. See the user's manual on score layout for more details.
     - :composer. A string that will be used for the composer portion of the
       header on the score's first page in LilyPond output. If NIL, no
       composer's name will appear in the score. Default = NIL.
     - :rthm-seq-map-replacements. A list of lists in the format
       '(((1 2 va) 3 2) ((2 3 vn) 4 3)) that indicate changes to individual
       elements of lists within the given rthm-seq-map object. Each such list
       indicates a change, the first element of the list being the reference
       into the rthm-seq-map (the vla player of section 1, subsection 2 in the
       first example here), the second element is the nth of the data list for
       this key to change, and the third is the new data. If NIL, no changes
       will be made. See the robodoc entries for rthm-seq-map for more
       detail. Default = NIL.
     - :set-map-replacements. A list of lists in the format
       '((1 2 2) (3 3 1)) that indicate changes to individual elements of lists
       within the given set-map object. Each such list indicates a change, the
       first element of the list being the reference into the set-map (the
       section, followed by a subsection if any exist), the second element being
       the nth of the data list for to change, and the third being the new
       data. If NIL, no changes will be made. See the robodoc entries for sc-map
       for more detail. Default = NIL.
     - :key-sig. A two-element list indicating starting key signature for the
       piece, e.g. '(ef minor).  Usual note name symbols apply (e.g. ds = d
       sharp, bf - b flat). Implies nothing beyond the signature, i.e. no
       conformity to tonality expected. Default '(c major) i.e. no key
       signature.
     (- :warn-ties. This slot is now obsolete, but is left here for backwards
        compatibility with pieces composed with earlier versions of
        slippery-chicken. Default = T.)

RETURN VALUE

     T

EXAMPLE

    ;;; An example using all slots
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :title "A Little Piece"
            :composer "Joe Green"
            :ensemble '(((fl ((flute piccolo) :midi-channel 1))
                         (cl (b-flat-clarinet :midi-channel 2))
                         (hn (french-horn :midi-channel 3))
                         (tp (b-flat-trumpet :midi-channel 4))
                         (vn (violin :midi-channel 5))
                         (va (viola :midi-channel 6))
                         (vc (cello :midi-channel 7))))
            :set-palette '((1 ((fs2 b2 d4 a4 d5 e5 a5 d6)))
                           (2 ((b2 fs2 d4 e4 a4 d5 e5 a5 d6)))
                           (3 ((cs3 fs3 e4 a4 e5 a5 e6))))
            :set-map '((1 (2 1 2 3 1 3 1))
                       (2 (1 1 3 2 2 3 1))
                       (3 (2 3 1 3 1 1 2)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 2 3))))
                                (2 ((((4 4) (q) e (s) s h))
                                    :pitch-seq-palette ((2 1 3))))
                                (3 ((((4 4) e (s) s h (q)))
                                    :pitch-seq-palette ((3 2 1)))))
            :rthm-seq-map '((1 ((fl (2 3 3 1 1 1 2))
                                (cl (3 2 1 1 2 1 3))
                                (hn (1 2 3 1 1 3 2))
                                (tp (2 1 1 3 3 2 1))
                                (vn (3 1 3 2 1 1 2))
                                (va (2 1 1 1 3 2 3))
                                (vc (1 2 3 1 3 2 1))))
                            (2 ((fl (3 1 3 2 2 1 1))
                                (cl (1 1 2 3 1 3 2))
                                (hn (1 3 2 1 3 1 2))
                                (tp (1 1 1 3 3 2 2))
                                (vn (2 1 3 1 3 1 2))
                                (va (2 2 3 1 1 3 1))
                                (vc (1 3 1 2 2 1 3))))
                            (3 ((fl (1 1 3 2 1 3 2))
                                (cl (2 1 2 3 3 1 1))
                                (hn (3 2 1 1 1 3 2))
                                (tp (3 3 1 1 2 1 2))
                                (vn (3 1 3 2 1 1 2))
                                (va (3 2 1 1 3 2 1))
                                (vc (1 3 2 1 2 3 1)))))
            :snd-output-dir "/tmp"
            :sndfile-palette '(((sndfile-grp-1
                                 ((test-sndfile-1.aiff :start 0.021 :end 0.283)
                                  (test-sndfile-2.aiff)
                                  (test-sndfile-3.aiff)))
                                (sndfile-grp-2
                                 ((test-sndfile-4.aiff :frequency 834)
                                  (test-sndfile-5.aiff)
                                  (test-sndfile-6.aiff))))
                               ("/path/to/test-sndfiles-dir-1"
                                "/path/to/test-sndfiles-dir-2"))
            ;; :tempo-map '((1 (q 84)) (9 (q 72))) ;
            :tempo-curve '(5 q (0 40 25 60 50 80 75 100 100 120))
            :staff-groupings '(2 2 3)
            :instrument-change-map '((1 ((fl ((1 flute) (3 piccolo) (5 flute))))))
            :set-limits-low '((fl (0 c5 50 g5 100 c5))
                              (cl (0 c4 50 f4 100 c4))
                              (hn (0 f3 50 c4 100 f3))
                              (tp (0 c4 50 f4 100 c4))
                              (vn (0 e5 50 a5 100 e5))
                              (va (0 c3 50 f3 100 c3))
                              (vc (0 c2 50 f3 100 c2)))
            :set-limits-high '((fl (0 d6 50 a6 100 d6))
                               (cl (0 c5 50 a5 100 c5))
                               (hn (0 f4 50 c5 100 f4))
                               (tp (0 f5 50 c5 100 f5))
                               (vn (0 c6 50 e6 100 c6))
                               (va (0 g4 50 d5 100 g4))
                               (vc (0 c4 50 f4 100 c4)))
            :fast-leap-threshold 0.5
            :instruments-hierarchy '(fl vn cl tp va hn vc)
            :rehearsal-letters '(3 11 19)
            :avoid-melodic-octaves nil
            :instruments-write-bar-nums '(fl cl hn tp)
            :pitch-seq-index-scaler-min 0.1
            :bars-per-system-map '((1 1) (2 2) (3 3) (7 4) (11 5))
            :rthm-seq-map-replacements '(((1 va) 3 1) ((2 fl) 4 3))
            :set-map-replacements '((1 2 2) (3 3 1)))))
      (midi-play mini :midi-file "/tmp/mini.mid")
      (cmn-display mini)
      (write-lp-data-for-all mini))

SYNOPSIS

    (defun make-slippery-chicken (name &key
                                  rthm-seq-palette
                                  rthm-seq-map
                                  set-palette
                                  set-map
                                  sndfile-palette
                                  tempo-map
                                  tempo-curve
                                  (snd-output-dir "/tmp/")
                                  instrument-change-map
                                  instruments-write-bar-nums
                                  bars-per-system-map
                                  staff-groupings
                                  rthm-seq-map-replacements
                                  set-map-replacements
                                  set-limits-low
                                  set-limits-high
                                  instrument-palette
                                  ensemble
                                  rehearsal-letters
                                  (fast-leap-threshold 0.125)
                                  instruments-hierarchy
                                  (title "slippery chicken piece")
                                  composer
                                  (avoid-melodic-octaves t)
                                  (avoid-used-notes t)
                                  (pitch-seq-index-scaler-min 0.5)
                                  ;; MDE Mon Jul  2 16:08:42 2012
                                  (key-sig '(c major))
                                  (warn-ties t))

## slippery-chicken/midi-play [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Generate a MIDI file from the data of the specified slippery-chicken
     object.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :midi-file. The name of the MIDI file to produce, including directory
       path and extension. Default = "/tmp/sc.mid".
     - :voices. NIL or a list of player IDs indicating which of the players'
       parts are to be included in the resulting MIDI file. If NIL, all players'
       parts will be included. Default = NIL.
     - :start-section. An integer that is the number of the first section for
       which the MIDI file is to be generated. Default = 1.
     - :num-sections. An integer that is the number of sections to produce MIDI
       data for in the MIDI file. If NIL, all sections will be written.
       Default = NIL.
     - :from-sequence. An integer that is the number of the sequence within the
       specified section from which to start generating MIDI data. NB: This
       argument can only be used when the num-sections = 1. Default = 1.
     - :num-sequences. An integer that is the number of sequences for which MIDI
       data is to be generated in the resulting MIDI file, including the
       sequence specified in from-sequence. If NIL, all sequences will be
       written. NB: This argument can only be used when the num-sections = 1.
       Default = NIL.
     - :force-velocity. An integer between 0 and 127 (inclusive) that is the
       MIDI velocity value which will be given to all notes in the resulting
       MIDI file. Default = NIL.

RETURN VALUE

     Returns T.

EXAMPLE

    ;;; An example with some typical values for the keyword arguments.
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (hn (french-horn :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1 1 1))
                       (2 (1 1 1 1 1 1 1))
                       (3 (1 1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 2 3))))
                                (2 ((((4 4) (q) e (s) s h))
                                    :pitch-seq-palette ((1 2 3))))
                                (3 ((((4 4) e (s) s h (q)))
                                    :pitch-seq-palette ((2 3 3))))
                                (4 ((((4 4) (s) s h (q) e))
                                    :pitch-seq-palette ((3 1 2)))))
            :rthm-seq-map '((1 ((cl (1 2 1 2 1 2 1))
                                (hn (1 2 1 2 1 2 1))
                                (vc (1 2 1 2 1 2 1))))
                            (2 ((cl (3 4 3 4 3 4 3))
                                (hn (3 4 3 4 3 4 3))
                                (vc (3 4 3 4 3 4 3))))
                            (3 ((cl (1 2 1 2 1 2 1))
                                (hn (1 2 1 2 1 2 1))
                                (vc (1 2 1 2 1 2 1))))))))
      (midi-play mini
                 :midi-file "/tmp/md-test.mid"
                 :voices '(cl vc)
                 :start-section 2))

SYNOPSIS

    #+cm-2
    (defmethod midi-play ((sc slippery-chicken)
                          &key
                          ;; no subsection refs: use from-sequence instead
                          (start-section 1)
                          ;; these voices are used to get the actual sequence
                          ;; orders i.e. each voice will be appended to <section>
                          ;; when calling get-data.
                          ;; if nil then all voices.
                          (voices nil)
                          (midi-file "/tmp/sc.mid")
                          (from-sequence 1)
                          (num-sequences nil)
                          ;; if nil we'll write all the sections
                          (num-sections nil)
                          ;; if this is a 7-bit number we'll use this for all notes
                          (force-velocity nil))

## slippery-chicken/next-event [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Get the events from a specified player's part within a given
     slippery-chicken object one after the other (e.g. in a loop). This method
     must be called once with a bar number first in order to reset the counter;
     doing this will return NIL. Once the counter has been reset, calling the
     method without a bar number will return the events in sequence.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.

OPTIONAL ARGUMENTS

     - T or NIL to indicate whether to return only events that consist of
       attacked notes (i.e., no ties or rests). T = return only events with
       attacked notes. Default = NIL.
     - NIL or an integer to indicate the first bar from which events are to be
       retrieved. If NIL, the counter is reset to the first event of the
       player's part. This should be NIL after the first resetting call.
       Default = NIL
     - NIL or an integer to indicate the last bar from which events are to be
       retrieved. If NIL, all events will be retrieved from the starting point
       to the last event in the given slippery-chicken object. Default = NIL.

RETURN VALUE

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (hn (french-horn :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((cl (1 1 1))
                                (hn (1 1 1))
                                (vc (1 1 1))))))))
      (next-event mini 'vc nil 1)
      (loop for ne = (next-event mini 'vc)
         while ne
         collect (get-pitch-symbol ne)))

    => (E4 NIL F4 NIL G4 E4 NIL F4 NIL G4 E4 NIL F4 NIL G4)

SYNOPSIS

      (defmethod next-event ((sc slippery-chicken) player
                             &optional
                             (attacked-notes-only nil)
                             ;; could be a number too, whereupon it's the bar
                             ;; number to start at
                             (start-over nil)
                             (end-bar nil)) ; inclusive

## slippery-chicken/num-bars [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the number of bars in the piece.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     An integer that is the number of bars.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((fl (flute :midi-channel 1))
                         (tp (b-flat-trumpet :midi-channel 2))
                         (vn (violin :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((fl (1 1 1 1 1))
                                (tp (1 1 1 1 1))
                                (vn (1 1 1 1 1))))))))
      (num-bars mini))

    => 5

SYNOPSIS

    (defmethod num-bars ((sc slippery-chicken))

## slippery-chicken/num-notes [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Returns the number of attacked notes in a given slippery-chicken object;
     i.e., not including ties or rests.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     An integer,

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((fl (flute :midi-channel 1))))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1)))
            :rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -)))))
            :rthm-seq-map '((1 ((fl (1))))))))
      (num-notes mini))

    => 8

SYNOPSIS

    (defmethod num-notes ((sc slippery-chicken))

## slippery-chicken/num-seqs [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return the number of sequences (which may contain multiple bars) in a
     specified section of a slippery-chicken object.

     NB This will return NIL if the section has sub-sections.

ARGUMENTS

     - A slippery-chicken object.
     - The ID of the section for which to return the number of sequences.

RETURN VALUE

     An integer.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1 1))
                       (2 (1 1 1))
                       (3 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1))))
                            (2 ((sax (1 1 1))))
                            (3 ((sax (1 1 1 1 1))))))))
      (num-seqs mini 2))

    => 3

SYNOPSIS

    (defmethod num-seqs ((sc slippery-chicken) section-ref)

## slippery-chicken/player-doubles [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DATE

     02-Apr-2012

DESCRIPTION

     Boolean test to check whether a specified player plays more than one
     instrument.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.

RETURN VALUE

     T if the player has more than one instrument, otherwise NIL>

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))
                         (db (double-bass :midi-channel 2))))
            :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                     (2 ((sax ((2 alto-sax) (5 tenor-sax))))))
            :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
            :set-map '((1 (1 1 1 1 1))
                       (2 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))
                            (2 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))))))
      (player-doubles mini 'sax))

    => T

SYNOPSIS

    (defmethod player-doubles ((sc slippery-chicken) player)

## slippery-chicken/players [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Return a list of all player IDs from the given slippery-chicken object.

ARGUMENTS

     - A slippery-chicken object.

RETURN VALUE

     A list of player IDs.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                         (hn (french-horn :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((cl (1 1 1))
                                (hn (1 1 1))
                                (vc (1 1 1))))))))
      (players mini))

    => (CL HN VC)

SYNOPSIS

    (defmethod players ((sc slippery-chicken))

## slippery-chicken/rebar [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Go through the vertically simultaneous sequences in all players of the
     given slippery-chicken object and rebar according to the first one that has
     the least number of bars (but following the player hierarchy).

     If rthm-seqs or sequenzes are created algorithmically and bundled into the
     slippery-chicken piece slot artificially, bypassing the usual generation
     structure, it might be difficult to end up with each instrument having the
     same metric structure when combined vertically. This method goes through
     the vertically combined sequences and rebars as described above.

     NB: See documentation in piece class method. Don't confuse this method with
         the re-bar method.

     NB: This method is used internally and not recommended for direct use.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     - A list of player IDs from the given slippery-chicken object, ordered in
       terms of importance i.e. which instrument's bar structure should take
       precedence.
     - NB: The rebar-fun is not yet used.

RETURN VALUE

     Always T.

SYNOPSIS

    (defmethod rebar ((sc slippery-chicken)
                      &optional instruments-hierarchy rebar-fun)

## slippery-chicken/shorten-large-fast-leaps [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Modify the pitches of each part in a slippery-chicken object to avoid large
     melodic leaps at fast speeds, based on the largest-fast-leap slot of the
     given instrument object and the fast-leap-threshold slot of the
     slippery-chicken object.

     This method is called automatically at init and as such will most likely
     seldom need to be directly accessed by the user.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :threshold. A number that is the maximum duration in seconds between two
       consecutive notes in the slippery-chicken object for which linear
       intervals greater than the number specified in the given instrument
       object's largest-fast-leap slot will be allowed. This value is taken from
       the fast-leap-threshold slot of the given slippery-chicken object by
       default.
     - :verbose. T or NIL to indicate whether to print feedback about the
       method's operations to the Lisp listener. T = print. Default = T.

RETURN VALUE

     Always T

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 96)))
            :set-palette '((1 ((g3 a5 b6))))
            :set-map '((1 (1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((2 4) e s 32 64 64 e s 32 64 64))
                                    :pitch-seq-palette ((1 5 1 5 1 5 1 5 1 5)))))
            :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))))))
      (shorten-large-fast-leaps mini :threshold 0.25))

    =>
    ******* section (1)
    Getting notes for VN
    Shortening short, fast leaps...
    Shortened 23 large fast leaps
    seq-num 0, VN, replacing B6 with G3
    seq-num 0, VN, replacing B6 with G3
    seq-num 0, VN, replacing B6 with G3
    seq-num 0, VN, replacing B6 with G3
    seq-num 0, VN, replacing G3 with B6
    seq-num 0, VN, replacing G3 with B6
    seq-num 0, VN, replacing G3 with B6
    seq-num 1, VN, replacing G3 with B6
    seq-num 1, VN, replacing B6 with G3
    seq-num 1, VN, replacing B6 with G3
    seq-num 1, VN, replacing B6 with G3
    seq-num 1, VN, replacing B6 with G3
    seq-num 1, VN, replacing G3 with B6
    seq-num 1, VN, replacing G3 with B6
    seq-num 1, VN, replacing G3 with B6
    seq-num 2, VN, replacing G3 with B6
    seq-num 2, VN, replacing B6 with G3
    seq-num 2, VN, replacing B6 with G3
    seq-num 2, VN, replacing B6 with G3
    seq-num 2, VN, replacing B6 with G3
    seq-num 2, VN, replacing G3 with B6
    seq-num 2, VN, replacing G3 with B6
    seq-num 2, VN, replacing G3 with B6
    seq-num 3, VN, replacing G3 with B6
    seq-num 3, VN, replacing B6 with G3
    seq-num 3, VN, replacing B6 with G3
    seq-num 3, VN, replacing B6 with G3
    seq-num 3, VN, replacing B6 with G3
    seq-num 3, VN, replacing G3 with B6
    seq-num 3, VN, replacing G3 with B6
    seq-num 3, VN, replacing G3 with B6
    seq-num 4, VN, replacing G3 with B6
    seq-num 4, VN, replacing B6 with G3
    seq-num 4, VN, replacing B6 with G3
    seq-num 4, VN, replacing B6 with G3
    seq-num 4, VN, replacing B6 with G3
    seq-num 4, VN, replacing G3 with B6
    seq-num 4, VN, replacing G3 with B6
    seq-num 4, VN, replacing G3 with B6
    seq-num 5, VN, replacing G3 with B6
    seq-num 5, VN, replacing B6 with G3
    seq-num 5, VN, replacing B6 with G3
    seq-num 5, VN, replacing B6 with G3
    seq-num 5, VN, replacing B6 with G3
    seq-num 5, VN, replacing G3 with B6
    seq-num 5, VN, replacing G3 with B6
    seq-num 5, VN, replacing G3 with B6

SYNOPSIS

    (defmethod shorten-large-fast-leaps ((sc slippery-chicken)
                                         &key threshold (verbose t))

## slippery-chicken/statistics [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Print various information about the given slippery-chicken object to the
     Lisp listener or other specified stream.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     - NIL or a stream to which the information should be printed. If NIL, the
       method will not print the information to any stream. T = print to the
       Lisp listener. Default = T.

RETURN VALUE

     A number of formatted statistics about the given slippery-chicken object.

EXAMPLE

    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))))
            :set-palette '((1 ((e3 fs3 b3 cs4 fs4 gs4 ds5 f5))))
            :set-map '((1 (1 1 1))
                       (2 (1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1))))
                            (2 ((sax (1 1 1))))))))
      (statistics mini))

    =>
    +MINI+
    "+MINI+-piece"
                start-bar: 1
                end-bar: 6
                num-bars: 6
                start-time: 0.0
                end-time: 24.0
                start-time-qtrs: 0
                end-time-qtrs: 24.0
                num-notes (attacked notes, not tied): 30
                num-score-notes (tied notes counted separately): 30
                num-rests: 0
                duration-qtrs: 24.0
                duration: 24.0 (24.000)

SYNOPSIS

    (defmethod statistics ((sc slippery-chicken) &optional (stream t))

## slippery-chicken/transpose-events [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Transpose the pitches of event objects in a specified region and a
     specified player's part.

ARGUMENTS

     - A slippery-chicken object.
     - A player ID.
     - An integer that is the first bar in which to transpose events.
     - An integer that is the first event in that bar to transpose.
     - An integer that is the last bar in which to transpose events.
     - An integer that is the last event in that bar to transpose.
     - A positive or negative number that is the number of semitones by which
       the pitches of the events in the specified region should be transposed.

OPTIONAL ARGUMENTS

     keyword argument:
     - :destructively. T or NIL to indicate whether the pitches of the original
       event objects should be replaced. T = replace. Default = T.

RETURN VALUE

     Returns a list of events.

EXAMPLE

    ;;; Print the pitches before and after applying the method ;
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((sax (alto-sax :midi-channel 1))
                         (db (double-bass :midi-channel 2))))
            :set-palette '((1 ((c2 d2 g2 a2 e3 fs3 b3 cs4 fs4 gs4 ds5 f5 bf5))))
            :set-map '((1 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h q e s s))
                                    :pitch-seq-palette ((1 2 3 4 5)))))
            :rthm-seq-map '((1 ((sax (1 1 1 1 1))
                                (db (1 1 1 1 1))))))))
      (print
       (loop for e in (get-events-from-to mini 'sax 3 2 5 3)
          collect (get-pitch-symbol e)))
      (transpose-events mini 'sax 3 2 5 3 11)
      (print
       (loop for e in (get-events-from-to mini 'sax 3 2 5 3)
          collect (get-pitch-symbol e))))

    =>
    (EF4 AF4 BF4 EF5 CS4 EF4 AF4 BF4 EF5 CS4 EF4 AF4)
    (D5 G5 A5 D6 C5 D5 G5 A5 D6 C5 D5 G5)

SYNOPSIS

    (defmethod transpose-events ((sc slippery-chicken) player start-bar
                                 start-event end-bar end-event semitones
                                 &key (destructively t))

## slippery-chicken/update-slots [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Called by initialize-instance and others. Updates timings of events and
     statistics. Not generally called by the user but can be useful if
     post-generation editing has changed something fundamental to the structure.

ARGUMENTS

     - A slippery-chicken object

OPTIONAL ARGUMENTS

     - A tempo-map object (not just as a list). If not given, then the tempo-map
       from the slippery-chicken object will be used. Default = NIL.
     - A number that is the start-time of the first event object in
       seconds. Default = 0.0.
     - A number that is the start-time of the first event, in 'quarters' (for
       MIDI timing). Default = 0.0.
     - A integer that is the number of the starting bar. Default = 1.
     - The reference of the current section (for internal recursive use in the
       bar-holder class). Default = NIL.
     - The nth sequence (for internal recursive use in the sequenz class).
       Default = NIL.
     - T or NIL to indicate whether to print a warning to the Lisp listener when
       ties are being used at the beginning of a sequence. This argument is now
       obsolete and ignored, but remains for some backward compatibility.
       Default = T.

RETURN VALUE

     The duration in seconds of the object; in this class: the whole generated
     piece.

EXAMPLE

    ;;; Create a slippery-chicken object and print the start time of one of its
    ;;; events; call update-slots with a start time of 10.0 and print the start
    ;;; time of that same event to see the difference
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((vn (violin :midi-channel 1))))
            :tempo-map '((1 (q 60)))
            :set-palette '((1 ((c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((2 4) (s) (s) e e e))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
      (print (start-time (get-event mini 4 1 'vn)))
      (update-slots mini nil 10.0)
      (print (start-time (get-event mini 4 1 'vn))))

    =
    6.0
    16.0

SYNOPSIS

    (defmethod update-slots ((sc slippery-chicken)
                             &optional
                             (tempo-map nil)
                             (start-time 0.0)
                             (start-time-qtrs 0.0)
                             (start-bar 1)
                             (current-section nil)
                             (nth nil)
                             (warn-ties t)
                             (update-write-bar-nums nil))

## slippery-chicken/write-lp-data-for-all [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

     Generate all of the .ly files required by the LilyPond application for
     printable output from the musical data stored in the given slippery-chicken
     object.

     This method produces .ly files for the score as well as the parts for all
     individual players in the ensemble (unless otherwise specified by the
     user). The files are automatically named based on the value passed to the
     TITLE slot of the given slippery-chicken object.

     NB: This method only produces the .ly files. These must be rendered by the
         LilyPond application separately for PDF output. See the slippery
         chicken installation web page and the manual page on Output for more
         detail.

     NB: Many of the arguments for this method pass their values directly to
         LilyPond parameters.

     NB: Clefs added to grace-note events will not be rendered in Lilypond.

ARGUMENTS

     - A slippery-chicken object.

OPTIONAL ARGUMENTS

     keyword arguments:
     - :base-path. A string that is the directory path only for the resulting
       files. The method will automatically generate the file names and
       extensions. Default =  "/tmp/".
     - :start-bar. An integer that is the first bar of the given
       slippery-chicken object for which output is to be generated. If NIL, the
       start-bar will be set to 1. Default = NIL.
     - :end-bar. An integer that is the last bar of the given slippery-chicken
       object for which output is to be generated. If NIL, all bars after the
       start bar will be generated. Default = NIL.
     - :start-bar-numbering: For bar counting in the score only: the bar number
       that the :start-bar will be counted as (integer). NIL = :start-bar.
       Default =  NIL.
     - :players. A list of player IDs or NIL to indicate which players' parts
       are to be generated and included in the resulting score. If NIL, all
       players' parts will be generated and included in the score. This can be
       handy, for example, for excluding the computer part of a piece for tape
       and instruments. Default = NIL.
     - :respell-notes. NIL, T or a list to indicate whether the method should
       also call the respell-notes method on the given slippery-chicken object
       before generating the output to undertake enharmonic changes. If a list,
       then these are the specific enharmonic corrections to be undertaken. If
       this is T, the method will process all pitches for potential
       respelling. If NIL, no respelling will be undertaken. See the
       documentation for the respell-notes method for more. Default = NIL.
     - :auto-clefs. T or NIL to indicate whether the auto-clefs method should be
       called to automatically place mid-measure clefs in the parts of
       instruments that use more than one clef. T = automatically place clefs.
       Default = T
     - :in-c. T or NIL to indicate whether the full score is to contain written
       pitches or sounding pitches. NB: Some transposing C instruments still
       transpose at the octave in C scores, such as double-bass and piccolo.
       NB: Parts will always be transposed. T = sounding pitches. Default = NIL.
     - :page-nums. T or NIL to indicate whether page numbers should
       automatically be added to each page (not including the start page) of the
       output. T = add page numbers. Default = T.
     - :rehearsal-letters-font-size. A number that indicates the font size of
       rehearsal letters in LilyPond output. Default = 18.
     - :rehearsal-letters-all-players. T or NIL to indicate whether rehearsal
       letters are to be placed in all parts generated. T = all parts.
       Default = T. NB: This must be set to T when the user would like the
       rehearsal letters in all individual LilyPond parts, but printing with CMN
       thereafter will result in rehearsal letters in all parts as well.
     - :tempi-all-players.  T or NIL to indicate whether tempo marks are to be
       placed in all parts generated. T = all parts. Default = T.
     - :all-bar-nums. T o NIL to indicate whether the corresponding bar number
       should be printed above every measure in the score (not including
       multi-bar rests). T = add a bar number to every measure. Default = NIL.
     - :paper. A string to indicate the paper size for LilyPond output. Only
       LilyPond's predefined paper sizes are valid here. According to the
       LilyPond manual, these include: "a4, letter, legal, and 11x17... Many
       more paper sizes are supported... For details, see scm/paper.scm, and
       search for the definition of paper-alist." NB: This argument will only
       adjust paper size, but not margins or line widths, which are adjusted
       using the arguments below. Default = "a4"
     - :staff-size. An integer that indicates the size of the notes and staves
       in the resulting output. Default = 14.
     - :group-barlines. T or NIL to indicate whether bar lines should be drawn
       through the whole staff group or just one staff. T = through the whole
       staff group. Default = T.
     - :landscape. T or NIL to indicate whether the paper format should be
       landscape or portrait. T = landscape. NB: This argument will only adjust
       paper layout, but not margins or line widths, which are adjusted using
       the arguments below.  Default = NIL.
     - :barline-thickness. A number that is the relative thickness of the bar
       lines. Default = 0.5.
     - :top-margin. A number that is the margin at the top of the page in
       millimeters.  Default = 10.
     - :bottom-margin. A number that is the margin at the bottom of the page in
       millimeters.  Default = 10.
     - :left-margin. A number that is the margin at the left of the page in
       millimeters.  Default = 20.
     - :line-width. A number that is the width of each line in centimeters.
       Default = 17.
     - :page-turns. T or NIL to indicate if LilyPond should attempt to optimize
       page breaks for page turns in parts. T = optimize page breaks.
       Default = NIL.
     - :min-page-turn. A two-item list indicating the minimum rest necessary for
       the method to automatically place a page turn, in a format similar to
       that of a time signature; i.e., '(2 1) would mean a minimum of 2 whole
       rests. Default = '(2 1))
     - :use-custom-markup. T or NIL. Set to T when using a number of marks that
       are specific to LilyPond, such as 'bartok or any of the marks that use
       eps graphics files. Default = NIL.
     - :lp-version. A string that will be added to each .ly file generated in
       conjunction with the LilyPond \version command. Default = "2.14.2"
     - :process-event-fun. NIL or a user-defined function that will be applied
       to every event object in the given slippery-chicken object. If NIL, no
       processes will be applied. Default = NIL.
     - :stemlet-length. NIL or a decimal number < 1.0 that indicates the scaled
       length of stems over rests in LilyPond output, should this feature be
       desired. 0.75 is a recommended value for this. NIL = no stems over
       rests. Default = NIL. NB: LilyPond can be instructed to extend beams over
       rests (without stemlets) simply by using the '-' in the definition of the
       rthm-seq-bar object, as is done with any other note; however,
       starting/ending a beam on a rest and then trying to generate a score with
       CMN will fail.)

RETURN VALUE

     T

EXAMPLE

    ;;; An example with values for the most frequently used arguments ;
    (let ((mini
           (make-slippery-chicken
            '+mini+
            :ensemble '(((fl (flute :midi-channel 1))
                         (cl (b-flat-clarinet :midi-channel 2))
                         (vc (cello :midi-channel 3))))
            :staff-groupings '(2 1)
            :tempo-map '((1 (q 84)) (9 (q 72)))
            :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5))))
            :set-map '((1 (1 1 1 1 1 1 1 1))
                       (2 (1 1 1 1 1 1 1 1))
                       (3 (1 1 1 1 1 1 1 1)))
            :rthm-seq-palette '((1 ((((4 4) h (q) e (s) s))
                                    :pitch-seq-palette ((1 2 3))
                                    :marks (bartok 1)))
                                (2 ((((4 4) (q) e (s) s h))
                                    :pitch-seq-palette ((1 2 3)))))
            :rthm-seq-map '((1 ((fl (1 2 1 2 1 2 1 2))
                                (cl (1 2 1 2 1 2 1 2))
                                (vc (1 2 1 2 1 2 1 2))))
                            (2 ((fl (1 2 1 2 1 2 1 2))
                                (cl (1 2 1 2 1 2 1 2))
                                (vc (1 2 1 2 1 2 1 2))))
                            (3 ((fl (1 2 1 2 1 2 1 2))
                                (cl (1 2 1 2 1 2 1 2))
                                (vc (1 2 1 2 1 2 1 2)))))
            :rehearsal-letters '(3 11 19))))
      (write-lp-data-for-all mini
                             :start-bar 7
                             :end-bar 23
                             :paper "letter"
                             :landscape t
                             :respell-notes nil
                             :auto-clefs nil
                             :staff-size 17
                             :in-c nil
                             :barline-thickness 3.7
                             :top-margin 40
                             :bottom-margin 60
                             :left-margin 40
                             :line-width 22
                             :page-nums t
                             :all-bar-nums t
                             :use-custom-markup t
                             :rehearsal-letters-font-size 24
                             :lp-version "2.12.1"
                             :group-barlines nil
                             :page-turns t
                             :players '(fl cl)
                             :tempi-all-players t))

    => T

SYNOPSIS

    (defmethod write-lp-data-for-all ((sc slippery-chicken)
                                      &key
                                      (base-path "/tmp/")
                                      start-bar end-bar (paper "a4") landscape
                                      ;; MDE Tue May 29 21:34:53 2012
                                      start-bar-numbering
                                      ;; if a list, then these are the enharmonic
                                      ;; corrections
                                      (respell-notes t)
                                      ;; automatically add clefs to instruments who
                                      ;; read more than one?
                                      (auto-clefs t)
                                      (staff-size 14)
                                      ;; parts will always be transposed but score
                                      ;; can be in in C or not
                                      (in-c nil)
                                      (barline-thickness 0.5)
                                      (top-margin 10)    ; mm
                                      (bottom-margin 10) ; mm
                                      (left-margin 20)   ;mm
                                      (line-width 17)    ;cm
                                      (page-nums t)
                                      ;; print every bar number unless
                                      ;; multi-bar-rest?
                                      (all-bar-nums nil)
                                      ;; this has to be T if we're going to get
                                      ;; letters in the parts--but CMN printing
                                      ;; will have all parts all letters too
                                      ;; thereafter
                                      (rehearsal-letters-all-players t)
                                      ;; set to t if using bartok pizz and
                                      ;; other signs
                                      (use-custom-markup nil)
                                      (rehearsal-letters-font-size 18)
                                      (lp-version "2.14.2") ;"2.12.3")
                                      ;; 24.7.11 (Pula) barlines through whole
                                      ;; staff group or just a stave
                                      (group-barlines t)
                                      ;; 5.11.11 set to t if you want lilypond to
                                      ;; optimize page breaks for page turns in
                                      ;; parts
                                      (page-turns nil)
                                      ;; MDE Sat Mar 10 16:52:31 2012
                                      (process-event-fun nil)
                                      ;; MDE Mon Apr 16 16:08:36 2012 -- added so
                                      ;; that we can write a subset of players
                                      ;; into the score (e.g. leave out a computer
                                      ;; part). If nil all players will be written.
                                      (players nil)
                                      ;; minimum rest necessary to do a page turn;
                                      ;; something like a time signature e.g. (2 1)
                                      ;; would mean we need a min. of 2 whole rests
                                      (min-page-turn '(2 1))
                                      ;; MDE Tue May 29 22:58:25 2012
                                      (stemlet-length nil)
                                      ;; sim to rehearsal letters
                                      (tempi-all-players t))