sc/slippery-chicken-edit [ Modules ]

[ Top ] [ Modules ]

NAME

 slippery-chicken-edit
 
 File:             slippery-chicken-edit.lsp

 Class Hierarchy:  named-object -> slippery-chicken

 Version:          1.0.10

 Project:          slippery chicken (algorithmic composition)

 Purpose:          Post-generation editing methods for the slippery-chicken
                   class.  

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

 Creation date:    April 7th 2012

 $$ Last modified:  16:24:48 Fri Oct  4 2019 CEST

 SVN ID: $Id$ 

slippery-chicken-edit/add-arrow-to-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 April 9th 2012

DESCRIPTION

 Adds an arrow above the specified notes of a slippery-chicken object,
 coupled with text to be printed in the score at the start and end of the
 arrow. Can be used, for example, for transitions from one playing state to
 another.

 If no text is desired, this must be indicated by a space in quotes (" ")
 rather than empty quotes ("").

 See also the add-arrow method in the event class.

ARGUMENTS

 - A slippery-chicken object.
 - A text string for the beginning of the arrow.
 - A text string for the end of the arrow.
 - A list that is the starting event reference, in the form (bar-number
   event-number). Event numbers count from 1 and include rests and tied
   notes.
 - A list that is the end event reference, in the form (bar-number
   event-number).
 - The ID of the player to whose part the arrow should be attached.

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether or not to print a warning when trying to 
   attach an arrow and accompanying marks to a rest. 
   T = print warning. Default = NIL. 

RETURN VALUE

 T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :title "mini"
        :ensemble '(((pno (piano :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6)))
                       (2 ((cs4 ds4 fs4 gs4 as4 cs5 ds5 fs5 gs5 as5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q q))
                                :pitch-seq-palette ((1 (2))))))
        :rthm-seq-map '((1 ((pno (1 1 1 1 1 1))))))))
  (add-arrow-to-events mini "here" "there" '(1 1) '(5 1) 'pno)
  (write-lp-data-for-all mini))

SYNOPSIS

(defmethod add-arrow-to-events ((sc slippery-chicken) start-text end-text
                                event1-ref event2-ref player
                                &optional warn-rest)

slippery-chicken-edit/add-auxiliary-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 May 26th 2016, Edinburgh

DESCRIPTION

 Analyses phrase by phrase to find the most frequent X notes then changes
 some of them (according to an activity-levels object) to auxiliary notes
 (up a semitone by default). Chords are ignored.

ARGUMENTS

 - the slippery-chicken object

OPTIONAL ARGUMENTS

 keyword arguments
 - :players. A single player (symbol) or list of players to process. If NIL
    then all players will be processed.
 - :start-bar. An integer indicating the bar in which the processes should
    start. Default = NIL which means we'll start at the beginning.
 - :end-bar. An integer indicating the bar in which the processes should
    stop. Default = NIL which means we'll process through to the end
 - :verbose. T or NIL to print information about the pitch changes during
    the process. Default = NIL.
 - :ignore. A symbol or pitch-object (or list thereof) to represent pitches
    which should not be processed. Default = NIL = process (potentially) all
    pitches. 
 - :activity-level. Whether to change the note is decided by an
   activity-levels object. This argument determines the 'level' argument used
   in that class's active method. Default = 5 = 50% of the notes will be
   changed. NB The activity-levels object will be reinitialised for each
   phrase so the 50/50 spread might not be obvious.
 - :num-notes. The number of notes to process per phrase. We calculate the
   most used pitches in every phrase then use this number of pitches to add
   auxiliaries to. Default = 3.
 - :intervals. The intervals that the original pitches will be transposed by
   to create the auxiliary notes. This can be a single value in semitones or
   a list of values. The list does not have to have the same length as
   :num-notes as it will be cycled through when necessary. Default = 1.

RETURN VALUE

 T

SYNOPSIS

(defmethod add-auxiliary-notes ((sc slippery-chicken)
                                &key players start-bar end-bar
                                  verbose ignore (activity-level 5)
                                  (num-notes 3) (intervals 1))

slippery-chicken-edit/add-clef [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Attach a specified clef symbol to a specified clef object within a given
 slippery-chicken object.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player to whose part the clef symbol is to be added.

 NB: The optional arguments are actually required.

OPTIONAL ARGUMENTS

 - An integer that is the bar number in which the clef symbol is to be
   placed. 
 - An integer that is the event number within the given bar to which the
   clef symbol is to be attached.
 - A symbol that is the clef type to be attached. See the documentation for
   the make-instrument function of the instrument class for a list of
   possible clef types.

RETURN VALUE

 Returns the new value of the MARKS-BEFORE slot of the given event object. 

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :title "mini"
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6)))
                       (2 ((cs4 ds4 fs4 gs4 as4 cs5 ds5 fs5 gs5 as5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))))))
  (add-clef mini 'vn 3 2 'alto))

  => ((CLEF ALTO))

SYNOPSIS

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

slippery-chicken-edit/add-event-to-bar [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add an event object to a specified bar either at the end of that bar or at
 a specified position within that bar.
 
 It's the user's responsibility to make sure the bar is full and
 update-slots is called after all post-generation editing such as this.

ARGUMENTS

 - A slippery-chicken object.
 - An event object.
 - An integer that is the bar number or a list that is the reference to the
   bar in the form '(section sequence bar), where sequence and bar are
   numbers counting from 1)
 - The ID of the player to whose part the event should be added.

OPTIONAL ARGUMENTS

 keyword argument:
 - :position. NIL or an integer indicating the position in the bar (0-based)
    where the event should be added. If NIL, the new event is placed at the
    end of the bar. Default = NIL.

RETURN VALUE

 T

EXAMPLE

;;; Adding two events to separate bars, once using a bar number with
;;; :position's default to NIL, and once using a bar number reference list with
;;; :position specified as 2. Print the bars after adding to see the changes.

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6)))
                       (2 ((cs4 ds4 fs4 gs4 as4 cs5 ds5 fs5 gs5 as5 cs6))))
        :set-map '((1 (1 1 1 1 1 1))
                   (2 (2 2 2 2 2 2)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))))
                            (2 ((((2 4) e s s q))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))
                        (2 ((vn (2 2 2 2 2 2))))))))
  (add-event-to-bar mini (make-event 'cs4 'e) 2 'vn)
  (print-simple (first (get-bar mini 2)))
  (add-event-to-bar mini (make-event 'c4 'q) '(2 2 1) 'vn :position 2)
  (print-simple (first (get-bar mini '(2 2 1)))))

=> 
(2 4): C4 Q, D4 E, F4 S, G4 S, CS4 E
(2 4): CS4 E, DS4 S, C4 Q, FS4 S, GS4 Q

SYNOPSIS

(defmethod add-event-to-bar ((sc slippery-chicken) event bar-num-or-ref player
                             &key (position nil))

slippery-chicken-edit/add-half-beat-rest [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 August 26th 2016, Edinburgh

DESCRIPTION

 Calls the method of the same name on each rthm-seq-bar object at the given
 bar number. Adds a half beat rest at the end of the bar. This is a
 destructive method. It will change the time signature, so a 2/4 bar
 becomes a 5/8 bar, with an 1/8th rest at the end. This is done for all the
 players in the ensemble (so that scores can be correctly written)

ARGUMENTS

 - a slippery-chicken object

OPTIONAL ARGUMENTS

 - the bar number to modify. Default = 1.

RETURN VALUE

 T

SYNOPSIS

(defmethod add-half-beat-rest ((sc slippery-chicken) &optional (bar-num 1))

slippery-chicken-edit/add-mark-all-players [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add a specified mark to a specified event in the parts of all players. The
 event can either be specified as a 1-based integer, in which case the mark
 will be attached to the same event in all parts, or as a list of integers,
 in which the mark is attached to different events in the same bar for each
 player, passing from the top of the ensemble downwards.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number or a list of integers that is a
   reference to the bar number in the form (section sequence bar).
 - An integer that is the event to which to attach the specified mark in all
   parts, or a list of integers that are the individual events to which to
   attach the mark in the consecutive players.
 - The mark to be added.

RETURN VALUE

 Always returns T.

EXAMPLE

;;; Apply the method twice: Once using an integer to attach the mark to the
;;; same event in all players, and once using a list to attach the mark to
;;; different events in the consecutive players. Print the corresponding marks
;;; slots to see the results.
(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))))
        :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 ((cl (1 1 1 1 1))
                            (hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))
                        (2 ((cl (1 1 1 1 1))
                            (hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))))))
  (add-mark-all-players mini 3 1 'ppp)
  (add-mark-all-players mini '(2 2 1) '(1 2 3) 'fff)
  (loop for i in '(cl hn vc)
     do (print (marks (get-event mini 3 1 i))))
  (loop for i in '(cl hn vc)
     for e in '(1 2 3)
     do (print (marks (get-event mini '(2 2 1) e i)))))

=>
(PPP) 
(PPP) 
(PPP) 
(FFF) 
(FFF) 
(FFF)

SYNOPSIS

(defmethod add-mark-all-players ((sc slippery-chicken)
                                 bar-num event-num mark)

slippery-chicken-edit/add-mark-before-note [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified mark to the MARKS-BEFORE slot of the specified note
 object within the given slippery-chicken object.

 NB: This method counts notes, not events; i.e., rests are not counted.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number in which the mark is to be added.
 - An integer that is the NOTE number to which the mark is to be added (not
   the event number; i.e., rests are not counted).
 - The ID of the player to which the mark is to be added.
 - The mark to be added.

RETURN VALUE

 Returns the new value of the MARKS-BEFORE slot of the given event object. 

EXAMPLE

;;; The method adds the mark to the specified note, not event. Add the mark to
;;; note 2, print the MARKS-BEFORE slots of events 2 (which is a rest) and 3.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))))))
  (add-mark-before-note mini 3 2 'vn 'ppp)
  (print (marks-before (get-event mini 3 2 'vn)))
  (print (marks-before (get-event mini 3 3 'vn))))

=>
NIL 
(PPP)

SYNOPSIS

(defmethod add-mark-before-note ((sc slippery-chicken)
                                       bar-num note-num player mark)

slippery-chicken-edit/add-mark-to-event [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified mark to the MARKS slot of the specified event within the
 given slippery-chicken object.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number to which the mark is to be added.
 - An integer that is the event number in the specified bar to which the
   mark is to be added.
 - The ID of the player to which to add the mark.
 - The mark to add.

RETURN VALUE

 Returns T.

EXAMPLE

;;; Add a mark to an event object then read the value of the MARKS slot of that
;;; event to see the result
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))))))
  (add-mark-to-event mini 3 2 'vn 'ppp)
  (marks (get-event mini 3 2 'vn)))

=> (PPP)

SYNOPSIS

(defmethod add-mark-to-event ((sc slippery-chicken) bar-num event-num player
                              mark)

slippery-chicken-edit/add-mark-to-note [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified mark to the specified note of a given slippery-chicken
 object. 

 NB: This method counts notes, not events; i.e., not rests.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number to which to add the mark
 - An integer that is the note number two which to add the mark. This is
   1-based, and counts notes not events; i.e., not rests.
 - The ID of the player to whose part the mark is to be added.
 - The mark to add.

RETURN VALUE

 Returns T.

EXAMPLE

;;; Add a mark to a note in a bar with a rest. Print the corresponding event
;;; object to see the result. 
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))))))
  (add-mark-to-note mini 3 2 'vn 'ppp)
  (print (marks (get-event mini 3 2 'vn)))
  (print (marks (get-event mini 3 3 'vn))))

=>
NIL 
(PPP)

SYNOPSIS

(defmethod add-mark-to-note ((sc slippery-chicken)
                             bar-num note-num player mark)

slippery-chicken-edit/add-marks-sh [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 27-Jun-2011

DESCRIPTION

 Add marks in a somewhat more free list form, with the option of
 implementing a user-defined shorthand.

ARGUMENTS

 - A slippery-chicken object.
 - A list of lists containing the players, bar and note refs, and marks to
   be added. The first element of each contained list will be the ID of the
   player to whose part the marks are to be added followed by a pattern of
   <mark bar-number note-number> triplets, or if a mark is to be added
   repeatedly then <mark bar note bar note... >. A mark can be a string or a
   symbol. 

OPTIONAL ARGUMENTS

 keyword arguments:
 - For marks given as symbols, the user can supply a shorthand table that
   will expand an abbreviation, such as sp, to the full mark name, such as
   short-pause. This table takes the form of a simple Lisp association list,
   e.g.: '((al aeolian-light)
           (ad aeolian-dark)
           (wt "WT")
           (h harm))
 - :warn. T or NIL to indicate whether to print a warning for unrecognized
   marks. T = print warning. Default = T.
 - :verbose. T or NIL to indicate whether the method is to print verbose
   feedback about each mark added to the Listener. T = print feedback. 
   Default = NIL.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))
                     (va (viola :midi-channel 2))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))
                            (va (1 1 1 1 1 1))))))))
  (add-marks-sh mini
                '((vn a 1 1 1 2 3 1 s 2 1 2 2 2 5)
                  (va pizz 1 3 2 3 sp 3 1))
                :shorthand '((sp short-pause))
                :verbose t))

=> NIL

SYNOPSIS

