ensemble/add-player [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Add a player to an existing ensemble. It will be added at the end of the list.
ARGUMENTS
- The ensemble object. - The new player, either as a player object or symbol. If the latter this becomes the id of the player we'll create.
OPTIONAL ARGUMENTS
- The id of the instrument in the already existing instrument-palette. This is required if the player argument is a symbol. Default NIL. - An instrument-palette object. Default = +slippery-chicken-standard-instrument-palette+.
RETURN VALUE
The player object added.
SYNOPSIS
(defmethod add-player ((e ensemble) player &optional instrument-id (instrument-palette +slippery-chicken-standard-instrument-palette+))
ensemble/balanced-load? [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DATE
28th August 2014
DESCRIPTION
Determine whether the playing load is balanced across the players of the ensemble. By default, if the least active player is playing 80% of the time that the most active player is playing, we'll return T.
ARGUMENTS
- an ensemble instance
OPTIONAL ARGUMENTS
keyword arguments: - :threshold. A number between 0.0 and 1.0 which represents the lowest ratio between the most and least active players. - :stats-fun. One of the player methods which tots up statistics, i.e. total-notes, total-degrees, total-duration, or total-bars - :ignore. A list of players (symbols) not to count in the sorting.
RETURN VALUE
T or NIL
SYNOPSIS
(defmethod balanced-load? ((e ensemble) &key (threshold .8) (stats-fun #'total-duration) ignore)
ensemble/get-player [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Return a player object from an ensemble, if it exists.
ARGUMENTS
- An ensemble object. - The ID of a player.
RETURN VALUE
The player object or NIL if there's no such player.
SYNOPSIS
(defmethod get-player ((e ensemble) player)
ensemble/get-players [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Return the IDs of the players from a given ensemble object.
ARGUMENTS
- An ensemble object.
RETURN VALUE
- A list of symbols that are the player IDs of the given ensemble object.
EXAMPLE
(let ((ens (make-ensemble 'ens '((flt ((flute piccolo) :midi-channel 1)) (clr ((b-flat-clarinet))) (tpt ((b-flat-trumpet c-trumpet) :midi-channel 2)) (vln ((violin)))) :instrument-palette +slippery-chicken-standard-instrument-palette+))) (get-players ens)) => (FLT CLR TPT VLN)
SYNOPSIS
(defmethod get-players ((e ensemble))
ensemble/make-ensemble [ Functions ]
[ Top ] [ ensemble ] [ Functions ]
DESCRIPTION
Make an ensemble object, specifying the players and associated instruments. NB: If you have an ensemble with a player doubling two instruments, be sure to indicate some keyword argument or other as (fl1 ((piccolo violin) :midi-channel 1)) works but (fl1 ((piccolo violin))) thinks that piccolo is a nested ensemble!!! NB: The argument :instrument-palette is a required argument although it is a keyword argument.
ARGUMENTS
- An ID consisting of a symbol, string or number. - A list of 2-element sublists that define the ensemble. See the above comment on adding a keyword argument for doubling players.
OPTIONAL ARGUMENTS
keyword arguments: - :instrument-palette. An instrument palette object. Default = +slippery-chicken-standard-instrument-palette+ - :bar-line-writers. Obsolete as no longer used.
RETURN VALUE
An ensemble object.
EXAMPLE
(let ((ens (make-ensemble 'ens '((flt ((flute piccolo) :midi-channel 1)) (clr ((b-flat-clarinet)))) :instrument-palette +slippery-chicken-standard-instrument-palette+))) (print ens)) => ENSEMBLE: bar-line-writers: NIL players: (FLT CLR) (id instrument-palette): SLIPPERY-CHICKEN-STANDARD-INSTRUMENT-PALETTE RECURSIVE-ASSOC-LIST: recurse-simple-data: T num-data: 2 linked: T full-ref: NIL ASSOC-LIST: warn-not-found T CIRCULAR-SCLIST: current 0 SCLIST: sclist-length: 2, bounds-alert: T, copy: T LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL NAMED-OBJECT: id: ENS, tag: NIL, data: ( PLAYER: (id instrument-palette): SLIPPERY-CHICKEN-STANDARD-INSTRUMENT-PALETTE doubles: T, cmn-staff-args: NIL LINKED-NAMED-OBJECT: previous: NIL, this: (FLT), next: (CLR) NAMED-OBJECT: id: FLT, tag: NIL, data: [...] data: ( INSTRUMENT: lowest-written: [...] NAMED-OBJECT: id: FLUTE, tag: NIL, [...] INSTRUMENT: lowest-written: [...] NAMED-OBJECT: id: PICCOLO, tag: NIL, [...] PLAYER: (id instrument-palette): SLIPPERY-CHICKEN-STANDARD-INSTRUMENT-PALETTE doubles: NIL, cmn-staff-args: NIL LINKED-NAMED-OBJECT: previous: (FLT), this: (CLR), next: NIL NAMED-OBJECT: id: CLR, tag: NIL, data: INSTRUMENT: lowest-written: [...] NAMED-OBJECT: id: B-FLAT-CLARINET, tag: NIL, )
SYNOPSIS
(defun make-ensemble (id ensemble &key bar-line-writers (instrument-palette +slippery-chicken-standard-instrument-palette+))
ensemble/num-notes [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Get the number of attacked notes in a given slippery-chicken object. This method accesses the ensemble object within the given slippery-chicken object to perform this task.
ARGUMENTS
- An ensemble object.
RETURN VALUE
An integer that is the total number of attacked notes in the given slippery-chicken object.
EXAMPLE
(let ((mini (make-slippery-chicken '+mini+ :ensemble '(((vn (violin :midi-channel 1)) (vc (cello :midi-channel 2)))) :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4)))) :set-map '((1 (1 1 1 1 1))) :rthm-seq-palette '((1 ((((2 4) e e e e)) :pitch-seq-palette ((1 2 3 4))))) :rthm-seq-map '((1 ((vn (1 1 1 1 1)) (vc (1 1 1 1 1)))))))) (num-notes (ensemble mini))) => 40
SYNOPSIS
(defmethod num-notes ((e ensemble))
ensemble/num-players [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Get the number of players in a given ensemble object.
ARGUMENTS
- An ensemble object.
RETURN VALUE
- An integer.
EXAMPLE
(let ((ens (make-ensemble 'ens '((flt ((flute piccolo) :midi-channel 1)) (clr ((b-flat-clarinet))) (tpt ((b-flat-trumpet c-trumpet) :midi-channel 2)) (vln ((violin)))) :instrument-palette +slippery-chicken-standard-instrument-palette+))) (num-players ens)) => 4
SYNOPSIS
(defmethod num-players ((e ensemble))
ensemble/players-exist [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Produce an error message and drop into the debugger if the specified player IDs are not found within the given ensemble object.
ARGUMENTS
- An ensemble object. - A list of symbols that are the IDs of the players sought.
RETURN VALUE
NIL if the specified player ID is present within the given ensemble object, otherwise drops into the debugger with an error.
EXAMPLE
;;; Returns NIL if a player with the specified ID is found in the given ;;; ensemble object. (let ((ens (make-ensemble 'ens '((flt ((flute piccolo) :midi-channel 1)) (clr ((b-flat-clarinet))) (tpt ((b-flat-trumpet c-trumpet) :midi-channel 2)) (vln ((violin)))) :instrument-palette +slippery-chicken-standard-instrument-palette+))) (players-exist ens '(vln))) => NIL ;; Drops into the debugger with an error if no player with the specified ID is ;; found in the given ensemble object. (let ((ens (make-ensemble 'ens '((flt ((flute piccolo) :midi-channel 1)) (clr ((b-flat-clarinet))) (tpt ((b-flat-trumpet c-trumpet) :midi-channel 2)) (vln ((violin)))) :instrument-palette +slippery-chicken-standard-instrument-palette+))) (players-exist ens '(vla))) => ensemble::players-exist: VLA is not a member of the ensemble [Condition of type SIMPLE-ERROR]
SYNOPSIS
(defmethod players-exist ((e ensemble) players)
ensemble/sort-players [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DATE
27th August 2013
DESCRIPTION
Return a hierarchical list of players sorted by e.g. how much they're playing.
ARGUMENTS
- An ensemble object
OPTIONAL ARGUMENTS
keyword arguments: - :stats-fun. One of the player methods which tots up statistics, i.e. total-notes, total-degrees, total-duration, or total-bars - :ignore. A list of players (symbols) not to count in the sorting.
RETURN VALUE
A list of all the players in the ensemble ordered by its statistics.
SYNOPSIS
(defmethod sort-players ((e ensemble) &key (stats-fun #'total-duration) ignore)
ensemble/tessitura [ Methods ]
[ Top ] [ ensemble ] [ Methods ]
DESCRIPTION
Get the average pitch of a given slippery-chicken object. This method accesses the ensemble object within the given slippery-chicken object to perform this task. NB: This method processes data in relationship to degrees of the current tuning system (scale), which is quarter-tone by default. It is therefore possible, when generating a piece using only chromatic pitches but within a non-chromatic tuning to get microtonal results.
ARGUMENTS
- An ensemble object.
RETURN VALUE
An integer that is the average pitch of the given slippery-chicken object in degrees.
EXAMPLE
;;; Change the tuning to chromatic first to get an accurate result: (in-scale :chromatic) => #<tuning "chromatic-scale"> (let ((mini (make-slippery-chicken '+mini+ :ensemble '(((vn (violin :midi-channel 1)) (vc (cello :midi-channel 2)))) :set-palette '((1 ((f3 g3 a3 b3 c4 d4 e4 f4)))) :set-map '((1 (1 1 1 1 1))) :rthm-seq-palette '((1 ((((2 4) e e e e)) :pitch-seq-palette ((1 2 3 4))))) :rthm-seq-map '((1 ((vn (1 1 1 1 1)) (vc (1 1 1 1 1)))))))) (tessitura (ensemble mini))) => C4
SYNOPSIS
(defmethod tessitura ((e ensemble))
recursive-assoc-list/ensemble [ Classes ]
[ Top ] [ recursive-assoc-list ] [ Classes ]
NAME
ensemble File: ensemble.lsp Class Hierarchy: named-object -> linked-named-object -> sclist -> circular-sclist -> assoc-list -> recursive-assoc-list -> ensemble Version: 1.0.7 Project: slippery chicken (algorithmic composition) Purpose: Implementation of the ensemble class. Author: Michael Edwards: m@michael-edwards.org Creation date: 4th September 2001 $$ Last modified: 18:11:28 Mon Oct 20 2014 BST SVN ID: $Id: ensemble.lsp 5891 2016-07-02 09:11:42Z medward2 $