instrument-palette/auto-set-subset-id [ Methods ]

[ Top ] [ instrument-palette ] [ Methods ]

DATE

 July 27th 2018, Heidhausen

DESCRIPTION

 Set the subset-id slot to be the same as the id slot for each instrument in
 the palette.  

ARGUMENTS

 - an instrument-palette instance

RETURN VALUE

 - the instrument instance

SYNOPSIS

(defmethod auto-set-subset-id ((ip instrument-palette))

instrument-palette/make-instrument-palette [ Functions ]

[ Top ] [ instrument-palette ] [ Functions ]

DESCRIPTION

 Create an instrument-palette object from a list of instrument descriptions
 based on the keyword arguments of make-instrument.

ARGUMENTS

 - A symbol that will serve as the ID for the instrument-palette object. 
 - A list of instrument descriptions based on the keyword arguments of
   make-instrument. 

OPTIONAL ARGUMENTS

 keyword arguments:
 - :warn-not-found. T or NIL to indicate whether a warning is printed when
   an index which doesn't exist is used for look-up. Default = T.

RETURN VALUE

 An instrument palette.

EXAMPLE

;; Returns an instrument-palette object
(make-instrument-palette 'inst-pal 
                         '((piccolo (:transposition-semitones 12
                                     :lowest-written d4 :highest-written c6))  
                           (bf-clarinet (:transposition-semitones -2
                                         :lowest-written e3 
                                         :highest-written c6)) 
                           (horn (:transposition f :transposition-semitones -7 
                                  :lowest-written f2 :highest-written c5)) 
                           (violin (:lowest-written g3 :highest-written c7
                                    :chords t)) 
                           (viola (:lowest-written c3 :highest-written f6
                                   :chords t))))

=>
INSTRUMENT-PALETTE: 
PALETTE: 
RECURSIVE-ASSOC-LIST: recurse-simple-data: T
                      num-data: 5
                      linked: NIL
                      full-ref: NIL
ASSOC-LIST: warn-not-found T
CIRCULAR-SCLIST: current 0
SCLIST: sclist-length: 5, bounds-alert: T, copy: T
LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
NAMED-OBJECT: id: INST-PAL, tag: NIL, 
data: (
[...]

SYNOPSIS

(defun make-instrument-palette (id ip &key (warn-not-found t))

instrument-palette/set-prefers-high [ Methods ]

[ Top ] [ instrument-palette ] [ Methods ]

DATE

 05 Feb 2011

DESCRIPTION

 Set the PREFERS-NOTES slot of a specified instrument object within a given
 instrument-palette object to 'HIGH. The instrument object is specified
 using the ID symbol assigned to it within the instrument-palette object
 definition. 
 
 NB: The optional argument is actually required, but is listed as optional
 because of the attributes of the instrument class method.

ARGUMENTS

 - An instrument-palette object.

OPTIONAL ARGUMENTS

 - A symbol that is the ID of the instrument object within the
   instrument-palette object definition.

RETURN VALUE

 Returns the symbol 'HIGH.

EXAMPLE

;; Define an instrument-palette object, then set the PREFERS-NOTES slot of the
;; instrument object 'piccolo within that instrument-palette object to 'HIGH 
(let ((ip (make-instrument-palette 'inst-pal 
                                   '((piccolo (:transposition-semitones 12
                                               :lowest-written d4
                                               :highest-written c6))   
                                     (bf-clarinet (:transposition-semitones -2 
                                                   :lowest-written e3 
                                                   :highest-written c6)) 
                                     (horn (:transposition f
                                            :transposition-semitones -7  
                                            :lowest-written f2 
                                            :highest-written c5))   
                                     (violin (:lowest-written g3
                                              :highest-written c7 
                                              :chords t)) 
                                     (viola (:lowest-written c3
                                             :highest-written f6 
                                             :chords t))))))
  (set-prefers-high ip 'piccolo))

=> HIGH

SYNOPSIS

(defmethod set-prefers-high ((ip instrument-palette) &optional instrument)

instrument-palette/set-prefers-low [ Methods ]

[ Top ] [ instrument-palette ] [ Methods ]

DATE

 05 Feb 2011

DESCRIPTION

 Set the PREFERS-NOTES slot of a specified instrument object within a given
 instrument-palette object to 'LOW. The instrument object is specified
 using the ID symbol assigned to it within the instrument-palette object
 definition. 
 
 NB: The optional argument is actually required, but is listed as optional
     because of the attributes of the instrument class method.

ARGUMENTS

 - An instrument-palette object.

OPTIONAL ARGUMENTS

 - A symbol that is the ID of the instrument object within the
   instrument-palette object definition.

RETURN VALUE

 Returns the symbol 'LOW.

EXAMPLE

;; Define an instrument-palette object, then set the PREFERS-NOTES slot of the
;; instrument object 'piccolo within that instrument-palette object to 'LOW
(let ((ip (make-instrument-palette 'inst-pal 
                                   '((piccolo (:transposition-semitones 12
                                               :lowest-written d4
                                               :highest-written c6))   
                                     (bf-clarinet (:transposition-semitones -2 
                                                   :lowest-written e3 
                                                   :highest-written c6)) 
                                     (horn (:transposition f
                                            :transposition-semitones -7  
                                            :lowest-written f2 
                                            :highest-written c5))   
                                     (violin (:lowest-written g3
                                              :highest-written c7 
                                              :chords t)) 
                                     (viola (:lowest-written c3
                                             :highest-written f6 
                                             :chords t))))))
  (set-prefers-low ip 'piccolo))

=> LOW

SYNOPSIS

(defmethod set-prefers-low ((ip instrument-palette) &optional instrument)

palette/instrument-palette [ Classes ]

[ Top ] [ palette ] [ Classes ]

NAME

 instrument-palette

 File:             instrument-palette.lsp

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

 Version:          1.0.12

 Project:          slippery chicken (algorithmic composition)

 Purpose:          Implementation of the instrument-palette class which
                   intantiates instruments to be used in an ensemble
                   instance.  

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

 Creation date:    6th September 2001

 $$ Last modified:  12:22:46 Thu Sep 20 2018 CEST

 SVN ID: $Id$