(defmethod add-marks-sh ((sc slippery-chicken) player-data 
                         &key shorthand (warn t) verbose)

slippery-chicken-edit/add-marks-to-note [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add one or more specified marks to a specified note within a given
 slippery-chicken object.

 NB: This method counts notes, not events; i.e., rests are not counted.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number to which the mark or marks should to be
   added. 
 - An integer that is the note within the specified bar to which the mark or
   marks should be added.
 - The ID of the player to whose part the mark or marks should be added.
 - The mark or marks to add.

RETURN VALUE

 Returns T.

EXAMPLE

;;; Add several marks to one note, then print the corresponding MARKS slot to
;;; see the difference.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))
                     (va (viola :midi-channel 2))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e (e) e e (e) e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))
                            (va (1 1 1 1 1 1))))))))
  (add-marks-to-note mini 2 3 'va 'a 's 'lhp 'pizz)
  (print (marks (get-note mini 2 3 'va))))

=> (PIZZ LHP S A)

SYNOPSIS

(defmethod add-marks-to-note ((sc slippery-chicken) bar-num note-num
                                  player &rest marks)

slippery-chicken-edit/add-marks-to-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified mark or marks to a consecutive sequence of multiple notes
 within the given slippery-chicken object.

ARGUMENTS

 - A slippery-chicken object.
 - An integer or a list consisting of two numbers to indicate the start
   bar/note. If this is an integer, all notes in this bar will receive the
   specified mark or marks. If this is a two-number list, the first number
   determines the bar, the second the note within that bar.
 - An integer or a list consisting of two numbers to indicate the end
   bar/note. If this is an integer, all notes in this bar will receive the
   specified mark or marks. If this is a two-number list, the first number
   determines the bar, the second the note within that bar.
 - The ID of the player or players to whose parts the mark or marks should
   be attached. This can be a single symbol or a list.
 - T or NIL to indicate whether the mark should be added to the MARKS slot
   or the MARKS-BEFORE slot of the given events objects.
 - The mark or marks to be added.

RETURN VALUE

 Returns T.

EXAMPLE

;;; This example calls the method twice: Once using the single-integer
;;; indication for full bars, with one instrument and one mark; and once using
;;; the bar/note reference lists for more specific placement, a list of several
;;; players that should all receive the marks, and multiple marks to add.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))
                     (va (viola :midi-channel 2))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))
                            (va (1 1 1 1 1 1))))))))
  (add-marks-to-notes mini 2 3 'vn nil 'lhp)
  (add-marks-to-notes mini '(1 3) '(2 2) '(vn va) nil 's 'a))

=> T

SYNOPSIS

(defmethod add-marks-to-notes ((sc slippery-chicken) start end players before
                                   &rest marks)

slippery-chicken-edit/add-pitches-to-chord [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add specified pitches to an existing chord object.

ARGUMENTS

 - The slippery-chicken object which contains the given chord object.
 - The ID of the player whose part is to be affected.
 - An integer that is the number of the bar that contains the chord object
   that is to be modified.
 - An integer that is the number of the note that is the chord object to be
   modified. 
 - The pitches to be added. These can be pitch objects or any data that can
   be passed to make-pitch, or indeed lists of these, as they will be
   flattened.

RETURN VALUE

 The chord object that has been changed.

EXAMPLE

(let* ((ip-clone (clone +slippery-chicken-standard-instrument-palette+)))
  (set-slot 'chord-function 'chord-fun1 'guitar ip-clone)
  (let* ((mini
          (make-slippery-chicken
           '+mini+
           :instrument-palette ip-clone
           :ensemble '(((gtr (guitar :midi-channel 1))))
           :set-palette '((1 ((e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5
                                  g5 a5 b5 c6 d6 e6))))
           :set-map '((1 (1)))
           :rthm-seq-palette 
           '((1 ((((4 4) e e e e e e e e))
                 :pitch-seq-palette ((1 (2) 3 (4) 5 (6) 7 (8))))))
           :rthm-seq-map '((1 ((gtr (1))))))))
    (print (get-pitch-symbols 
            (pitch-or-chord (get-event mini 1 2 'gtr))))
    (add-pitches-to-chord mini 'gtr 1 2 'cs4 'ds4)
    (print (get-pitch-symbols 
            (pitch-or-chord (get-event mini 1 2 'gtr))))))

=>
(E3 G3 B3) 
(E3 G3 B3 CS4 DS4) 

SYNOPSIS

(defmethod add-pitches-to-chord ((sc slippery-chicken) player bar-num note-num 
                                 &rest pitches)

slippery-chicken-edit/add-player [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 October 30th 2018, Heidhausen

DESCRIPTION

 Add a player to the ensemble and piece slots/objects of the given
 slippery-chicken object. This clones the section/sub-section structure of
 the slippery-chicken object, creating all the necessary data structures for
 empty bars in the right meter, tempo etc.

 NB As this method may be called several times successively, it's the
 caller's duty to call (update slots sc) in order to have timing and other
 data updated correctly.

ARGUMENTS

 - the slippery-chicken object
 - a player object or symbol ID for the new player

OPTIONAL ARGUMENTS

 - a symbol ID for an existing instrument in the instrument-palette (the next
   argument). This is actually required unless the default of 'computer is
   acceptable or a player object is passed as second argument.
 - an instrument-palette object in which the instrument exists. Default is
   the standard palette.

RETURN VALUE

 the new player object from the ensemble slot of the slippery-chicken object

SYNOPSIS

(defmethod add-player ((sc slippery-chicken) player
                       &optional (instrument 'computer)
                         (instrument-palette
                          +slippery-chicken-standard-instrument-palette+))

slippery-chicken-edit/add-tuplet-bracket-to-bar [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add a tuplet bracket (with number) to a specified bar in a slippery-chicken
 object. This method adds only one tuplet bracket of one tuplet type
 (triplet, quintuplet etc.) at a time. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar to which the tuplet bracket is
   to be added.
 - The ID of the player to whose part the tuplet bracket is to be added.
 - The bracket info defining the tuplet bracket to be added. This takes the
   form of a three-element list specifying tuplet value, number of the event
   (zero-based) on which the bracket is to begin, and number of the event on
   which the bracket is to end, e.g. '(3 0 2).

OPTIONAL ARGUMENTS

 T or NIL to indicate whether all existing tuplet brackets in the given bar
 are to be deleted first. T = delete. Default = NIL>

RETURN VALUE

 T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+sc-object+
        :ensemble '(((va (viola :midi-channel 2))))
        :set-palette '((1 ((c3 d3 e3 f3 g3 a3 b3 c4 d4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((3 4) (te) - te te - { 3 te ts+ts te } 
                                  - fs fs fs fs fs -))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8 9 8)))))
        :rthm-seq-map '((1 ((va (1 1 1))))))))
  (add-tuplet-bracket-to-bar mini 1 'va '(3 0 2))
  (add-tuplet-bracket-to-bar mini 2 'va '(5 7 11))
  (add-tuplet-bracket-to-bar mini 3 'va '(3 3 4) t)
  (add-tuplet-bracket-to-bar mini 3 'va '(3 5 6)))

=> T

SYNOPSIS

(defmethod add-tuplet-bracket-to-bar ((sc slippery-chicken) bar-num player
                                      bracket-info 
                                      &optional (delete-all-tuplets-first nil))

slippery-chicken-edit/add-tuplet-brackets-to-beats [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified tuplet brackets (and numbers) to the specified event
 objects in the specified bars within the given slippery-chicken object.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player to whose part the tuplet brackets are to be added.
 - A list of 4-element sublists that is the bracket info. Each sublist must
   consist of: the number of the bar to which the bracket is to be added;
   the number that is the tuplet type (3 = triplet, 5 = quintuplet etc.);
   the zero-based number of the event where the bracket is to begin; the
   zero-based number that is the number of the event where the bracket is to
   end; e.g. '((2 3 0 5) (3 3 0 3) (5 5 0 4))

OPTIONAL ARGUMENTS

 T or NIL to indicate whether all existing tuplet bracket info in the given
 bars is to first be deleted. T = delete. Default = NIL.

RETURN VALUE

 NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+sc-object+
        :ensemble '(((va (viola :midi-channel 2))))
        :set-palette '((1 ((c3 e3 g3 c4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((3 4) - te te te - - fs fs fs fs fs -
                                  - 28 28 28 28 28 28 28 -))
                                :pitch-seq-palette ((1 2 3 4 1 2 3 4 1 2 3 4 1
                                                       2 3)))))
        :rthm-seq-map '((1 ((va (1 1 1))))))))
  (add-tuplet-brackets-to-beats mini 'va '((1 3 0 2) (2 5 3 7) (3 7 8 14))))

=> NIL

SYNOPSIS

(defmethod add-tuplet-brackets-to-beats 
    ((sc slippery-chicken) player bracket-info
     &optional (delete-all-tuplets-first nil))

slippery-chicken-edit/auto-accidentals [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Automatically determine which notes in each bar need accidentals and which
 don't. 

 This method also places cautionary accidentals (in parentheses) based on
 how many notes back the last occurrence of that note/accidental combination
 appeared in the bar. The first optional argument to the method allows the
 user to specify how many notes back to look.

 NB: As both cmn-display and write-lp-data-for-all call respell-notes by
     default, that option must be set to NIL for this method to be
     effective (see below).

ARGUMENTS

 - A slippery-chicken object.

OPTIONAL ARGUMENTS

 - An integer that is the number of notes back to look when placing
   cautionary accidentals in parentheses. If the last occurrence of a given
   repeated note/accidental combination was farther back than this number,
   the accidental will be placed in the score in parentheses.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((fs4 gs4 as4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 2 1 2 3 2)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (auto-accidentals mini 4)
  (cmn-display mini :respell-notes nil))

=> NIL

SYNOPSIS

(defmethod auto-accidentals ((sc slippery-chicken) &optional 
                             (cautionary-distance 3)
                             ignore1 ignore2)

slippery-chicken-edit/auto-beam [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Automatically places indications for beam start- and end-points (1 and 0)
 in the BEAMS slot of the corresponding event objects.

 By default, this method determines the start and end indications for beams
 on the basis of the beat found in the time signature, but the user can
 specify a different beat basis using the first optional argument.

ARGUMENTS

 - A slippery-chicken object.

OPTIONAL ARGUMENTS

 - NIL, an integer that is a power-of-two rhythmic duration, or the
   alphabetic representation of such a rhythm to specify the beat basis for
   setting beams (e.g. 4 or 'h).
 - T or NIL to indicate whether the method is to check whether an exact beat
   of rhythms can be found for each beat of the bar. If T, a warning will be
   printed when an exact beat cannot be found for each beat of the bar. 
   Default = T.

RETURN VALUE

 Returns NIL.

EXAMPLE

;; Auto-beam the events of the given slippery-chicken object on the basis of a ;
;; half note:                           ;
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((fs4 gs4 as4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 2 1 2 3 2)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (auto-beam mini 'h))

  => NIL

SYNOPSIS

(defmethod auto-beam ((sc slippery-chicken) &optional (beat nil) (check-dur t))

slippery-chicken-edit/auto-clefs [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Automatically create clef changes in the specified player's or players'
 part or parts by adding the appropriate clef symbol to the MARKS-BEFORE
 slot of the corresponding event object.

 This routine will only place clef symbols that are present in the given
 instrument object's CLEFS slot.

 This method is called automatically by cmn-display and
 write-lp-data-for-all, with the delete-clefs option set to T.

 NB: While this routine generally does a good job of putting the proper
     clefs in place, it will get confused if the pitches in a given player's
     part jump from very high to very low (e.g. over the complete range of
     the piano).

ARGUMENTS

 - A slippery-chicken object.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :verbose. T or NIL to indicate whether the method is to print feedback
   about its operations to the Listener. T = print feedback. Default = NIL. 
 - :in-c. T or NIL to indicate whether the pitches processed are to be
   handled as sounding or written pitches. T = sounding. Default = T.
 - :players. A list containing the IDs of the players whose parts are to be
   to have clefs automatically added.
 - :delete-clefs. T or NIL to indicate whether the method should first
   delete all clef symbols from the MARKS-BEFORE slots of all event objects
   it is processing before setting the automatic clef changes.
 - :delete-marks-before. T or NIL to indicate whether the MARKS-BEFORE slot
   of all event objects processed should first be set to NIL. 
   T = set to NIL. Default = NIL.

RETURN VALUE

 Returns T

EXAMPLE

;;; Straightforward usage applied to just the VC player ;
(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 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))
                            (vc (1 1 1 1))))))))
  (auto-clefs mini :players '(vc)))

  => T

SYNOPSIS

(defmethod auto-clefs ((sc slippery-chicken) 
                       &key verbose in-c players 
                       (delete-clefs t)
                       (delete-marks-before nil))

slippery-chicken-edit/auto-slur [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Automatically add slurs to note groups in the specified measure range of a
 given player's part. 

 This method places slurs above all consecutive notes between rests. If a
 value is specified for :end-bar and the last event in the end bar is not a
 rest, the final sequence of attacked notes in that bar will not be
 slurred. 

 NB: Slurs will automatically stop at repeated pitches.  Staccato marks will
 not stop the auto-slurring process but staccatos can be removed (see
 below). 

ARGUMENTS

 - A slippery-chicken object.
 - A player ID or list of player IDs for the parts in which the slurs are to
   be placed.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :start-bar. An integer that is the first bar in which to automatically
   place slurs.  
 - :end-bar. An integer that is the last bar in which to automatically place
   slurs. 
 - :rm-slurs-first. T or NIL to indicate whether to first remove existing
   slurs from the specified region. NB: If you already have slur marks
   attached to events, setting this to NIL can produce unwanted results
   caused by orphaned beg-slur or end-slur marks.  T = remove existing slurs
   first. Default = T.
 - :rm-staccatos. T or NIL to indicate whether to first remove existing
   staccato, tenuto, and accented staccato marks from the specified
   region. T = remove staccatos. Default = NIL.
 - :over-accents. T or NIL. Default = T.
 - :verbose. T or NIL to indicate whether to print feedback from the process
   to the Lisp listener. T = print. Default = NIL.

RETURN VALUE

 A list of sublists, each of which contains the start and end event, plus
 the number of notes under the slur, for each slur added. 

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c3 d3 e3 f3 g4 a3 b3
                               c4 d4 e4 f4 g4 a4 b4 c5))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) - e e - (s) e.  
                                  - s s e - - s (s) s s -))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8 9))
                                :marks (a 4))))
        :rthm-seq-map '((1 ((vn (1 1 1))))))))
  (auto-slur mini 'vn
             :start-bar 1
             :end-bar 2))

SYNOPSIS

(defmethod auto-slur ((sc slippery-chicken) players
                      &key start-bar end-bar
                      (rm-slurs-first t)
                      (rm-staccatos t)
                      ;; 5.4.11
                      (over-accents t)
                      verbose)

slippery-chicken-edit/bars-to-sc [ Functions ]

[ Top ] [ slippery-chicken-edit ] [ Functions ]

DESCRIPTION

 Take a list of rthm-seq-bars and add them to a new or existing
 slippery-chicken object.  If already existing, we assume it's one you're
 creating part by part with this function, as it's not currently possible to
 add a part like this in the middle of the score--the new part will be added
 to the end of the last group of the ensemble (bottom of score) so make sure
 to add parts in the order you want them.

 NB Bear in mind that if you want to use midi-play, then the events in the
    bars will need to have their midi-channel set (e.g. via make-event).
    It's also the caller's responsibility to ensure that the parts added have
    the same time-signature structure as any existing part.

ARGUMENTS

 - A list of rthm-seq-bars

OPTIONAL ARGUMENTS

 keyword arguments:
 - :sc. Either an existing slippery-chicken object or nil if one should be
   created automatically.  If nil, the following three arguments must be
   specified, otherwise they will be ignored.  Default = NIL.
 - :sc-name.  The name (symbol) for the slippery-chicken object to be
   created.  This will become a global variable. Default = '*auto*.
 - :player.  The name (symbol) of the player to create. Default =
   'player-one. (Remember that Lilypond has problems with player names
    with numbers in them :/ )
 - :instrument.  The id (symbol) of an already existing instrument in the
    instrument-palette. Default = 'flute.
 - :update. Whether to call update-slots on the new slippery-chicken
   object (to update timing info. etc.).  Default = T.
 - :section-id.  The section id.  Default = 1.

RETURN VALUE

 A slippery-chicken object.

SYNOPSIS

(defun bars-to-sc (bars &key sc (sc-name '*auto*) (player 'player-one)
                          (instrument-palette 
                           +slippery-chicken-standard-instrument-palette+)
                          (tempo 60) (instrument 'flute) (section-id 1)
                          (update t))

slippery-chicken-edit/change-pitch [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Change the pitch of a specified event to a new specified pitch. The new
 pitch is not required to be a member of the current set.

 NB The new pitch is the sounding pitch if a transposing instrument, unless
 optional argument is set to T.

 NB In the case of ties, this doesn't update the following 'tied-to' notes
 but see the documentation for the change-pitches method below (or call
 check-ties, which fixes them too).

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the bar number in which the pitch is to be changed.
 - An integer that is the number of the note in the specified bar whose
   pitch is to be changed (1-based).
 - The ID of the player for whom the pitch is to be changed.
 - A note-name symbol that is the new pitch.

OPTIONAL ARGUMENTS

 T or NIL to indicate whether the written or sounding pitch should be
 changed.  Default = NIL (sounding).

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (change-pitch mini 1 3 'vc 'fs3))

=> T

SYNOPSIS

(defmethod change-pitch ((sc slippery-chicken) bar-num note-num player
                         new-pitch &optional written)

slippery-chicken-edit/change-pitches [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Change the pitches of the specified event objects for a given player to the
 specified new pitches. 

 If the new pitches are passed as a simple flat list, the method will just
 change the pitch of each consecutive attacked event object (with NIL
 indicating no change), moving from bar to bar as necessary, until all of
 the specified new pitches are used up. Also, if a flat list is passed, each
 new pitch specified will be applied to each consecutive attacked note;
 i.e., ties don't count as new pitches.

 Tied-to events are left with the old pitch information, which is of course
 a potential problem. When generating scores though, we usually call
 respell-notes, which calls check-ties, which corrects spellings of tied-to
 notes and therefore in effect changes those notes too. So generally, we
 don't have to worry about this, but if you explicitly tell slippery chicken
 not to respell notes, you'll need to call check-ties with the first
 optional argument as T.

 Also see the documentation in the bar-holder class for the method of the
 same name. 

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose part is to be modified.
 - An integer that is the number of the first bar whose pitches are to be
   modified. 
 - A list note-name symbols and NILs, or a list of lists of note-name
   symbols and NILs, which are the new pitches. If a simple flat list, see
   the comment in the description above. If a list of lists, each sub-list
   will represent a full bar; e.g., (change-pitches bh 'vla 5 '((g3 gs4) nil
   (nil nil aqf5))) will change the pitches in bars 5 and 7 (for the player
   'vla), whereas bar six, indicated by nil, wouldn't be changed; similarly
   the first two notes of bar 7, being nil, will also not be changed, but
   note 3 will.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :use-last-octave. T or NIL to indicate whether or not each consecutive
   new pitch listed will automatically take the most recent octave number
   specified; e.g. '((a3 b g cs4)). T = use last octave number. Default = T.
 - :marks. A list of marks to be added to the events objects. This option
   can only be used in conjunction with the simple flat list of pitches. In
   this case the list of pitches and list of marks must be the same length
   and correspond to each other item by item. Sub-lists can be used to add
   several marks to a single event. NB: See cmn.lsp::get-cmn-marks for the
   list of recognised marks. If NIL, no marks will be added. Default = NIL.
 - :written.  T or NIL to indicate whether these are the written or sounding
   notes for a transposing instrument. Default = NIL. 
 - :warn.  If there are more pitches in the given list than there are events
   in the slippery-chicken structure, issue a warning, unless NIL.  
   Default = T.  

RETURN VALUE

 If the new pitches are passed as a simple flat list, the method returns
 the number of the bar in which the pitches were changed; 
 otherwise returns T. 

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1 1 1))))))))
  (change-pitches mini 'vc 2 '((fs3 gs3 as3)))
  (change-pitches mini 'vc 3 '((nil nil fs3 gs as ds fs gs) 
                               nil
                               (cs4 ds fs))))

=> T

SYNOPSIS

(defmethod change-pitches ((sc slippery-chicken) player start-bar new-pitches
                           &key (use-last-octave t) marks written
                             (warn t))

slippery-chicken-edit/change-time-sig [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Force a change of the time-sig associated with a specified bar. 
 
 NB: This method does not check to see if the rhythms in the bar add up to a 
     complete bar in the new time-sig.

 Also see rthm-seq-bar (setf time-sig).

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar whose time signature should be
   changed or a list that is a reference to the bar whose time signature is
   to be changed in the format (section sequence bar).
 - The new signature in the format (number-of-beats beat-unit).

RETURN VALUE

 Returns T.

EXAMPLE

;;; Changing two time signatures; once using the integer bar reference, the
;;; second time using the list reference to the bar number.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (change-time-sig mini 2 '(3 8))
  (change-time-sig mini '(1 1 1) '(5 8)))

=> T 

SYNOPSIS

(defmethod change-time-sig ((sc slippery-chicken) bar-num-or-ref new-time-sig)

slippery-chicken-edit/consolidate-all-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 A convenience method which just calls the consolidate-notes method from the
 rthm-seq-bar class for all the bars specified in the arguments.  

ARGUMENTS

 - the slippery-chicken object
 - the first bar number in which consolidation should take place
 - the last bar number in which consolidation should take place
   (inclusive). If NIL then the process will run until the last bar.  
 - A list of the IDs of the players to whose parts the consolidation should 
   be applied. Can also be a single symbol.

RETURN VALUE

 A list of the rthm-seq-bar objects that were modified. See map-over-bars
 for more details. 

SYNOPSIS

(defmethod consolidate-all-notes ((sc slippery-chicken)
                                  &optional (start-bar 1) end-bar players
                                  ;; MDE Fri Sep 21 09:08:09 2018 -- added
                                  ;; consolidate-notes' optional args  
                                    check-dur beat (auto-beam t))

slippery-chicken-edit/consolidate-all-rests [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 A convenience method which just calls the consolidate-rests method from the
 rthm-seq-bar class for all the bars specified in the arguments.  

ARGUMENTS

 - the slippery-chicken object
 - the first bar number in which consolidation should take place
 - the last bar number in which consolidation should take place
   (inclusive).  If NIL then the process will run until the last bar.  
 - A list of the IDs of the players to whose parts the consolidation should 
   be applied. Can also be a single symbol.

OPTIONAL ARGUMENTS

 T or NIL to indicate whether the method should print a warning to the Lisp
 listener if it is mathematically unable to consolidate the rests. T = print
 warning. Default = NIL.

RETURN VALUE

 - A list of the rthm-seq-bar objects that were modified.  See map-over-bars
 for more details. 

SYNOPSIS

(defmethod consolidate-all-rests ((sc slippery-chicken)
                                  &optional (start-bar 1) end-bar players warn)

slippery-chicken-edit/delete-bars [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete a sequence of consecutive bars from the given slippery-chicken
 object. 

 NB This might delete rehearsal letters, instrument changes (and maybe other
 things) attached to a bar/event.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the first bar to delete.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :num-bars. An integer that is the number of consecutive bars, including
   the start-bar, to delete. This argument cannot be used simultaneously
   with :end-bar
 - :end-bar. An integer that is the number of the last of the consecutive
   bars to delete. This argument cannot be used simultaneously with
   :num-bars. 
 - :print. Print feedback of the process to the Listener, including a
   print-simple of the bars deleted.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (delete-bars mini 2 :end-bar 3)
  (delete-bars mini 2 :num-bars 1))

  => T

SYNOPSIS

(defmethod delete-bars ((sc slippery-chicken) start-bar
                        &key num-bars end-bar print)

slippery-chicken-edit/delete-clefs [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete the clef symbol held in the MARKS-BEFORE slot of the specified event
 object within the given slippery-chicken object.

ARGUMENTS

 NB: The optional arguments are actually required.
 - A slippery-chicken object.
 - The ID of the player from whose part the clef symbol is to be deleted. 
 - An integer that is the number of the bar from which the clef symbol is to
   be deleted.
 - An integer that is the number of the event object within the specified
   from whose MARKS-BEFORE slot the clef symbol is to be deleted. This is a
   1-based index but counts rests and ties.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (auto-clefs mini)
  (delete-clefs mini 'vc 1 3))

  => NIL

SYNOPSIS

(defmethod delete-clefs ((sc slippery-chicken) &optional
                         player bar-num event-num)

slippery-chicken-edit/delete-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 21-Jul-2011 (Pula)

DESCRIPTION

 Turn notes into rests by setting the IS-REST slots of the specified
 consecutive event objects within the given slippery-chicken object to T.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the first bar for which the notes are to
   be changed to rests. 
 - An integer that is the index of the first event object within the
   specified start bar for which the IS-REST slot is to be changed to
   T. This number is 1-based and counts rests and ties. 
 - An integer that is the number of the last bar for which the notes are to
   be changed to rests. 
 - An integer that is the index of the last event object within the
   specified end bar for which the IS-REST slot is to be changed to T. This
   number is 1-based and counts rests and ties. If NIL, apply the change to
   all events in the given bar.

OPTIONAL ARGUMENTS

 - A list of the IDs of the players whose parts are to be modified. If NIL,
   apply the method to the parts of all players.
 - T or NIL to indicate whether to consolidate resulting consecutive rests
   into one longer rest each. T = consolidate. Default = T.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (delete-events mini 2 2 3 nil 'vc))

  => T

SYNOPSIS

(defmethod delete-events ((sc slippery-chicken) start-bar start-event end-bar
                          end-event &optional players (consolidate-rests t))

slippery-chicken-edit/delete-rehearsal-letter [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete the rehearsal letter from a specified bar of on or more specified
 players' parts by setting the REHEARSAL-LETTER slot of the corresponding
 rthm-seq-bar object to NIL.

 NB: This deletes the given rehearsal letter without resetting and
     re-ordering the remaining rehearsal letters.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar from which the rehearsal letter
   is to be deleted. NB: The rehearsal letter for a given bar is internally
   actually attached to the previous bar. The number given here is the
   number from the user's perspective, but the change will be reflected in
   the bar with the number specified -1.

OPTIONAL ARGUMENTS

 - A list consisting of the IDs of the players from whose parts the
   rehearsal letter is to be deleted.

RETURN VALUE

 Returns the deleted rehearsal letter from the last player which had one
 attached.  

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1 1 1)))))
        :rehearsal-letters '(2 4 6))))
  (delete-rehearsal-letter mini 2 '(vc)))

  => NIL

SYNOPSIS

(defmethod delete-rehearsal-letter ((sc slippery-chicken) bar-num
                                    &optional players)

slippery-chicken-edit/delete-slur [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete a slur mark that starts on a specified note within a specified bar
 of a specified player's part by deleting the BEG-SL and END-SL marks from
 the corresponding event objects.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar from which the slur is to be
   deleted. 
 - An integer that is the number of the note on which the slur to be deleted
   starts within the given bar. This number counts tied-notes but not
   rests. 
 - The ID of the player from whose part the slur is to be deleted.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8))
                                :marks (slur 1 8))))
        :rthm-seq-map '((1 ((vc (1 1 1 1 1 1))))))))
  (delete-slur mini 1 1 'vc)
  (delete-slur mini 3 1 'vc))

  => NIL

SYNOPSIS

(defmethod delete-slur ((sc slippery-chicken) bar-num note-num player)

slippery-chicken-edit/double-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 20-Jul-2011 (Pula)

DESCRIPTION

 Copy the specified events from one player to the corresponding bars of one
 or more other players.

 NB: Although partial bars can be copied from the source player, the entire
     bars of the target players are always overwritten, resulting in rests
     in those segments of the target players' bars that do not contain the
     copied material. This method thus best lends itself to copying into
     target players parts that have rests in the corresponding bars.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player from whose part the events are to be copied.
 - The ID or a list of IDs of the player or players into whose parts the
   copied events are to be placed.
 - An integer that is the number of the first bar from which the events are
   to be copied.
 - An integer that is the number of the first event to be copied from the
   specified start bar. This number is 1-based and counts rests and ties. 
 - An integer that is the number of the last bar from which the events are
   to be copied.
 - NIL or an integer that is the number of the last event to be copied from
   the specified end bar. This number is 1-based and counts rests and
   ties. If NIL, all events from the given bar will be copied.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :transposition. A positive or negative number that is the number of
   semitones by which the copied material is to be first transposed. This
   number can be a decimal number, in which case the resulting pitches will
   be rounded to the nearest microtone (if the current tuning environment is
   capable of microtones).
 - :consolidate-rests. T or NIL to indicate whether resulting consecutive
   rests should be consolidated each into one longer rest.
   T = consolidate. Default = T.
 - :update. T or NIL to indicate whether to update the slots of the given
   slippery-chicken object after copying. T = update. Default = T.
 - :auto-beam. T or NIL to indicate whether to call auto-beam on the doubled
   notes. Default = T.
 - :pitches. T or NIL to indicate whether pitch information should be copied
   over. This would usually be T but some methods might just want to
   duplicate events as rests (e.g. orchestrate). Default = T.

RETURN VALUE

 Returns T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((bsn (bassoon :midi-channel 1))
                     (tbn (tenor-trombone :midi-channel 2))
                     (vlc (cello :midi-channel 3))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) (w)))))
                            (2 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((bsn (1 1 1 1 1 1))
                            (tbn (1 1 1 1 1 1))
                            (vlc (2 2 2 2 2 2))))))))
  (double-events mini 'vlc '(bsn tbn) 2 3 4 2)
  (double-events mini 'vlc 'bsn 5 1 5 nil :transposition 3.5))

  => T

SYNOPSIS

(defmethod double-events ((sc slippery-chicken) master-player doubling-players
                          start-bar start-event end-bar end-event
                          &key transposition (consolidate-rests t) (update t)
                            (pitches t) (auto-beam t))

slippery-chicken-edit/enharmonic-spellings [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Change the pitch of specified event objects to their enharmonic
 equivalents. 

 This takes as its second argument a list of lists, each of which consists
 of the ID of the player whose part is to be altered and a series of
 bar-number/event-number pairs, where (2 3) indicates that the pitch of the
 third event of the second bar is to be changed to its enharmonic
 equivalent. 

 Pitches within chords are specified by following the bar number with a
 2-item list consisting of the event number and the number of the pitch
 within the chord, counting from low to high, where (2 (2 4)) indicates that
 the fourth pitch from the bottom of the chord located in the second event
 object of bar 2 should be changed to its enharmonic equivalent.

 An optional T can be included to indicate that the written pitch is to be
 changed, but not the sounding pitch, as in (cl (3 4 t)).

 NB: In order for this method to work, the :respell-notes option of
     cmn-display and write-lp-data-for-all must be set to NIL.

ARGUMENTS

 - A slippery-chicken object.
 - The list of changes to be made, in the format '((player changes...)),
   e.g.: 
 
   '((cl (3 3 t) (3 4 t))
     (pn (2 (2 4)))
     (vc (1 1) (1 3) (1 4) (1 6)))

RETURN VALUE

 Returns T.

EXAMPLE

SYNOPSIS

(defmethod enharmonic-spellings ((sc slippery-chicken) corrections)

slippery-chicken-edit/enharmonics [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Change the sharp/flat pitches of a specified region of a specified player's
 part to their enharmonic equivalent.

 NB: This method only affects pitches that already have sharp/flat
     accidentals. It does not affect "white-key" notes (e.g. C-natural =
     B-sharp etc.)

 NB: As the cmn-display and write-lp-data-for-all methods call
    :respell-notes by default, this option must be explicitly set to NIL for
    this method to be effective.

ARGUMENTS

 - A slippery-chicken object.
 - An integer or a 2-item list of integers that indicates the first bar in
   which the enharmonics are to be changed. If an integer, the method will
   be applied to all sharp/flat pitches in the bar of that number. If a
   2-item list of integers, these represent '(bar-number note-number). The
   note number is 1-based and counts ties.
 - An integer or a 2-item list of integers that indicates the last bar in
   which the enharmonics are to be changed. If an integer, the method will
   be applied to all sharp/flat pitches in the bar of that number. If a
   2-item list of integers, these represent '(bar-number note-number). The
   note number is 1-based and counts ties.
 - The ID of the player whose part is to be changed.

OPTIONAL ARGUMENTS

 keyword arguments
 - :written. T or NIL to indicate whether to change written-only pitches or
   sounding-only pitches. T = written-only. Default = T.
 - :pitches. NIL or a list of note-name symbols. If NIL, all sharp/flat
   pitches in the specified region will be changed to their enharmonic
   equivalents. If a list of one or more note-name symbols, only those
   pitches will be affected.
 - :force-naturals. T or NIL to indicate whether to force "natural" note
   names that contain no F or S in their name to convert to their enharmonic
   equivalent (ie, B3 = CF4).  NB double-flats/sharps are not implemented so
   this will only work on F/E  B/C. 

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                     (pn (piano :midi-channel 2))
                     (vn (violin :midi-channel 3))))
        :set-palette '((1 ((cs4 ds4 e4 fs4 gs4 as4 b4 cs5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) - e e e e - - e e e e -))
                                :pitch-seq-palette ((1 (2) 3 4 (5) 6 (7) 8)))))
        :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                            (pn (1 1 1 1 1))
                            (vn (1 1 1 1 1))))))))
  (enharmonics mini 1 2 'vn)
  (enharmonics mini 2 3 'pn :pitches '(cs4 ds4))
  (enharmonics mini 3 4 'cl :written nil))

=> T

SYNOPSIS

(defmethod enharmonics ((sc slippery-chicken) start end player
                        &key (written t) pitches force-naturals)

slippery-chicken-edit/force-artificial-harmonics [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 For string scoring purposes only: Transpose the pitch of the given event
 object down two octaves and add the harmonic symbol at the perfect fourth.

 If this results in a fingered pitch (or even a touched perfect fourth) that
 is out of the range of the instrument, a warning will be printed to the
 Listener, the pitch will not be transposed, and the harmonic diamond will
 not be added.

 NB This method assumes the player doesn't change instrument during the bars
 to be processed. 

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose part is to be changed.
 - An integer that is the number of the first bar in which artificial
   harmonics are to be created.  
 - An integer that is the number of the first event in that bar that is to
   be changed into an artificial harmonic.
 - An integer that is the number of the last bar in which artificial
   harmonics are to be created.  

OPTIONAL ARGUMENTS

 - An integer that is the number of the first event in that bar that is to
   be changed into an artificial harmonic. If no end-event is specified, all
   event objects in the last bar will be changed to artificial harmonics.
 - T or NIL to trigger warnings when forcing would take a fingered pitch out
   of the instrument's range, or when we encounter chords or rests
 - T or NIL to force natural-harmonics to become artificial. Default = T.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 f4 b4 e5 a5 d6 g7 c8))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8))))) 
        :rthm-seq-map '((1 ((vn (1 1 1))))))))
  (force-artificial-harmonics mini 'vn 2 3 3 2))

=> T

SYNOPSIS

(defmethod force-artificial-harmonics ((sc slippery-chicken) player start-bar
                                       start-event end-bar
                                       &optional end-event (warn t)
                                         (naturals t))

slippery-chicken-edit/force-in-range [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 October 19th 2018, Heidhausen

DESCRIPTION

 Force all pitches (and chords) to be within the range of the instruments who
 play them. Of course this is usually a part of the slippery-chicken pitch
 selection algorithm but sometimes we change pitches (algorithmically in
 particular) and this might bring them out of range. Notes that are out of
 range will be transposed up and down the required number of octaves. This
 applies to single pitches in chords also. Instrument changes will be
 respected on a bar-by-bar basis. See also the three force-in-range methods
 in instrument.lsp 

ARGUMENTS

 - the slippery-chicken object
 - a symbol or list of symbols for the players to be processed. Default = NIL
   = all players.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :start-bar. The bar to start at. Default = NIL = 1
 - :end-bar. The bar to end at. Default = NIL = last bar in piece/object

RETURN VALUE

 the modified slippery-chicken object

SYNOPSIS

(defmethod force-in-range ((sc slippery-chicken) players &key start-bar end-bar)

slippery-chicken-edit/force-rest-bars [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete all notes from the specified bars and replace them with full-bar
 rests. 
 
 NB: The start-bar and end-bar index numbers are inclusive

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the first bar to change to a full bar of
   rest. 
 - An integer that is the number of the last bar to change to a full bar of
   rest. If NIL then we process all bars.
 - A list containing the IDs of the players in whose parts the full-bar
   rests are to be forced. If NIL then all players will be processed.

OPTIONAL ARGUMENTS

 - T or NIL to indicate that only bars containing exclusively rests should be
   processed.

RETURN VALUE

 Returns the number of bars processed (integer).

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))
                     (va (viola :midi-channel 2))
                     (vc (cello :midi-channel 3))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 e4 g4 b4 d5 f5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8))))) 
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))
                            (va (1 1 1 1 1 1))
                            (vc (1 1 1 1 1 1))))))))
  (force-rest-bars mini 3 5 '(vn vc)))

=> NIL

SYNOPSIS

(defmethod force-rest-bars ((sc slippery-chicken) start-bar end-bar players
                            &optional only-if-all-rests)

slippery-chicken-edit/make-hammer-friendly [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 October 4th 2019

DESCRIPTION

 Yamaha Disklavier pianos can't play a note immediately after a note-off. The
 hammer needs a little time to return to its 'off' position before it can be
 used to restrike a note. Tests show this time to be around 60
 milliseconds. of course this will be instrument-dependent, so a little
 experimentation might be needed.

 This method will go through each event and decrement those events on the
 same MIDI channel which start < 'min-time' after the end-time of the
 previous event.

ARGUMENTS

 - the slippery-chicken object
 - either a single symbol or a list of symbols for the players to be
   processed

OPTIONAL ARGUMENTS

 keyword arguments
 - :start-bar. The bar at which to begin processing (integer). Default = 1.
 - :end-bar. The bar at which to end processing (integer). Default = NIL =
   last bar
 - :min-gap. The minimum time the hammer needs to return, in
   milliseconds. Default = 60.
 - :min-dur. The minimum duration of a note in milliseconds, after reducing
   duration. Default = 50 milliseconds.

RETURN VALUE

 A list of the number of notes affected per player.

SYNOPSIS

(defmethod make-hammer-friendly ((sc slippery-chicken) players
                                 &key
                                   (warn t)
                                   (start-bar 1)
                                   end-bar
                                   (min-gap 60)
                                   (min-dur 50))

slippery-chicken-edit/map-over-bars [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Apply the specified method/function to the bars (all rthm-seq-bar objects)
 of one or more players' parts in the given slippery-chicken object. 

ARGUMENTS

 - A slippery-chicken object.
 - A number that is the first bar to which the function should be
   applied. Default = NIL in which case 1 will be used. 
 - A number that is the last bar to which the function should be
   applied. Default = NIL in which case all bars will be processed. 
 - A list of the IDs of the players to whose parts the function should be
   applied. Can also be a single symbol. If NIL then all players will be
   processed.  
 - The method or function itself. This can be a user-defined function or the
   name of an existing method or function.  It should take at least one
   argument, a rthm-seq-bar, and any other arguments as supplied. 

OPTIONAL ARGUMENTS

 - Any additional argument values the specified method/function may
   take or require. See the thin method below for an example that uses
   additional arguments. 

RETURN VALUE

 - A list of the rthm-seq-bar objects that were modified.  NB This might be
   a long list, and, depending on your Lisp implementation, formatting of the
   bars might cause Lisp to appear to 'hang'.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))))
        :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                 (2 ((sax ((2 alto-sax) (5 tenor-sax)))))
                                 (3 ((sax ((3 alto-sax) (4 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))
                   (3 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) h e (s) (s) e+s+s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((sax (1 1 1 1 1))))
                        (2 ((sax (1 1 1 1 1))))
                        (3 ((sax (1 1 1 1 1))))))))
  (print (map-over-bars mini 1 nil nil #'consolidate-notes nil 'q)))

=>
(
RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: T, bar-num: 1, 
[...]
RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: T, bar-num: 2, 
[...]
RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: T, bar-num: 3, 
[...]
RTHM-SEQ-BAR: time-sig: 2 (4 4), time-sig-given: T, bar-num: 4, 
[...]
)

SYNOPSIS

(defmethod map-over-bars ((sc slippery-chicken) start-bar end-bar players
                          function &rest further-args)

slippery-chicken-edit/map-over-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

AUTHOR

 Daniel Ross (mr.danielross[at]gmail[dot]com) 

DATE

 1 September 2019, London

DESCRIPTION

 A simple method that mimics the behaviour of map-over-bars but on events
 instead. At its heart is a next-event loop. Use this method to apply an
 arbitrary function to every event within a specific range of bars.

ARGUMENTS

 - A slippery chicken object
 - A number that is the first bar to which the function should be
   applied. Default = NIL in which case 1 will be used. 
 - A number that is the last bar to which the function should be
   applied. Default = NIL in which case all bars will be processed. 
 - A list of the IDs of the players to whose parts the function should be
   applied. Can also be a single symbol. If NIL then all players will be
   processed.  
 - The method or function itself. This can be a user-defined function or the
   name of an existing method or function.  It should take at least one
   argument, an event, and any other arguments as supplied.  

OPTIONAL ARGUMENTS

 - Any additional argument values the specified method/function may
   take or require. See the thin method below for an example that uses
   additional arguments. 

RETURN VALUE

 - A list containing the number of events changed per instrument

EXAMPLE

(let* ((mini
          (make-slippery-chicken
           '+mini+
           :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))))
           :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                    (2 ((sax ((2 alto-sax) (5 tenor-sax)))))
                                    (3 ((sax ((3 alto-sax) (4 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))
                      (3 (1 1 1 1 1)))
           :rthm-seq-palette '((1 ((((4 4) h e (s) (s) e+s+s))
                                   :pitch-seq-palette ((1 2 3)))))
           :rthm-seq-map '((1 ((sax (1 1 1 1 1))))
                           (2 ((sax (1 1 1 1 1))))
                           (3 ((sax (1 1 1 1 1))))))))
        (print (is-rest (get-event mini (num-bars mini) 2 'sax)))
        (print (map-over-events mini 1 nil nil #'force-rest))
        (is-rest (get-event mini (num-bars mini) 3 'sax)))

=> NIL
   (105)
   T

SYNOPSIS

(defmethod map-over-events ((sc slippery-chicken) start-bar end-bar players
                           function &rest further-args)

slippery-chicken-edit/map-over-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

AUTHOR

 Daniel Ross (mr.danielross[at]gmail[dot]com) 

DATE

 1 September 2019, London

DESCRIPTION

 A simple method that mimics the behaviour of map-over-bars but on notes
 instead. At its heart is a next-event loop. Use this method to apply an
 arbitrary function to every note within a specific range of bars.
 NB This works on NOTES only, rests will be skipped!

ARGUMENTS

 - A slippery chicken object
 - A number that is the first bar to which the function should be
   applied. Default = NIL in which case 1 will be used. 
 - A number that is the last bar to which the function should be
   applied. Default = NIL in which case all bars will be processed. 
 - A list of the IDs of the players to whose parts the function should be
   applied. Can also be a single symbol. If NIL then all players will be
   processed.  
 - The method or function itself. This can be a user-defined function or the
   name of an existing method or function.  It should take at least one
   argument, a note event (can be a single pitch or a chord), and any other
 arguments as supplied.  

OPTIONAL ARGUMENTS

 - Any additional argument values the specified method/function may
   take or require. See the thin method below for an example that uses
   additional arguments. 

RETURN VALUE

 - A list containing the number of notes changed per instrument

EXAMPLE

(let* ((mini
          (make-slippery-chicken
           '+mini+
           :ensemble '(((sax ((alto-sax tenor-sax) :midi-channel 1))))
           :instrument-change-map '((1 ((sax ((1 alto-sax) (3 tenor-sax)))))
                                    (2 ((sax ((2 alto-sax) (5 tenor-sax)))))
                                    (3 ((sax ((3 alto-sax) (4 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))
                      (3 (1 1 1 1 1)))
           :rthm-seq-palette '((1 ((((4 4) h e (s) (s) e+s+s))
                                   :pitch-seq-palette ((1 2 3)))))
           :rthm-seq-map '((1 ((sax (1 1 1 1 1))))
                           (2 ((sax (1 1 1 1 1))))
                           (3 ((sax (1 1 1 1 1))))))))
        (print (is-chord (get-note mini (num-bars mini) 3 'sax)))
        (print (map-over-notes mini 1 nil nil #'add-pitches 'c4 'd4))
        (is-chord (get-note mini (num-bars mini) 3 'sax)))

=> NIL
   (45)
   3

SYNOPSIS

(defmethod map-over-notes ((sc slippery-chicken) start-bar end-bar players
                           function &rest further-args)

slippery-chicken-edit/map-over-sequenzes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 February 2nd 2018, Heidhausen

DESCRIPTION

 Apply a function to each sequenz object in a slippery-chicken piece. Note
 that as a sequenz is a subclass of rthm-seq (and bar-holder) and that
 rthm-seq has its rthm-seq-bars in the bars slot, we've got access to all
 kinds of data which we can switch on in the function passed here,
 e.g. player-section-ref, rsp-id

ARGUMENTS

 - the slippery-chicken object
 - the player(s) to process (single or list of symbols). If nil then all
   players will be processed. 
 - the function to apply to each sequenz. This should accept a sequenz object
   as its first argument.  

OPTIONAL ARGUMENTS

 &rest: further arguments to be passed to the given function

RETURN VALUE

 T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((hn (french-horn :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))
                                :pitch-seq-palette ((1 2 3 4 5))))
                            (2 ((((4 4) h h))
                                :pitch-seq-palette ((1 2)))))
        :rthm-seq-map '((1 ((hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))
                        (2 ((hn (2 2 2 2 2))
                            (vc (2 2 2 2 2))))
                        (3 ((hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))))))
  (map-over-sequenzes mini 'hn 
                      #'(lambda (seq) (print (player-section-ref seq)))))
=> 
(1 HN) 
(1 HN) 
(1 HN) 
(1 HN) 
(1 HN) 
(2 HN) 
(2 HN) 
(2 HN) 
(2 HN) 
(2 HN) 
(3 HN) 
(3 HN) 
(3 HN) 
(3 HN) 
(3 HN) 
T

SYNOPSIS

(defmethod map-over-sequenzes ((sc slippery-chicken) players function
                               &rest further-args)

slippery-chicken-edit/move-clef [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Move a specified clef from a specified event object to another.

 NB: As the :auto-clefs option of cmn-display and write-lp-data-for all
     first deletes all clefs before automatically placing them, this
     argument must be set to NIL. The auto-clefs method can be called
     outside of the cmn-display or write-lp-data-for-all methods instead.  

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the given clef is
   located.
 - An integer that is the number of the event object in the given bar to
   which the given clef is attached.
 - An integer that is the number of the bar to which the given clef is
   to be moved (this can be the same bar).
 - An integer that is the number of the event object in the new bar to
   which the given clef is to attached.
 - The ID of the player in whose part the clef is to be moved.

RETURN VALUE

 Returns the value of the MARKS-BEFORE slot of the event object to which the
 clef is moved.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (auto-clefs mini)
  (move-clef mini 1 6 1 8 'vc)
  (cmn-display mini :auto-clefs nil))

SYNOPSIS

(defmethod move-clef ((sc slippery-chicken) from-bar from-event
                      to-bar to-event player)

slippery-chicken-edit/move-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 20-Jul-2011 (Pula)

DESCRIPTION

 Move a specified sequence of consecutive event objects from one player to
 another, deleting the events from the source player.

 NB: Although partial bars can be moved from the source player, the entire
     bars of the target players are always overwritten, resulting in rests
     in those segments of the target players' bars that do not contain the
     moved material. This method thus best lends itself to moving into
     target players parts that have rests in the corresponding bars.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the source player.
 - The ID of the target player.
 - A number that is the first bar from which events are to be moved.
 - A number that is the first event within the start-bar that is to be
   moved. 
 - A number that is the last bar from which events are to be moved.
 - A number that is the last event within the end-bar that is to be
   moved. 

OPTIONAL ARGUMENTS

 keyword arguments:
 - :transposition. A positive or negative number that is the number of
   semitones by which the copied material is to be first transposed. This
   number can be a decimal number, in which case the resulting pitches will
   be rounded to the nearest microtone (if the current tuning environment is
   capable of microtones).
 - :consolidate-rests. T or NIL to indicate whether resulting consecutive
   rests should be consolidated each into one longer rest.
   T = consolidate. Default = T.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((bn (bassoon :midi-channel 1))
                     (vc (cello :midi-channel 2))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8))))
                            (2 ((((4 4) (w))))))
        :rthm-seq-map '((1 ((bn (1 1 1 1))
                            (vc (2 2 2 2))))))))
  (move-events mini 'bn 'vc 2 3 3 2)
  (move-events mini 'bn 'vc 4 1 4 2 :transposition 4.5))

  => T

SYNOPSIS

(defmethod move-events ((sc slippery-chicken) from-player to-player
                        start-bar start-event end-bar end-event
                        &key transposition (consolidate-rests t))

slippery-chicken-edit/move-rehearsal-letter [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 March 15th 2017, Edinburgh

DESCRIPTION

 Move a rehearsal letter for those players who have one at <from-bar> to
 <to-bar> 

ARGUMENTS

 - a slippery-chicken object
 - the bar number (integer) to move the letter from
 - the bar number (integer) to move the letter to

RETURN VALUE

 The last rehearsal-letter that was seen (in the lowest player in the
 ensemble) 

SYNOPSIS

(defmethod move-rehearsal-letter ((sc slippery-chicken) from-bar to-bar)

slippery-chicken-edit/note-add-bracket-offset [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 For CMN only: Adjust the position, lengths, and angles of the tuplet
 bracket attached to a specified event object. 

 NB: The bracket data is stored in the BRACKET slot of the first event
     object of a given tuplet figure.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the tuplet bracket is
   located. 
 - An integer that is the event to which the tuplet bracket is
   attached. Tuplet brackets are attached to the first event object of a
   given tuplet figure.
 - The ID of the player in whose part the tuplet bracket is located.

OPTIONAL ARGUMENTS

 keyword arguments:
 NB: At least one of these arguments must be set in order to create a
     change.  
 - :dx. A positive or negative decimal number to indicate the horizontal
   offset of the entire bracket.
 - :dy. A positive or negative decimal number to indicate the vertical
   offset of the entire bracket.
 - :dx0. A positive or negative decimal number to indicate the horizontal
   offset of the left corner of the bracket.
 - :dy0.A positive or negative decimal number to indicate the vertical
   offset of the left corner of the bracket.
 - :dx1. A positive or negative decimal number to indicate the horizontal
   offset of the right corner of the bracket.
 - :dy1. A positive or negative decimal number to indicate the vertical
   offset of the right corner of the bracket.
 - :index. An integer that indicates which bracket of a nested bracket on
   the same event is to be affected.  0 = outermost bracket, 1 = first nested
   bracket, etc. Default = 0.

RETURN VALUE

 Returns a list of the bracket start/end indicator and the tuplet value
 followed by the offset values passed to the keyword arguments.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((f3 g3 a3 b3))))
        :set-map '((1 (1)))
        :rthm-seq-palette '((1 ((((2 4) { 3 te te te } q ))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vc (1))))))))
  (note-add-bracket-offset mini 1 1 'vc 
                           :dx -.1 :dy -.3 
                           :dx0 -.1 :dy0 -.4 
                           :dx1 .3 :dy1 -.1))

=> (1 3 -0.1 -0.3 -0.1 -0.4 0.3 -0.1)

SYNOPSIS

(defmethod note-add-bracket-offset ((sc slippery-chicken)
                                    bar-num note-num player
                                    &key (dx nil) (dy nil) 
                                    (dx0 nil) (dy0 nil) 
                                    (dx1 nil) (dy1 nil) 
                                    (index 0))

slippery-chicken-edit/orchestrate [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 November 2nd 2018, Heidhausen

DESCRIPTION

 'Orchestrate' the chords and single pitches in an existing slippery-chicken
 object. This involves mapping the existing players' pitch events
 onto a group of new players (a 'combo'). The procedure is fairly
 complex and by no means perfect (in fact it may exit with an error,
 especially if your requirements are :strict (see below)), but it works
 like this:
 
 First, we assume that your existing music is more horizontal/harmonic than
 linear/melodic, particularly because the mapping process treats each 'chord'
 separately and potentially maps each chord onto different players---the
 choice of whether to change ensemble is decided by an activity-levels object
 by default (see :combo-change-fun below) but also by the number of notes in
 any given chord and whether it's possible to play any subsequent chord on
 the same instruments. The method also assumes that each 'player' in the
 existing slippery-chicken object has a sequence of one or more chords which
 can be separated into 'phrases' using the get-phrases method; that the new
 ensemble uses player IDs that don't exist in the original ensemble (though
 any player can use the same instruments, of course); and that using the
 player IDs from the new ensemble we provide lists of sublists of possible
 'combos' that should be used to play the existing chords. These combos
 should range from 2 players to however many we'll need to play the existing
 chords. We pass these combos to the method and/or allow them to be created
 by the 'lotsa-combos' ensemble method (see :combos below)

 Whether a chord is playable by a given combo is determined by the range of
 the chord and the instruments of any given combo, along with those
 instruments' abilities to play chords and/or microtones (if the chord is
 microtonal). When trying to determine whether a given combo can play a
 chord, we permutate the possible instrument orderings to see if the pitches
 are in range. If :artificial-harmonics is T we also try for such on notes
 normally considered too high for any given string instrument. If we can't
 find a combo for any given chord we'll keep track of the best match and if
 our :relax argument allows, use that instead of backing out completely.

 One of the complexities we face, after determining that a chord is playable
 by a particular combo, is whether the players are free (i.e. not already
 playing) at the time the chord needs to be played. We take ties into account
 of course, but one limitiation, presently, is that in order be deemed 'free'
 each instrument of the combo must have a complete bar free for the start and
 end of any given chord.

 As we select the current instrument using the instrument-change-map slot of
 the slippery-chicken object (which may have been changed after the original
 data was generated) this method works with players who double on two or more
 instruments.

ARGUMENTS

 - the slippery-chicken object whose existing players and event data will be
   used to orchestrate onto new players
 - a new ensemble, the players/instruments of which will be used for the new
   orchestration. (This shouldn't be a nested ensemble but that's a rarity.)
   This can either be an ensemble object or a list structure that can be made
   into one (as used for most calls to make-slippery-chicken).
 - a list of player IDs indicating the original music to be re-orchestrated.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :combos. A list of lists indicating the player groupings to be used to
   orchestrate the events. Default = NIL whereupon the <new-ensemble> will be
   used to generate groupings via the 'lotsa-combos' ensemble class method.
 - :add-more-combos. T or NIL to indicate whether the :combos slot should be
   expanded via the 'lotsa-combos' method. If T then whatever is passed to
   :combos will nevertheless be retained after the expansion. Default = NIL.
 - :start-bar. The bar number to start orchestrating. Default = NIL which
   will in turn default to 1
 - :end-bar. The bar number to stop orchestrating (inclusive). Default = NIL
   which will in turn default to the last bar of the slippery-chicken object.
 - :auto-beam. T or NIL to indicate whether to call auto-beam in the new
   parts. Default = T.
 - :chords. Whether individual instruments capable of playing chords should
   attempt to do so. This may determine whether a given combo is determined
   to be capable of playing one of the original slippery-chicken object's
   chords, and also whether under some circumstances some notes will be
   doubled across different instruments. Default = T.
 - :combo-change-fun. A function which should return T or NIL to indicate
   whether we should change combo on any given event. This should take two
   arguments (the combo as a list of player IDs and an assoc-list of all
   possible combos (as created by the organise-combos method using the
   <combos> argument given here) plus two further optional arguments which
   are free to define. The function should also provide "reset" functionality
   or do nothing if one of the two required arguments is NIL. Default =
   combo-change? (defined in event.lsp).
 - :verbose. T or NIL to turn on the printing of orchestration decisions as
   the algorithm is run.
 - :artificial-harmonics. T or NIL to allow the selection of string
   artificial harmonics in order to reach high notes outwith normal ranges.
 - :sticky-stats. T or NIL to indicate whether the statistics collected and
   returned by the method should be reset or retained between calls. Default
   = NIL = reset.
 - :relax. An integer between 0 and 3 inclusive to indicate how strict the
   algorithm should when allocating chord pitches to instruments. The values
   have the following meanings with degrees of relaxedness ascending:
   0: each pitch in the chord has to be playable by at least one instrument
   in the combo; no instrument can sit this chord out but instruments can
   play chords that include notes found in other instruments.
   1. instruments may sit out a chord if a chord-playing instrument can fill
   in the notes (all notes of chord must still be played)
   2. notes can be left out and instruments can sit out a chord
   3. whole chords can be left out

RETURN VALUE

 Five statistics values representing the number of chords where: 1. all
 pitches & every player used; 2. all pitches but some players tacit; 3. some
 pitches and instruments missing; 4. chords completely left out; 5. total
 chords attempted

SYNOPSIS

(let (successes)                        ; for stats
  (defmethod orchestrate ((sc slippery-chicken) new-ensemble original-players
                          &key
                            combos add-more-combos start-bar end-bar verbose
                            (artificial-harmonics t) (relax 0) (auto-clefs t)
                            (auto-beam t) (combo-change-fun #'combo-change?)
                            (chords t) sticky-stats)

slippery-chicken-edit/pause-last [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

AUTHOR

 Daniel Ross (mr.danielross@gmail.com)

DATE

 23 September 2016, London

DESCRIPTION

 Add a pause mark to the last note of every (any) player's part. It defaults
 to the last bar but this can be changed with the :bar-num keyword arg. You
 also have the option to change the bar line type in the same bar using the
 :bar-line keyword arg. See (change-bar-line-type) for details.

ARGUMENTS

 - the slippery chicken object

OPTIONAL ARGUMENTS

 keyword arguments:
 - :players. The player (symbol) or list of players that will be
   effected. Default = NIL = all players.
 - :bar-num. The bar number to add the pause mark. Default = last bar of
   piece. 
 - :bar-line. The bar line type of the bar we'll add a pause to (symbol). Can
   be one of 'normal 'double-bar 'final-double 'begin-repeat
   'begin-end-repeat or 'end-repeat. Default = NIL = no change.
 - :pause. The type of pause to add (symbol). Can be one of 'pause
   'long-pause or 'short-pause. Default = 'pause

RETURN VALUE

 - the number of pause marks added 

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((pno (piano :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q q))
                                :pitch-seq-palette ((1 (2))))))
        :rthm-seq-map '((1 ((pno (1 1 1 1 1 1 1 1))))))))
  (pause-last mini))

=> 1

SYNOPSIS

(defmethod pause-last ((sc slippery-chicken) 
                       &key
                         ;; MDE Tue Feb 26 09:07:43 2019 -- type of pause added
                         ;; can vary
                         (pause 'pause)
                         ;; MDE Sat Feb 23 12:52:15 2019 -- making players a key
                         ;; arg instead of required  
                         players
                         ;; we might want the pause mark somehere else
                         (bar-num (num-bars sc))
                         bar-line)

slippery-chicken-edit/process-events-by-time [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Apply the given function to all event objects within the given measure
 range in order of their chronological occurrence.  The function can take
 one argument only: the current event object.  NB If the time of the event
 is needed it can be accessed in the given function via the event's
 start-time slot.

ARGUMENTS

 - A slippery-chicken object.
 - A function (or variable to which a function has been assigned).

OPTIONAL ARGUMENTS

 keyword arguments:
 - :start-bar. An integer that is the first bar in which the function is to
   be applied to event objects. Default = 1.
 - :end-bar. NIL or an integer that is the last bar in which the function is
   to be applied to event objects. If NIL, the last bar of the
   slippery-chicken object is used. Default = NIL.  

RETURN VALUE

 T

EXAMPLE

(let ((marks (make-cscl '(a s as te ts at))))
  (defun add-random-marks (event)
    (unless (is-rest event) 
      (setf (marks event) (list (get-next marks))))))

(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))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((3 4) s (e.)  (s) s (e) (e) s (s)))
                                :pitch-seq-palette ((1 2 3))))
                            (2 ((((3 4) (s) s (e) (e) s (s) s (e.)))
                                :pitch-seq-palette ((1 2 3))))
                            (3 ((((3 4) (e) s (s) s (e.)  (s) s (e)))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 2 3))
                            (va (2 3 1))
                            (vc (3 1 2))))))))
  (process-events-by-time mini #'add-random-marks))

SYNOPSIS

(defmethod process-events-by-time ((sc slippery-chicken) function
                                   &key (start-bar 1) end-bar)

slippery-chicken-edit/re-bar [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Arrange the events of specified consecutive bars in a given
 slippery-chicken object into new bars of a different time signature. If the
 number of beats in the specified series of events does not fit evenly into
 full measures of the the specified time signature, the method will do its
 best to create occasional bars of a different time-signature that are as
 close as possible to the desired length.

 This method will only combine existing short bars into longer ones; it
 won't split up longer bars and recombine them.

 NB: This method should not be confused with the rebar method (which is used
 internally, not directly by the user).

 NB: as this reorganises fundamental structures within the slippery-chicken
 object, it may cause methods like clm-play to fail with some arguments
 which seem reasonable to the user. So use immediately before creating the
 score and after creating other outputs.

ARGUMENTS

 - A slippery-chicken object.

OPTIONAL ARGUMENTS

 keyword arguments
 - :start-bar. An integer that is the number of the first bar whose events
   are to be re-barred.
 - :end-bar. An integer that is the number of the last bar whose events are
   to be re-barred.
 - :min-time-sig. A time signature in the form of a 2-item list containing
   the number of beats and the beat unit; e.g. '(3 4). This is a target time
   signature from which the method may occasionally deviate if the number of
   events does not fit evenly into full bars of the specified time
   signature.
 - :verbose. T or NIL to indicate whether to print feedback on the
   re-barring process to the Listener. T = print feedback. Default = NIL.
 - :check-ties. T or NIL to indicate whether to force the method to ensure
   that all ties have a beginning and ending. T = check. 
   Default = T.
 - :auto-beam. T, NIL, or an integer. If T, the method will automatically
   attach beam indications to the corresponding events according to the beat
   unit of the time signature. If an integer, the method will beam in
   accordance with a beat unit that is equal to that integer. If NIL, the
   method will not automatically place beams. Default = T.
 - :update-slots. T or NIL to indicate whether to update all slots of the
   given slippery-chicken object after applying the method. This is an
   internal argument and will generally not be needed by the user.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1 1))))))))
  (re-bar mini :start-bar 2 :end-bar 5 :min-time-sig '(4 4) :auto-beam 4))

  => T

SYNOPSIS

(defmethod re-bar ((sc slippery-chicken)
                   &key start-bar 
                   end-bar
                   ;; the following is just a list like '(3 8) '(5 8)
                   min-time-sig
                   verbose
                   ;; MDE Thu Feb  9 10:36:02 2012 -- seems if we don't
                   ;; update-slots then the new bar structure isn't displayed 
                   (update-slots t)
                   (check-ties t)
                   ;; could also be a beat rhythmic unit
                   (auto-beam t))

slippery-chicken-edit/rehearsal-letters-at-sections [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 August 19th 2016, Edinburgh

DESCRIPTION

 Place a rehearsal letter at the beginning of every section (and subsection)
 in the piece. 

ARGUMENTS

 - a slippery chicken object

RETURN VALUE

 A list of the bar numbers where rehearsal letters will appear.

SYNOPSIS

(defmethod rehearsal-letters-at-sections ((sc slippery-chicken))

slippery-chicken-edit/remove-extraneous-dynamics [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 A post-generation editing method: If two or more consecutive event objects
 have the same dynamic, remove that dynamic marking from all but the first
 of these.

ARGUMENTS

 - A slippery-chicken object.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (f 1 f 2 f 3 f 4))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1 1))))))))
  (remove-extraneous-dynamics mini))

  => T

SYNOPSIS

(defmethod remove-extraneous-dynamics ((sc slippery-chicken))

slippery-chicken-edit/replace-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Replace one or more consecutive existing event objects with new event
 objects. All references are 1-based. This method can be applied to only one
 bar at a time.

 One or more new event objects can be specified as a replacement for one
 single original event object.

 It's the user's responsibility to make sure the bar is full and
 update-slots is called after all post-generation editing. 

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose part is to be modified.
 - An integer that is the number of the bar in which the change is to be
   made; or a reference to the bar in the format '(section sequence bar).
 - An integer that is the number of the first event object in the given bar
   to replace. 
 - An integer that is the total number of consecutive original event objects
   to replace.
 - A list of the new event objects, each in turn specified as a 2-item list
   in the format (pitch rhythm), e.g. '((c4 e)). Rests are indicated with
   NIL or 'r, e.g. (nil s) (r h). Chords are indicated by enclosing the
   pitches of the chord in a list, e.g. ((c4 e4) e).

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether to automatically re-beam the given bar after
   replacing the events. T = beam. Default = NIL.
 - A list of integers to indicate tuplet bracket placement, in the format
  '(tuplet-value start-event end-event). These numbers are 0-based and
  inclusive and count rests.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c2 e2 d4 e4 f4 g4 a4 f5))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (replace-events mini 'vn 1 2 1 '((nil s) ((ds5 fs5) s)) t)
  (replace-events mini 'vn 2 2 1 '((cs5 e)))
  (replace-events mini 'vn '(1 3 1) 3 1 '((df4 s)))
  (replace-events mini 'vn 4 1 1 '((ds4 te) (r te) (b3 te)) t '(3 0 2)))

=> T

SYNOPSIS

(defmethod replace-events ((sc slippery-chicken) player bar-num start-event
                           replace-num-events new-events
                           &optional (auto-beam nil) tuplet-brackets)

slippery-chicken-edit/replace-multi-bar-events [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Replace specified consecutive event objects across several bars. 

 The new rhythms provided must produce full bars for all bars specified;
 i.e., if only a quarter note is provided as the new event for a 2/4 bar,
 the method will not automatically fill up the remainder of the bar.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose part is to be modified.
 - An integer that is the number of the first bar in which event objects are
   to be replaced. This can be an absolute bar number or a list in the form
   '(section sequence bar); or with subsections then e.g. '((3 1) 4 2)).  
 - An integer that is the number of bars in which event objects will be
   replaced.
 - The list of new event objects. The new event objects can be passed as
   complete event objects; as a list of 2-item lists that are
   note-name/rhythm pairs, e.g: '((c4 q) (d4 e)); or as a list with two
   sub-lists, the first being just the sequence of rhythms and the second
   being just the sequence of pitches, e.g: '((q e ) (c4 d4)). For the
   latter, :interleaved must be set to NIL. (see :interleaved below). Pitch 
   data is the usual cs4 or (cs4 cd3) for chords, and NIL or 'r indicate a
   rest. NB: All pitches are sounding pitches; written pitches will be
   created for transposing instruments where necessary.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :interleaved. T or NIL to indicate whether the new event data is to be
   processed as a list of note-name/rhythm pairs (or existing event
   objects), or if it is to be processed as a list with two sub-lists, the
   first containing the sequence of rhythms and the second containing the
   sequence of pitches (see above). T = interleaved, i.e. already existing
   event objects or a list of note-name/rhythm pairs. NIL = separate lists
   for rhythms and pitches. Default = T.
   If this argument is T, the list of 2-element lists (note-name/rhythm
   pairs) is passed to make-events, but such a list can contain no ties. If
   the argument is set to NIL, the rhythm and pitch data is passed as two
   separate lists to make-events2 where + can be used to indicate ties.
 - :consolidate-rests. T or NIL to indicate whether shorter rests should
   automatically be consolidated into a single longer rest.  
   T = consolidate. Default = T. 
   NB: slippery chicken will always consolidate full bars of rest into
   measure-rests, regardless of the value of this argument.
 - :beat. NIL or an integer (rhythm symbol) that indicates which beat basis
   will be used when consolidating rests. If NIL, the beat of the time
   signature will be used (e.g. quarter in 4/4). Default = NIL.
 - :auto-beam. T or NIL to indicate whether to automatically beam the new
   events. T = automatically beam. Default = T.
 - :tuplet-bracket. NIL or an integer to indicate whether to automatically
   add tuplet (e.g. triplet/quintuplet) brackets to the new events where
   applicable. If this is an integer, all tuplets in the given bar will be
   given a tuplet bracket with that integer as the tuplet number. NB: This
   option does not allow for setting tuplets of different numbers for the
   same bar. To do that, set :tuplet-bracket to NIL and add the
   tuplet-brackets manually. NIL = place no brackets. Default = NIL.

RETURN VALUE

 The number of new events used to replace the old ones.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((d4 e4 f4 g4))))
        :set-map '((1 (1 1 1 1 1 1))
                   (2 (1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))))
                            (2 ((((2 4) e s s q)
                                 (s s e +e e))
                                :pitch-seq-palette ((1 2 3 4 3 2 4 1)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1))))
                        (2 ((vn (2 2 2 2 2 2))))))))
  (replace-multi-bar-events mini 'vn 2 3 
                            '((cs5 h) ((ds5 fs5) h) (nil h)))
  (replace-multi-bar-events mini 'vn '(2 2 2) '3 
                            '((h h h) (cs5 (ds5 fs5) nil))
                            :interleaved nil)
  (replace-multi-bar-events mini 'vn 1 1
                            '((nil e) (nil e) (nil e) (cs4 e))
                            :consolidate-rests t)
  (replace-multi-bar-events mini 'vn 8 1
                            '((nil q) (b3 e) (cs4 s) (ds4 s))
                            :auto-beam t))

=> 4

SYNOPSIS

(defmethod replace-multi-bar-events ((sc slippery-chicken)
                                     player start-bar num-bars new-events 
                                     &key
                                       ;; 24.3.11: see above.
                                       (interleaved t)
                                       ;; MDE Mon Apr 23 12:36:08 2012 --
                                       ;; changed default to nil
                                       (consolidate-rests nil)
                                       ;; for consolidate rests
                                       (beat nil)
                                       ;; MDE Mon Apr 23 12:36:08 2012 --
                                       ;; changed default to nil
                                       (auto-beam nil)
                                       ;; MDE Fri Aug 29 10:18:29 2014 
                                       (warn t)
                                       ;; MDE Mon Sep  1 16:41:02 2014 
                                       (delete-beams t)
                                       (delete-tuplets t)
                                       ;; MDE Sat Jan 17 17:52:07 2015 --
                                       ;; should we update the player slot of
                                       ;; each event? 
                                       (write-player nil)
                                       ;; 31.3.11: if this is t, then rthms > a
                                       ;; beat will case an error 
                                       (auto-beam-check-dur t)
                                       (tuplet-bracket nil))

slippery-chicken-edit/replace-tempo-map [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Replace the tempo data for a given slippery-chicken object with new
 specified tempo indications.

 Calls not only the setf method - which converts bar references like
 (section-num sequence-num bar-num) to numbers and makes a tempo-map object,
 but also updates all event objects to reflect new start times etc.

ARGUMENTS

 - A slippery-chicken object
 - A list that is the new tempo-map.

RETURN VALUE

 T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((pno (piano :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 f4 g4 a4 c5 d5 f5 g5 a5 c6))))
        :set-map '((1 (1 1 1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q q))
                                :pitch-seq-palette ((1 (2))))))
        :rthm-seq-map '((1 ((pno (1 1 1 1 1 1 1 1))))))))
  (replace-tempo-map mini '((1 (q 60 "Andante")) ((1 3 1) (e 80)))))

=> T

SYNOPSIS

(defmethod replace-tempo-map ((sc slippery-chicken) tm)

slippery-chicken-edit/respell-bars [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Look for enharmonically equivalent pitches in the same bar and try to unify
 their spelling. The method applies this process to every bar in the given
 slippery-chicken object.

 Also see rthm-seq-bar/respell-bar and slippery-chicken/respell-notes.

ARGUMENTS

 - A slippery-chicken object.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 df5 ef5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
  (respell-bars mini))

=> T

SYNOPSIS

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

slippery-chicken-edit/respell-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Pass through the entire given slippery-chicken object and change some of
 the pitch objects to their enharmonic equivalents to produce more sensible
 spellings of consecutive pitches in the score.

 An optional argument takes a list specifying which pitches to change in the
 same format found in the method enharmonic-spellings; i.e.
 '((player (bar note-num))). These notes are changed after the respelling
 routine has run.  

 NB: If a list of corrections is specified, the :respell-notes argument of
     any subsequent call to cmn-display or write-lp-data-for-all must be set
     NIL, otherwise the modified pitches may be overwritten.  Also, although
     this algorithm corrects tied notes when respelling, notes referenced in
     the corrections list will not be followed through to any subsequent
     ties.

ARGUMENTS

 - A slippery-chicken object.

OPTIONAL ARGUMENTS

 - A list of specific notes whose pitches are to be enharmonically flipped,
   in the format, e.g. '((vn (1 1) (1 4)) (vc (2 3) (3 3)))

RETURN VALUE

 Returns T.

EXAMPLE

;; An example using respell-notes for the whole slippery-chicken object.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 df5 ef5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
  (respell-notes mini))

;; An example specifying which pitches are to be enharmonically changed.
(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 df5 ef5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
  (respell-notes mini '((vn (1 1) (1 4))))
  (cmn-display mini :respell-notes nil))

=> T

SYNOPSIS

(defmethod respell-notes ((sc slippery-chicken) &optional corrections)

slippery-chicken-edit/respell-notes-for-player [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Pass through the pitches of a specified player's part and change some of
 the pitches to their enharmonic equivalents in order to produce more
 sensible spellings of consecutive notes.

 This is just a very simple attempt to better spell notes by comparing each
 note to the previous two and making it the same accidental type. It
 doesn't look further back or ahead as of yet. 

 If the optional argument is set to T, then look at the written notes
 instead of the sounding notes.

 NB: Since both the cmn-display and write-lp-data-for-all methods
     automatically call respell-notes for all players of an entire
     sc-object, their :respell-notes argument may need to be set to NIL for
     this method to produce the desired results.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose pitches are to be modified.

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether to change written pitches only or sounding
   pitches only. T = change written pitches only. Default = NIL.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                     (vn (violin :midi-channel 2))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((b3 cs4 b4 cs5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((cl (1 1 1 1 1))
                            (vn (1 1 1 1 1))))))))
  (respell-notes-for-player mini 'cl t)
  (cmn-display mini :respell-notes nil :in-c nil))

=> T

SYNOPSIS

(defmethod respell-notes-for-player ((sc slippery-chicken) player 
                                     &optional written)

slippery-chicken-edit/rest-to-note [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Change a specified event object from a rest into a note by supplying a
 pitch or chord (as objects or symbols). 

 Marks to be attached to the new note can be supplied as a symbol or a list
 as an optional argument.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the rest is to be
   changed to a note.
 - An integer that is the number of the rest in the given bar that is to be
   changed. This number counts rests only, not sounding notes or events.
 - The ID of the player whose part is to be changed.
 - A note-name symbol that is to be the pitch of the new note, or a list of
   note-name symbols that will make up a chord.

OPTIONAL ARGUMENTS

 - A mark or list of marks to be attached to the new note.

RETURN VALUE

 Returns the new event object created.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 fs4))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
  (rest-to-note mini 2 1 'vn 'gs5)
  (rest-to-note mini 3 1 'vn '(gs5 b5))
  (rest-to-note mini 4 1 'vn '(gs4 b4) 'ppp)
  (rest-to-note mini 5 1 'vn '(gs4 b4) '(fff pizz)))

=> 
EVENT: start-time: 9.000, end-time: 9.500, 
       duration-in-tempo: 0.500, 
       compound-duration-in-tempo: 0.500, 
       amplitude: 0.900 
       bar-num: 5, marks-before: NIL, 
       tempo-change: NIL 
       instrument-change: NIL 
       display-tempo: NIL, start-time-qtrs: 9.000, 
       midi-time-sig: NIL, midi-program-changes: NIL, 
       8va: 0
       pitch-or-chord: 
CHORD: auto-sort: T, marks: NIL, micro-tone: NIL
SCLIST: sclist-length: 2, bounds-alert: T, copy: T
LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
NAMED-OBJECT: id: NIL, tag: NIL, 
data: (
[...]

SYNOPSIS

(defmethod rest-to-note ((sc slippery-chicken) bar-num rest-num player new-note
                         &rest marks)

slippery-chicken-edit/rm-marks-from-note [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Remove one or more specific marks from the MARKS slot of a specified event
 object.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar from which the marks are to be
   removed. 
 - An integer that is the number of the note in that bar from which the
   marks are to be removed.
 - The ID of the player from whose part the marks are to be removed.

OPTIONAL ARGUMENTS

 - A specific mark or list of specific marks that are to be removed. If this
   argument is not specified, no marks will be removed.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 fs4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (a 2 s 2 fff 2 pizz 2))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (rm-marks-from-note mini 2 2 'vn 'pizz)
  (rm-marks-from-note mini 3 2 'vn '(pizz fff))
  (rm-marks-from-note mini 3 2 'vn))

=> T

SYNOPSIS

(defmethod rm-marks-from-note ((sc slippery-chicken) bar-num note-num
                               player &rest marks)

slippery-chicken-edit/rm-marks-from-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Remove only the specified marks from the MARKS slots of specified events in
 the parts of specified players. If the <players> argument is set to NIL,
 remove the mark or marks from all players.

ARGUMENTS

 - A slippery-chicken object.
 - An integer or a 2-item list of integers indicating the first bar and note
   from which to remove marks. If an integer, this is the bar number and the
   mark will be removed from all notes in the bar. If a 2-item list, this is
   a reference to the bar number and number of the first note in the bar
   from which to start removing marks, in the form e.g. '(3 1).
 - An integer or a 2-item list of integers indicating the last bar and note
   from which to remove marks. If an integer, this is the bar number and the
   mark will be removed from all notes in the bar. If this is a 2-item list,
   this is a reference to the bar number and number of the first note in the
   bar from which to start removing marks, in the form e.g. '(3 1).
 - The ID or a list of IDs of the players from whose parts the marks are to
   be removed.

OPTIONAL ARGUMENTS

 NB: The <marks> argument is a required argument for this method.
 - The mark or a list of the marks to remove. This method will only remove
   specified marks.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((fl (flute :midi-channel 1))
                     (hn (french-horn :midi-channel 2))
                     (vn (violin :midi-channel 3))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((cs4 ds4 fs4))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (a 2 s 2 fff 2))))
        :rthm-seq-map '((1 ((fl (1 1 1 1 1))
                            (hn (1 1 1 1 1))
                            (vn (1 1 1 1 1))))))))
  (rm-marks-from-notes mini 1 2 'fl 'fff)
  (rm-marks-from-notes mini '(1 2) '(2 1) 'hn '(fff a))
  (rm-marks-from-notes mini 3 '(4 3) '(hn vn) '(fff s a))
  (rm-marks-from-notes mini 5 5 nil 'fff))

=> T

SYNOPSIS

(defmethod rm-marks-from-notes ((sc slippery-chicken) start end
                                    players &rest marks)

slippery-chicken-edit/rm-pitches-from-chord [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Remove the specified pitches from an existing chord object.

ARGUMENTS

 - The slippery-chicken object which contains the given chord object.
 - The ID of the player whose part is to be affected.
 - An integer that is the number of the bar that contains the chord object
   that is to be modified.
 - An integer that is the number of the note that is the chord object to be
   modified. 
 - The pitches to be removed. These can be pitch objects or any data that
   can be passed to make-pitch, or indeed lists of these, as they will be
   flattened.

RETURN VALUE

 The chord object that has been changed.

EXAMPLE

(let* ((ip-clone (clone +slippery-chicken-standard-instrument-palette+)))
  (set-slot 'chord-function 'chord-fun2 'guitar ip-clone)
  (let* ((mini
          (make-slippery-chicken
           '+mini+
           :instrument-palette ip-clone
           :ensemble '(((gtr (guitar :midi-channel 1))))
           :set-palette '((1 ((e3 f3 g3 a3 b3 c4 d4 e4 f4 g4 a4 b4 c5 d5 e5 f5
                                  g5 a5 b5 c6 d6 e6))))
           :set-map '((1 (1)))
           :rthm-seq-palette 
           '((1 ((((4 4) e e e e e e e e))
                 :pitch-seq-palette ((1 (2) 3 (4) 5 (6) 7 (8))))))
           :rthm-seq-map '((1 ((gtr (1))))))))
    (print (get-pitch-symbols 
            (pitch-or-chord (get-event mini 1 2 'gtr))))
    (rm-pitches-from-chord mini 'gtr 1 2 'a3 'd4)
    (print (get-pitch-symbols 
            (pitch-or-chord (get-event mini 1 2 'gtr))))))

=>
(E3 A3 D4 G4) 
(E3 G4)

SYNOPSIS

(defmethod rm-pitches-from-chord ((sc slippery-chicken) player bar-num
                                  note-num &rest pitches)

slippery-chicken-edit/rm-repeated-pitches [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 April 23rd 2016, Edinburgh

DESCRIPTION

 Sometimes, even pitch curves without repeated notes result in repeated
 notes in the generated piece. Often it's the removal of large fast leaps in
 instrumental parts that ends up creating repeated notes. This method will
 do its best to replace repeated notes, even in chords, with other notes
 from the current set and within the range of the current instrument and any
 set-limits. If a chord is required, then the current instrument's chord
 function will be used to create the replacement chord.

 NB If you're interested in instrument/players statistics like tessitura
 you'll have to call update-slots after you're done calling this and related
 methods.

ARGUMENTS

 - the slippery-chicken object
 - the player (symbol)

OPTIONAL ARGUMENTS

 - the start bar (integer). Default = 1.
 - the end bar (integer). Default = NIL which means we'll process up to the
   end of the piece.

RETURN VALUE

 The slippery-chicken object with all possible repeated notes removed.

SYNOPSIS

(defmethod rm-repeated-pitches ((sc slippery-chicken) player
                                &optional (start-bar 1) end-bar)

slippery-chicken-edit/rm-slurs [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Remove the specified slurs from the MARKS slots of specified events in
 the parts of specified players. If the <players> argument is set to NIL,
 remove the specified slurs from all players.

ARGUMENTS

 - A slippery-chicken object.
 - An integer or a 2-item list of integers indicating the first bar and note
   from which to remove slurs. If an integer, this is the bar number and the
   slurs will be removed from all notes in the bar. If a 2-item list, this is
   a reference to the bar number and number of the first note in the bar
   from which to start removing slurs, in the form e.g. '(3 1).
 - An integer or a 2-item list of integers indicating the last bar and note
   from which to remove slurs. If an integer, this is the bar number and the
   slurs will be removed from all notes in the bar. If this is a 2-item list,
   this is a reference to the bar number and number of the first note in the
   bar from which to start removing slurs, in the form e.g. '(3 1).
 - The ID or a list of IDs of the players from whose parts the marks are to
   be removed.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((fl (flute :midi-channel 1))
                     (hn (french-horn :midi-channel 2))
                     (vn (violin :midi-channel 3))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((c4 d4 e4 fs4 gs4 as4 c5 d5))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8))
                                :marks (slur 1 2 slur 3 4 slur 5 6 slur 7 8))))
        :rthm-seq-map '((1 ((fl (1 1 1 1 1))
                            (hn (1 1 1 1 1))
                            (vn (1 1 1 1 1))))))))
  (rm-slurs mini 1 2 'fl)
  (rm-slurs mini '(1 3) '(2 1) 'hn)
  (rm-slurs mini 3 '(4 3) '(hn vn))
  (rm-slurs mini 5 5 nil))

=> T

SYNOPSIS

(defmethod rm-slurs ((sc slippery-chicken) start end players)

slippery-chicken-edit/round-to-nearest [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 October 18th 2018, Heidhausen

DESCRIPTION

 For the given bars and players, round the events' pitch data to the nearest
 in the current or given scale. For example, a slippery-chicken object could
 be generated in the :quarter-tone scale, then the scale changed to
 :chromatic (or the keyword argument :scale 'chromatic-scale given), this
 method then called, and all pitches would be rounded to the nearest
 chromatic pitch. See the pitch class method for more details.

ARGUMENTS

 the slippery-chicken argument

OPTIONAL ARGUMENTS

 keyword arguments:
 - :start-bar. A number that is the first bar which should be
   processed. Default = NIL in which case 1 will be used.
 - :end-bar. A number that is the last bar which should be processed. Default
   = NIL in which case all bars will be processed.
 - :players. A list of the IDs of the players to whose parts the function
   should be applied. Can also be a single symbol. If NIL then all players
   will be processed.  
 - :scale. The scale to use when rounding. (Common Music tuning object or
   symbol). If a symbol, then 'chromatic-scale, 'twelfth-tone, or
   'quarter-tone only at present. Default is the current scale as set by
   (in-scale :...). 

RETURN VALUE

 the modified slippery-chicken object

SYNOPSIS

(defmethod round-to-nearest ((sc slippery-chicken)
                             &key start-bar end-bar players (scale cm::*scale*))

slippery-chicken-edit/sc-delete-beams [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete beam indications from specified notes. If only a bar number is
 specified, this method deletes all beams in the bar.

 NB: If specifying start and end notes, the start notes specified must be
     the first note of a beamed group of notes (i.e. the BEAMS slot of the
     corresponding event object must be 1), and the end note must be the
     last note of a beamed group of notes (i.e., the BEAMS slot of the
     corresponding event object must be 0), otherwise errors may
     occur. Also, if specifying one of these arguments, both must be
     specified. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the beams are to be
   deleted.
 - The ID of the player from whose part the beams are to be deleted.

OPTIONAL ARGUMENTS

 - An integer that is the number of the note that currently holds the
   start-beam information (i.e., the BEAMS slot is 1). This number is
   1-based and counts ties.
 - An integer that is the number of the note that currently holds the
   end-beam information (i.e., the BEAMS slot is 0). This number is 1-based
   and counts ties.

RETURN VALUE

 If deleting all beams in a bar, returns T, otherwise returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) - e e - - e e - - e e - - e e -))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 8)))))
        :rthm-seq-map '((1 ((vc (1 1 1 1))))))))
  (sc-delete-beams mini 2 'vc)
  (sc-delete-beams mini 3 'vc 3 4))

  => NIL

SYNOPSIS

(defmethod sc-delete-beams ((sc slippery-chicken) bar-num player
                            &optional start-note end-note)

slippery-chicken-edit/sc-delete-marks [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete all marks from the MARKS slot of a given note event object and
 set the slot to NIL.

 NB: This method counts notes, not rests, and is 1-based.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the marks are to be
   deleted. 
 - An integer that is the number of the note from which the marks are to be
   deleted.
 - The ID of the player from whose part the marks are to be deleted.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((cs4 ds4 fs4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q (e) s s))
                                :pitch-seq-palette ((1 2 3))
                                :marks (a 2 s 2 fff 2 pizz 2))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (sc-delete-marks mini 2 2 'vn))

=> T

SYNOPSIS

(defmethod sc-delete-marks ((sc slippery-chicken) bar-num note-num player)

slippery-chicken-edit/sc-delete-marks-before [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Deletes all data from the MARKS-BEFORE slot of a specified event object and
 replaces it with NIL.

 NB: In addition to clef symbol data, the MARKS-BEFORE slot also stores part
     of the required data for trills and arrows. Deleting just the
     MARKS-BEFORE components of those markings may result in unwanted
     results. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the event object is to
   be  modified. 
 - An integer that is the number of the note within the given bar for which
   the MARKS-BEFORE slot is to be set to NIL.
 - The ID of the player whose part is to be affected.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (add-mark-before-note mini 2 3 'vc 'fff)
  (add-mark-before-note mini 2 3 'vc 's)
  (add-mark-before-note mini 2 3 'vc 'lhp)
  (sc-delete-marks-before mini 2 3 'vc))

=> NIL

SYNOPSIS

(defmethod sc-delete-marks-before ((sc slippery-chicken)
                                         bar-num note-num player)

slippery-chicken-edit/sc-delete-marks-from-event [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Delete all data from the MARKS slot of the specified event object and
 replace it with NIL.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar from which the marks are to be
   deleted.
 - An integer that is the number of the event within the given bar from
   which the marks are to be deleted.
 - The ID of the player from whose part the marks are to be deleted.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :tempo-map '((1 (q 60)))
        :set-palette '((1 ((d3 e3 f3 g3 a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (a 1 4 lhp 4 s 3 4 slur 1 2))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (sc-delete-marks-from-event mini 2 4 'vc))

=> NIL

SYNOPSIS

(defmethod sc-delete-marks-from-event ((sc slippery-chicken)
                                           bar-num event-num player)

slippery-chicken-edit/sc-force-rest [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 23-Jul-2011 (Pula)

DESCRIPTION

 Change the specified event object to a rest.  If events tied from this
 event should automatically be forced to rests also, use the sc-force-rest2
 method instead.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the rest is to be
   forced.
 - An integer that is the number of the event within that bar which is to be
   changed into a rest. This number is 1-based and counts tied notes but not
   rests. 
 - The ID of the player whose part is to be modified.

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether the specified bar should be automatically
   beamed after the change has been made. NB: In general, calling auto-beam
   is a good idea (esp. when deleting notes under an existing beam);
   however, auto-beam may fail when addressing bars that contain notes
   longer than one beat. T = automatically beam. Default = NIL.

RETURN VALUE

 The new rthm-seq-bar object.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :set-palette '((1 ((a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (sc-force-rest mini 2 3 'vc)
  (sc-force-rest mini 3 3 'vc t))

  =>

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

SYNOPSIS

(defmethod sc-force-rest ((sc slippery-chicken) bar-num note-num player
                          &optional auto-beam)

slippery-chicken-edit/sc-force-rest2 [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Turn events into rests, doing the same with any following tied events.  
 NB As it is foreseen that this method may be called many times iteratively,
 there is no call to check-ties, auto-beam, consolidate-rests, or
 update-instrument-slots (for statistics)--it is advised that these methods
 are called once the last call to this method has been made.  gen-stats is
 however called for each affected bar, so the number of rests vs. notes
 should be consistent with the new data.

 NB This fill trigger an error if attempted with grace-notes

ARGUMENTS

 - A slippery-chicken object
 - The bar number (integer)
 - The event number in the bar (integer, counting from 1)
 - The player name (symbol)

OPTIONAL ARGUMENTS

 - A function object to be called on error (could be #'error (default),
  #'warn, #'print or simply NIL for no error)

RETURN VALUE

 The number of events turned into rests.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :set-palette '((1 ((a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette 
        '((1 ((((4 4) - e.. 32 - h.) (+w) (+w) ((w)) ((h) (e) q e)
               (+q - +s e. - +h) (+w) (+w) ((w))))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (sc-force-rest2 mini 1 3 'vc))
=> 3

SYNOPSIS

(defmethod sc-force-rest2 ((sc slippery-chicken) bar-num event-num player
                           &optional (on-error #'error))

slippery-chicken-edit/sc-move-dynamic [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Move the dynamic attached to a specified event object to another specified
 event object.

 By default the dynamics are moved between events within the same bar. An
 optional argument allows for dynamics to be moved to events in a different
 bar. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which to move the dynamic.
 - The ID of the player in whose part the dynamic is located.
 - An integer that is the number of the event object from which the dynamic
   is to be moved. This number is 1-based and counts both rests and ties.
 - An integer that is the number of the event object to which the dynamic
   is to be moved. This number is 1-based and counts both rests and ties.

OPTIONAL ARGUMENTS

 - An integer that is the number of the bar to which the dynamic should be
   moved. If this is not specified, the dynamic will be moved to the
   specified event within the same bar.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :set-palette '((1 ((a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (fff 1))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (sc-move-dynamic mini 1 'vc 1 3)
  (sc-move-dynamic mini 2 'vc 1 4 3))

  => T

SYNOPSIS

(defmethod sc-move-dynamic ((sc slippery-chicken) bar-num player
                            ;; event numbers 1-based but counting rests and ties
                            from to &optional to-bar)

slippery-chicken-edit/sc-remove-dynamic [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Remove all dynamics from the MARKS slot of one or more specified event
 objects. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar from which the dynamics are to
   be removed. 
 - The ID of the player from whose part the dynamics are to be removed. 
 - An integer or a list of integers that are the numbers of the events from
   which the dynamics are to be removed. Event numbers include ties and
   rests. 

RETURN VALUE

 Returns the last dynamic removed.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vc (cello :midi-channel 1))))
        :set-palette '((1 ((a3 b3 c4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (fff 1 ppp 3))))
        :rthm-seq-map '((1 ((vc (1 1 1))))))))
  (sc-remove-dynamic mini 2 'vc 1)
  (sc-remove-dynamic mini 3 'vc '(1 3)))

  => PPP

SYNOPSIS

(defmethod sc-remove-dynamic ((sc slippery-chicken) bar-num player
                              &rest event-nums)

slippery-chicken-edit/sc-remove-dynamics [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 16-Mar-2011

DESCRIPTION

 Remove all dynamic marks from the MARKS slots of all consecutive event
 objects (or just rests, if preferred) within a specified region of bars. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer or a list of two integers. If a single integer, this is the
   number of the first bar from which the dynamics will be removed, and all
   dynamics will be removed from the full bar. If this is a list of two
   integers, they are the numbers of the first bar and first note within
   that bar from which the dynamics will be removed, in the form '(bar-num
   note-num). Note numbers are 1-based and count ties but not rests.
 - An integer or a list of two integers. If a single integer, this is the
   number of the last bar from which the dynamics will be removed, and all
   dynamics will be removed from the full bar. If this is a list of two
   integers, they are the numbers of the last bar and last note within that
   bar from which the dynamics will be removed, in the form '(bar-num
   note-num). Note numbers are 1-based and count ties but not rests.
 - A single ID or a list of IDs of the players from whose parts the dynamics
   are to be removed. If NIL then all players will be processed. Default =
   NIL = all players.

OPTIONAL ARGUMENTS

 - T or NIL to indicate that dynamics should be removed only from
   rests. Default = NIL.

RETURN VALUE

 Returns T.

EXAMPLE

(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 ((d3 e3 f3 g3 a3 b3 c4 e4 f4 g4 a4 b4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4))
                                :marks (fff 1 ppp 3))))
        :rthm-seq-map '((1 ((vn (1 1 1))
                            (va (1 1 1))
                            (vc (1 1 1))))))))
  (sc-remove-dynamics mini '(1 2) '(2 2) 'vn)
  (sc-remove-dynamics mini 2 3 '(va vc)))

  => T

SYNOPSIS

(defmethod sc-remove-dynamics ((sc slippery-chicken) start end players
                               &optional just-rests)

slippery-chicken-edit/set-cautionary-accidental [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 28-Sep-2011

DESCRIPTION

 A post-generation editing method: Place a cautionary accidental
 (sharp/flat/natural sign in parentheses) before a specified note. 

 NB: Adding cautionary accidentals to pitches within chords is currently
     only possible in LilyPond output. Adding cautionary accidentals to
     single pitches is possible in both CMN and LilyPond.

 NB: Since the cmn-display and write-lp-data-for-all methods call
     respell-notes by default, that option must be explicitly set to NIL
     within the calls to those methods in order for this method to be
     effective. 

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which to add the cautionary
   accidental. 
 - An integer or a 2-item list of integers that is the number of the note
   within that bar to which to add the cautionary accidental. This number is
   1-based and counts ties. If a 2-item list such, this indicates that the
   pitch is within a chord; e.g., '(1 2) indicates that a cautionary
   accidental should be added to the 2nd pitch up from the bottom of the
   chord located at the 1st note position in the bar.
 - The ID of the player to whose part the cautionary accidental is to be
   added. 

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether to add the cautionary accidental to only the
   written pitch or only the sounding pitch. T = written only.
   Default = NIL.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                     (pn (piano :midi-channel 2))))
        :set-palette '((1 ((ds3 e3 fs3 af3 bf3 c4 ef4 fs4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 (3) 4))
                                :marks (fff 1 ppp 3))))
        :rthm-seq-map '((1 ((cl (1 1 1))
                            (pn (1 1 1))))))))
  (respell-notes mini)
  (set-cautionary-accidental mini 3 2 'cl t)
  (set-cautionary-accidental mini 2 1 'pn)
  (set-cautionary-accidental mini 2 2 'pn)
  (set-cautionary-accidental mini 3 '(3 3) 'pn)
  (write-lp-data-for-all mini :respell-notes nil))

=> T

SYNOPSIS

(defmethod set-cautionary-accidental ((sc slippery-chicken) bar-num note-num
                                      player &optional written)

slippery-chicken-edit/set-limits-by-section [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 February 20th 2018, Heidhausen

DESCRIPTION

 For each section/subsection of a piece, set the highest or lowest pitch,
 i.e. create the curve for one player in the set-limits-high or
 set-limits-low slot

ARGUMENTS

 - the slippery-chicken object
 - the pitches: a list of pitch symbols or MIDI note numbers. Note that these
   will be used cyclically if there aren't enough pitches for the number of
   sections/subsections in the piece.
 - 'set-limits-high or 'set-limits-low to set the desired curve

OPTIONAL ARGUMENTS

 - which player (symbol) to set the curve for. Default = 'all, which means
   the curve will apply to all players.

RETURN VALUE

 The curve created (list)

SYNOPSIS

(defmethod set-limits-by-section ((sc slippery-chicken) pitches which
                                  &optional (player 'all))

slippery-chicken-edit/set-midi-channels [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 October 25th 2018, Heidhausen

DESCRIPTION

 Change the midi-channels of events in the slippery-chicken object. All
 events' pitch objects' midi-channel slots will be destructively overwritten
 when using this method.

 The second argument is a list of lists. Each sublist has the player (not
 instrument) ID symbol as its first element, followed by one or two channel
 numbers. If only one channel is given (i.e. it's a two-element list
 e.g. (vln 1)) then it will be used for both chromatic and microtonal pitches
 (i.e. all the players' pitches will be written to the one given midi
 channel). Otherwise if a second channel is given (e.g. (vln 1 2)) then
 microtonal pitches will be written on the second channel.

ARGUMENTS

 - the slippery-chicken object.
 - a list of player and channel info (see above and example below).

OPTIONAL ARGUMENTS

 - the start-bar in which events should begin to be processed. Default = 1
 - the end bar (inclusive) in which the last events should be
   processed. Default = NIL = the last bar of the slippery-chicken object. 

RETURN VALUE

 T

EXAMPLE

(set-midi-channels +sc-obj+ '((solo 1) (computer-a 2) (computer-b 3)
                              ;; this one uses separate midi channels for
                              ;; chromatic and microtonal pitches
                              (computer-c 4 5)))

SYNOPSIS

(defmethod set-midi-channels ((sc slippery-chicken) channel-info
                              &optional (start-bar 1) end-bar)

slippery-chicken-edit/set-rehearsal-letter [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add the specified rehearsal letter/number to the specified bar in one or
 more specified players.
 
 NB: Since internally this method actually attaches the rehearsal
     letter/number to the REHEARSAL-LETTER slot of the preceding bar
     (bar-num - 1), no rehearsal letter/number can be attached to the first
     bar.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar to which the rehearsal
   letter/number is to be added.  
 - A symbol that is the rehearsal letter/number to be added (e.g. 'A or '1)

OPTIONAL ARGUMENTS

 - The player ID or a list of player IDs to whose parts the rehearsal
   letter/number is to be added. If no value is given here, the rehearsal
   letter/number will be added to the first (top) instrument in each group
   of the ensemble, as specified in staff-groupings.

RETURN VALUE

 Returns T.

EXAMPLE

(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 ((ds3 e3 fs3 af3 bf3 c4 ef4 fs4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q e s s))
                                :pitch-seq-palette ((1 2 3 4)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))
                            (va (1 1 1 1))
                            (vc (1 1 1 1))))))))
  (set-rehearsal-letter mini 2 'A)
  (set-rehearsal-letter mini 3 '2 '(va vc))
  (set-rehearsal-letter mini 4 'Z3))

  => T

SYNOPSIS

(defmethod set-rehearsal-letter ((sc slippery-chicken) bar-num letter
                                 &optional players)

slippery-chicken-edit/swap-marks [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

AUTHOR

 Daniel Ross (mr.danielross[at]gmail[dot]com) 

DATE

 Thu 22 Aug 2019 17:12:27 BST

DESCRIPTION

 Replace one dynamic mark with another, or a list of marks with another
 list.

ARGUMENTS

 - the slippery chicken object which contains marks to be swapped
 - start-bar: the first bar to start swapping
 - end-bar: the last bar to end swapping
 - players: the player or players
 - old-marks: a single mark or a list of marks
 - new-marks: a single mark to a list. NB if a list it must be the same
 length as the old-marks list. Maybe I should change this?

OPTIONAL ARGUMENTS

 nil

RETURN VALUE

 The number of swapped marks

EXAMPLE

(let* ((mini (make-slippery-chicken  
               '+mini+ 
               :ensemble '(((flt (flute :midi-channel 1))))
               :staff-groupings '(1)
               :tempo-map '((1 (q 60)))
               :set-palette '((set1 ((fs2 b2 d4 a4 d5 e5 a5 d6))) 
                              (set2 ((b2 fs3 d4 e4 a4 d5 e5 a5 d6))))
               :set-map '((1 (set1 set1 set2 set1 set1 set2)))
               :rthm-seq-palette
               '((seq1 ((((4 4) (q) (q) q q))   
                        :pitch-seq-palette (1 2)
                        :marks (pp 1)))  
                 (seq2 ((((4 4) (e) e q h)) 
                        :pitch-seq-palette (1 2 3)
                        :marks (p 1 a 1 s 1))))
               :rthm-seq-map '((1 ((flt (seq1 seq1 seq2 seq1 seq1 seq2))))))))
   (print (has-mark (get-note mini 1 1 'flt) 'fff))
   (print (swap-marks mini nil nil nil 'pp 'fff))
   (has-mark (get-note mini 1 1 'flt) 'fff))

NIL
4
=> (FFF)

SYNOPSIS

(defmethod swap-marks ((sc slippery-chicken) start-bar end-bar
                       players old-marks new-marks)

slippery-chicken-edit/thin [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DATE

 19th September 2018, Heidhausen

DESCRIPTION

 Thin out events in a slippery-chicken object using an activity curve. This
 turns existing notes into rests. As this is an expensive method but may be
 called more than once, it is up to the user to call consolidate-rests and/or
 update-slots when ready.

ARGUMENTS

 - the (fully-initialised) slippery-chicken object

OPTIONAL ARGUMENTS

 keyword arguments
 - :start-bar. The bar to start at. Default = NIL = 1
 - :end-bar. The bar to end at. Default = NIL = last bar in piece/object
 - :players. A symbol or list of symbols for the players to be processed.
 - :curve. A list of breakpoints representing the level of activity. Y-values
   should range over 0 (all events forced to rests) to 10 (no rests
   created). X-values may range over any arbitrary scale but NB that this
   will be rescaled to map over the number of bars in the whole piece,
   despite the start-bar/end-bar arguments. However this rescaling can be
   avoided via the next argument. Default = '(0 1 100 10)
 :rescale-curve. Whether to process the x-values of :curve to range over the
 number of bars in the piece. Default = T = rescale.

RETURN VALUE

 - the processed slippery-chicken object

SYNOPSIS

(defmethod thin ((sc slippery-chicken) &key start-bar end-bar players
                                         (curve '(0 1 100 10))
                                         (rescale-curve t))

slippery-chicken-edit/tie [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Add a tie to a specified event object. The new tie will be placed starting
 from the specified event object and spanning to the next event object. If
 the next event object does not have the same pitch, its pitch will be
 changed to that of the first event object.

 An optional argument allows the user to adjust the steepness of the tie's
 curvature. 

 NB: This method will not automatically update ties in MIDI output. To make
     sure that MIDI ties are also updated, use the handle-ties method.

 NB: If the next event object is a rest and not a note, an error will be
     produced.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the tie is to be
   placed. 
 - An integer that is the number of the note to which the tie is to be
   attached. 
 - The ID of the player whose part is to be changed.

OPTIONAL ARGUMENTS

 - A positive or negative decimal number to indicate the steepness of the
   tie's curvature.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((c4 d4 e4))))
        :set-map '((1 (1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q s s (s) s))
                                :pitch-seq-palette ((1 1 2 3)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1))))))))
  (tie mini 2 1 'vn)
  (tie mini 3 2 'vn)
  (tie mini 4 2 'vn -.5))

=> T

SYNOPSIS

(defmethod tie ((sc slippery-chicken) bar-num note-num player 
                &optional curvature)

slippery-chicken-edit/tie-all-last-notes-over-rests [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Extend the duration of the last note of any bar that precedes a bar which
 starts with a rest in the specified region, such that the rest that begins
 the next measure is changed to a note and the last note of the first
 measure is tied to it.

 NB: This method will not automatically update ties in MIDI output. To make
     sure that MIDI ties are also updated, use the handle-ties method.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the first bar in which changes are to be made.
 - An integer that is the last bar in which changes are to be made.
 - A player ID or list of player IDs.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :to-next-attack. T or NIL to indicate whether ties are to extend over
   only full bars of rest or also over partial bars (until the next attacked
   note). T = until the next attacked note. Default = T.
 - :tie-next-attack. T or NIL to indicate whether the new tied notes created 
   should also be further extended over the next attacked note if that note
   has the same pitch as the starting note of the tie. T = also tie next
   attacked note if same pitch. Default = NIL.
 - :auto-beam. T or NIL to indicate whether the new events should be
   automatically beamed after placement. T = automatically beam. 
   Default = NIL.
 - :last-rhythm. NIL or a rhythmic duration. If a rhythmic duration, the
   last duration of the tie will be forced to this length. Useful, for
   example, when tying into a rest bar without filling that whole
   bar. NIL = fill the bar with a tied note. Default = NIL.
 - :update. T or NIL to indicate whether all slots for all events in the
   piece should be updated. This is an expensive operation so set to NIL if
   you plan on calling other similar methds, and call (update-slots sc)
   explicitly at the end. Default = T.

RETURN VALUE

 Returns NIL.

EXAMPLE

(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 f4 g4 a4 c5 d5 f5))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((4 4) e (e) e e (e) (e) e e) 
                                 ((w)) 
                                 ((h.) q) 
                                 ((w))
                                 ((w)) 
                                 ((e) e h.))
                                :pitch-seq-palette ((1 2 3 4 5 6 7 7)))))
        :rthm-seq-map '((1 ((vn (1 1 1))
                            (va (1 1 1))
                            (vc (1 1 1))))))))
  (tie-all-last-notes-over-rests mini 2 6 'vn)
  (tie-all-last-notes-over-rests mini 9 12 'vn :auto-beam t)
  (tie-all-last-notes-over-rests mini 3 5 '(va vc) :to-next-attack nil)
  (tie-all-last-notes-over-rests mini 9 12 'vc :tie-next-attack t)
  (tie-all-last-notes-over-rests mini 13 15 'vn :last-rhythm 'e))


=> NIL

SYNOPSIS

(defmethod tie-all-last-notes-over-rests
    ((sc slippery-chicken)
     start-bar end-bar players
     &key
       ;; use up all rests until next attack or (if nil) 
       ;; just the rest bars? 
       (to-next-attack t)
       ;; if the next attack is the same note/chord as
       ;; the previous, tie to it too? 
       (tie-next-attack nil)
       (last-rhythm nil)
       (update t)
       (auto-beam nil))

slippery-chicken-edit/tie-over-all-rests [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Extend the durations of all notes that immediately precede rests in the
 specified region by changing the rests to notes and tying the previous notes
 to them.

 NB: This method will not automatically update ties in MIDI output. To make
     sure that MIDI ties are also updated, use the handle-ties method.

ARGUMENTS

 - A slippery-chicken object.
 - The ID of the player whose part is to be changed, or a list of players or
   NIL to indicate that we should process all players 
 - An integer that is the number of the first bar in which notes are to be
   tied over rests.
 - An integer that is the number of the last bar in which notes are to be
   tied over rests. NB: This argument does not necessarily indicate the bar
   in which the ties will stop, but rather the last bar in which a tie will
   be begun; the ties created may extend into the next bar.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :start-note. An integer that is the number of the first attacked note
   (not counting rests) in the given start-bar for which ties can be placed.
 - :end-note. An integer that is the number of the last attacked note (not
   counting rests) in the given end-bar for which ties can be placed. 
   NB: This argument does not necessarily indicate the note on which the
   ties will stop, but rather the last not on which a tie can begin; the
   ties created may extend to the next note.
 - :auto-beam. T or NIL to indicate whether the method should automatically
   place beams for the notes of the affected measure after the ties over
   rests have been created. T = automatically beam. Default = NIL.
 - :consolidate-notes. T or NIL to indicate whether the tied note are to be
   consolidated into single rhythmic units of longer durations after the
   ties over rests have been created. T = consolidate notes. Default = NIL. 
 - :update. T or NIL to indicate whether all slots for all events in the
   piece should be updated. This is an expensive operation so set to NIL if
   you plan on calling other similar methds, and call (update-slots sc)
   explicitly at the end. Default = T.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((c4 d4 e4))))
        :set-map '((1 (1 1 1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) (q) e (s) s))
                                :pitch-seq-palette ((1 2)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1 1 1))))))))
  (tie-over-all-rests mini 'vn 2 3 :start-note 2 :auto-beam t)
  (tie-over-all-rests mini 'vn 5 6 :end-note 1 :consolidate-notes t))

  => T

SYNOPSIS

(defmethod tie-over-all-rests ((sc slippery-chicken) players
                               start-bar end-bar 
                               &key 
                                 (start-note 1)
                                 (end-note 9999999)
                                 (auto-beam nil)
                                 (update t)
                                 (consolidate-notes nil))

slippery-chicken-edit/tie-over-rest-bars [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Extend the duration of the last note in a specified bar by changing
 immediately subsequent full-rest bars to notes of the same pitch and tying
 them to that note.

 NB: This method will not automatically update ties in MIDI output. To make
     sure that MIDI ties are also updated, use the handle-ties method.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the last note is to be
   tied. 
 - An ID or list of IDs of the players whose parts are to be modified.

OPTIONAL ARGUMENTS

 keyword arguments:
 - :end-bar. An integer or NIL. If an integer, this is the number of the
   last bar of full-rests that is to be changed to a note. This can be
   helpful for tying into passages of multiple bars of full-rest.
 - :tie-next-attack. T or NIL to indicate whether the new tied notes created 
   should also be further extended over the next attacked note if that note
   has the same pitch as the starting note of the tie. T = also tie next
   attacked note if same pitch. Default = NIL.
 - :to-next-attack. T or NIL to indicate whether ties are to extend over
   only full bars of rest or also over partial bars (until the next attacked
   note). T = until the next attacked note. Default = T.
 - :auto-beam. T or NIL to indicate whether the method should automatically
   place beams for the notes of the affected measure after the ties over
   rests have been created. T = automatically beam. Default = NIL.
 - :last-rhythm. NIL or a rhythmic duration. If a rhythmic duration, the
   last duration of the tie will be forced to this length. Useful, for
   example, when tying into a rest bar without filling that whole
   bar. NIL = fill the bar with a tied note. Default = NIL.
 - :update. T or NIL to indicate whether all slots for all events in the
   piece should be updated. This is an expensive operation so set to NIL if
   you plan on calling other similar methds, and call (update-slots sc)
   explicitly at the end. Default = T.

RETURN VALUE

 Returns t.

EXAMPLE

(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 ((c4 d4 e4))))
        :set-map '((1 (1 1)))
        :rthm-seq-palette '((1 ((((2 4) (q) e (s) s)
                                 ((h))
                                 ((s) e. e e)
                                 ((h))
                                 ((h))
                                 ((e) q s (s)))
                                :pitch-seq-palette ((1 2 2 1 3 3 1)))))
        :rthm-seq-map '((1 ((vn (1 1))
                            (va (1 1))
                            (vc (1 1))))))))
  (tie-over-rest-bars mini 1 'vn :end-bar 2)
  (tie-over-rest-bars mini 3 'va :end-bar 5)
  (tie-over-rest-bars mini 3 '(vn vc) :end-bar 6 :tie-next-attack t)
  (tie-over-rest-bars mini 7 'vc 
                      :end-bar 9
                      :to-next-attack t
                      :auto-beam t)
  (tie-over-rest-bars mini 9 'vn :end-bar 11 :last-rhythm 'e))

  => t

SYNOPSIS

(defmethod tie-over-rest-bars ((sc slippery-chicken) bar-num players
                               &key (end-bar nil) ;; num of empty bars
                                 (tie-next-attack nil)
                                 (to-next-attack t)
                                 (last-rhythm nil)
                                 (update t)
                                 (auto-beam nil))

slippery-chicken-edit/tie-over-rests [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Extend the duration of a specified note that precedes a rest by changing
 the rest to a note with the same pitch and adding a tie between them.

 NB: This method will not automatically update ties in MIDI output. To make
     sure that MIDI ties are also updated, use the handle-ties method.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the note is located. 
 - An integer that is the number of the note within that bar which is to be
   extended. This number is 1-based and also counts already tied notes.  If
   NIL, then the last note in the bar will be used.
 - The ID of the player whose part is to be modified.

OPTIONAL ARGUMENTS

 keyword arguments
 - :end-bar. An integer that is the number of the last bar into which the
   tie is to extend. This can be helpful if the user wants to tie into only
   the first of several consecutive full-rest bars.
 - :auto-beam. T or NIL to indicate whether the method should automatically
   beam the beats of the modified bars after the ties have been added.
   T = automatically beam. Default = NIL.
 - :consolidate-notes. T or NIL to indicate whether the method should
   consolidate tied notes into single rhythm units of longer duration.
   T = consolidate. Default = T.
 - :update. T or NIL to indicate whether all slots for all events in the
   piece should be updated. This is an expensive operation so set to NIL if
   you plan on calling other similar methds, and call (update-slots sc)
   explicitly at the end. Default = T.

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((c4 d4 e4))))
        :set-map '((1 (1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) (q) e (s) s)
                                 ((h))
                                 ((s) e. (e) e)
                                 ((h))
                                 ((h))
                                 ((e) q s (s)))
                                :pitch-seq-palette ((1 2 2 3 3 1)))))
        :rthm-seq-map '((1 ((vn (1 1 1))))))))
  (tie-over-rests mini 1 2 'vn)
  (tie-over-rests mini 7 1 'vn)
  (tie-over-rests mini 9 2 'vn :end-bar 10)
  (tie-over-rests mini 13 1 'vn :auto-beam t :consolidate-notes nil))

  => T

SYNOPSIS

(defmethod tie-over-rests ((sc slippery-chicken) bar-num note-num player
                           &key end-bar auto-beam (consolidate-notes t) 
                             (update t))

slippery-chicken-edit/tie-repeated-notes [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

AUTHOR

 Daniel Ross (mr.danielross[at]gmail[dot]com) 

DATE

 Wed 18 Sep 2019 18:56:39 BST

DESCRIPTION

 Tie adjacent notes if they are the same pitch or chord.
 NB: this method works on pitches and chords

ARGUMENTS

 - a slippery chicken object
 - the first bar to start looking
 - the last bar to look in
 - the player or players to tie

OPTIONAL ARGUMENTS

 - :consolidate - call consolidate-all-notes at the end? Default = t 

RETURN VALUE

 A list of the total number of ties between notes per instrument

EXAMPLE

(let* ((mini (make-slippery-chicken  
                '+mini+ 
                :ensemble '(((pno (piano :midi-channel 1))))
                :staff-groupings '(1)
                :tempo-map '((1 (q 60)))
                :set-palette '((set1 ((fs2 b2 d4 a4 d5 e5 a5 d6))) 
                               (set2 ((b2 fs3 d4 e4 a4 d5 e5 a5 d6))))
                :set-map '((1 (set1 set1 set2 set1 set1 set2)))
                :rthm-seq-palette
                '((seq1 ((((4 4) q (q) q q))   
                         :pitch-seq-palette (1 1 1)))  
                  (seq2 ((((4 4) (e) e q e (e) e e)) 
                         :pitch-seq-palette (1 1 1 (1) (1)))))
                :rthm-seq-map '((1 ((pno (seq1 seq1 seq2 seq1 seq1 seq2))))))))
      (tie-repeated-notes mini nil nil nil))

=> (12)

SYNOPSIS

(defmethod tie-repeated-notes ((sc slippery-chicken) start-bar end-bar players
                               &key (consolidate t))

slippery-chicken-edit/trill [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 Attach a trill mark to a specified event object by adding 'BEG-TRILL-A to
 the MARKS-BEFORE slot and TRILL-NOTE with the pitch to the MARKS slot. This
 method requires a specified trill pitch.

 By default trills are set to span from the specified note to the next note,
 though the length of the span can be specified using the optional
 arguments.

 NB: This is a LilyPond-only method and will not affect CMN output.

ARGUMENTS

 - A slippery-chicken object.
 - The player to whose part the trill is to be added.
 - An integer that is the number of the bar in which the trill is to start. 
 - An integer that is the number of the event object in that bar on which
   the trill is to be placed.
 - A note-name symbol that is the pitch of the trill note.

OPTIONAL ARGUMENTS

 - An integer that is the number of the event object on which the trill span
   is to stop.
 - An integer that is the number of the bar in which the trill span is to
   stop. 

RETURN VALUE

 Returns T.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((vn (violin :midi-channel 1))))
        :set-palette '((1 ((c4 d4 e4))))
        :set-map '((1 (1 1 1 1 1)))
        :rthm-seq-palette '((1 ((((2 4) q. s s))
                                :pitch-seq-palette ((1 3 2)))))
        :rthm-seq-map '((1 ((vn (1 1 1 1 1))))))))
  (trill mini 'vn 2 1 'e4)
  (trill mini 'vn 3 1 'e4 3)
  (trill mini 'vn 4 1 'e4 3 5))

=> T

SYNOPSIS

(defmethod trill ((sc slippery-chicken) player start-bar start-event trill-note
                  &optional end-event end-bar)

slippery-chicken-edit/unset-cautionary-accidental [ Methods ]

[ Top ] [ slippery-chicken-edit ] [ Methods ]

DESCRIPTION

 A post-generation editing method: Remove the parentheses from a cautionary
 accidental (leaving the accidental itself) by setting the
 ACCIDENTAL-IN-PARENTHESES slot of the contained pitch object to NIL.

 NB: Since respell-notes is called by default within cmn-display and
     write-lp-data-for-all, that option must be explicitly set to NIL for
     this method to be effective.

ARGUMENTS

 - A slippery-chicken object.
 - An integer that is the number of the bar in which the cautionary
   accidental is to be unset.
 - An integer that is the number of the note in that bar for which the
   cautionary accidental is to be unset.
 - The ID of the player whose part is to be changed.

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether to unset the cautionary accidental for the
   written part only (for transposing instruments). 
   T = written only. Default = NIL.

RETURN VALUE

 Returns NIL.

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((cl (b-flat-clarinet :midi-channel 1))
                     (vn (violin :midi-channel 2))))
        :set-palette '((1 ((cs4 ds4 fs4))))
        :set-map '((1 (1 1)))
        :rthm-seq-palette '((1 ((((4 4) e e e e e e e e))
                                :pitch-seq-palette ((1 2 3 2 1 2 3 2)))))
        :rthm-seq-map '((1 ((cl (1 1))
                            (vn (1 1))))))))
  (respell-notes mini)
  (unset-cautionary-accidental mini 2 5 'vn)
  (unset-cautionary-accidental mini 2 7 'cl t)
  (cmn-display mini :respell-notes nil))

SYNOPSIS

(defmethod unset-cautionary-accidental ((sc slippery-chicken) bar-num note-num
                                        player &optional written)

slippery-chicken/change-bar-line-type [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

 Change single to double or repeat bar lines and vice-versa.  NB This is a
 score function only, i.e., if you add repeat bar lines these will not (yet) 
 be reflected in playback with MIDI or CLM.

ARGUMENTS

 - the slippery-chicken object
 - the bar number at the end of which you want the bar line to change
 - bar line type: 0 = normal, 1 = double bar, 2 = final double bar, 3 =
   begin repeat, 4 = begin and end repeat, 5 = end repeat. As remembering
   these numbers is a bit arbitrary, you can also just pass symbols, if you
   prefer: 'normal, 'double-bar, 'final-double, 'begin-repeat,
   'begin-end-repeat, 'end-repeat

RETURN VALUE

 returns the bar-line type 

EXAMPLE

(let ((min
       (make-slippery-chicken
        '+minimum+
        :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))))))))
;; this piece only has one bar so the bar line will be 2 by default ;
  (print (bar-line-type (get-bar min 1 'fl)))
  (change-bar-line-type min 1 'double-bar)
  (bar-line-type (get-bar min 1 'fl)))
=> 
...
2
1

SYNOPSIS

(defmethod change-bar-line-type ((sc slippery-chicken) bar-num type)

slippery-chicken/copy-bars [ Methods ]

[ Top ] [ slippery-chicken ] [ Methods ]

DESCRIPTION

 Copy the rhythmic contents (rthm-seq-bar objects) from the specified bars
 of one specified player's part to another.  NB No check is performed to
 ensure that the copied notes are within the new instrument's range. 

ARGUMENTS

 - A slippery-chicken object.
 - A 1-based integer or assoc-list reference (section seq-num bar-num) that
   is the number of the first bar in the source player's part whose rhythmic
   contents are to be copied.
 - A 1-based integer or assoc-list reference (section seq-num bar-num) that
   is the number of the first bar in the target player's part to which the
   rhythmic contents are to be copied.
 - The ID of the source player's part.
 - The ID of the target player's part.
 - NIL or an integer that is the number of bars to copy, including the
   start-bar. When NIL, all bars in the piece starting from <to-start-bar>
   will be copied.

OPTIONAL ARGUMENTS

 - T or NIL to indicate whether to print feedback to the listener about the
   copying process. T = print. Default = NIL.

RETURN VALUE

 T

EXAMPLE

(let ((mini
       (make-slippery-chicken
        '+mini+
        :ensemble '(((hn (french-horn :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))
                                :pitch-seq-palette ((1 2 3 4 5))))
                            (2 ((((4 4) h h))
                                :pitch-seq-palette ((1 2)))))
        :rthm-seq-map '((1 ((hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))
                        (2 ((hn (2 2 2 2 2))
                            (vc (2 2 2 2 2))))
                        (3 ((hn (1 1 1 1 1))
                            (vc (1 1 1 1 1))))))))
  (copy-bars mini 7 2 'vc 'hn 2 t))

=> T

SYNOPSIS

(defmethod copy-bars ((sc slippery-chicken) from-start-bar to-start-bar 
                      from-player to-player num-bars 
                      &optional (print-bar-nums nil))