rthm-seq-map/add-repeats [ Methods ]
[ Top ] [ rthm-seq-map ] [ Methods ]
DESCRIPTION
Generate repeating sequences at given cycle points using recurring-event data. This process modifies the number of beats.
ARGUMENTS
- A rthm-seq-map object. - the cycle data (i.e. recurring-event class's data slot--see recurring-event.lsp) - the number of repeats made (or references into :repeats list), also in cycle (i.e. recurring-event class's return-data-cycle slot)
OPTIONAL ARGUMENTS
keyword arguments: - :section. the section map reference. default 1 - :repeats-indices. a list of the number of repeat bars returned by the cycle data (i.e. recurring-event class's return-data slot). Generally this will remain nil and we'll express the number of repeats directly in the third argument, but it could be useful to use references into this list there instead, as the recurring-event class already makes possible. default nil - :start. what bar/rthm-seq to start at. default 1 - :end. what bar/rthm-seq to end at. default nil = don't stop. - :print. print the rthm-seq id and number of times repeated. default nil
RETURN VALUE
the number of bars added
EXAMPLE
;;; ;; when to repeat how many repeats ;;; (add-repeats +coming-rthm-chain-main+ '((3 2) (4 3)) '((3 3) (4 1))) ;;; --> 146
SYNOPSIS
(defmethod add-repeats ((rsm rthm-seq-map) repeat-every repeats &key (section 1) repeats-indices (start 1) end print)
rthm-seq-map/add-repeats-simple [ Methods ]
[ Top ] [ rthm-seq-map ] [ Methods ]
DESCRIPTION
ARGUMENTS
OPTIONAL ARGUMENTS
RETURN VALUE
EXAMPLE
SYNOPSIS
(defmethod add-repeats-simple ((rsm rthm-seq-map) start-seq repeats &key (section 1) print)
rthm-seq-map/check-num-sequences [ Functions ]
[ Top ] [ rthm-seq-map ] [ Functions ]
DESCRIPTION
Check to ensure that each player in each section of the given rthm-seq-map object has the same number of references as every other instrument. If not, drop into the debugger with an error. NB: This function is called automatically every time make-rthm-seq-map is called so it shouldn't generally be necessary for the user to call this method. However, if the rthm-seq-map is changed somehow, it might be a good idea to recheck.
ARGUMENTS
- A rthm-seq-map object.
RETURN VALUE
Returns T if all players have the same number of references in each section, otherwise drops into the debugger with an error.
EXAMPLE
;;; Passes the test: (let ((rsmt (make-rthm-seq-map 'rsm-test '((sec1 ((vn (rs1a rs3a rs2a)) (va (rs1b rs3b rs2b)) (vc (rs1a rs3b rs2a)))) (sec2 ((vn (rs1a rs2a rs1a)) (va (rs1a rs2a rs1b)) (vc (rs1a rs2b rs1a)))) (sec3 ((vn (rs1a rs1a rs3a)) (va (rs1a rs1a rs3b)) (vc (rs1a rs1b rs3a)))) (sec4 ((vn (rs1a rs1a rs1a)) (va (rs1a rs1a rs1b)) (vc (rs1a rs1b rs1a)))))))) (check-num-sequences rsmt)) => T ;;; Doesn't pass the test; drops into debugger with an error. (let ((rsmt (make-rthm-seq-map 'rsm-test '((sec1 ((vn (rs1a rs3a rs2a)) (va (rs1b rs3b)) (vc (rs1a rs3b rs2a)))) (sec2 ((vn (rs1a)) (va (rs1a rs2a rs1b)) (vc (rs1a rs2b rs1a)))) (sec3 ((vn (rs1a rs3a)) (va (rs1a)) (vc (rs1a rs1b rs3a)))) (sec4 ((vn (rs1a)) (va (rs1a rs1a rs1b)) (vc (rs1a rs1a)))))))) (check-num-sequences rsmt)) => rthm-seq-map::check-num-sequences: In rthm-seq-map RSM-TEST-5, instrument VA: Each instrument must have the same number of sequences for any given section: (RS1B RS3B) [Condition of type SIMPLE-ERROR]
SYNOPSIS
(defun check-num-sequences (rsm)
rthm-seq-map/get-map-refs [ Methods ]
[ Top ] [ rthm-seq-map ] [ Methods ]
DATE
29-Dec-2010
DESCRIPTION
Return the list of rthm-seq-palette references for the given player and section.
ARGUMENTS
- A rthm-seq-map object. - The ID of the section in which the references are sought. - The ID of the player for whom the references are sought.
RETURN VALUE
A list of references (each of which might also be a list).
EXAMPLE
(let ((rsmt (make-rthm-seq-map 'rsm-test-5 '((sec1 ((vn (rs1 rs3 rs2)) (va (rs2 rs3 rs1)) (vc (rs3 rs1 rs2)))) (sec2 ((vn (rs1 rs2 rs1)) (va (rs2 rs1 rs3)) (vc (rs1 rs3 rs3)))) (sec3 ((vn (rs1 rs1 rs3)) (va (rs1 rs3 rs2)) (vc (rs3 rs2 rs3))))) :palette (make-rsp 'rs-pal '((rs1 ((((2 4) q e s s)))) (rs2 ((((2 4) e s s q)))) (rs3 ((((2 4) s s q e))))))))) (get-map-refs rsmt 'sec3 'vc)) => (RS3 RS2 RS3)
SYNOPSIS
(defmethod get-map-refs ((rsm rthm-seq-map) section player)
rthm-seq-map/get-time-sig-ral [ Methods ]
[ Top ] [ rthm-seq-map ] [ Methods ]
DESCRIPTION
ARGUMENTS
OPTIONAL ARGUMENTS
RETURN VALUE
EXAMPLE
SYNOPSIS
(defmethod get-time-sig-ral ((rsm rthm-seq-map) (rsp rthm-seq-palette))
rthm-seq-map/make-rthm-seq-map [ Functions ]
[ Top ] [ rthm-seq-map ] [ Functions ]
DESCRIPTION
Make a rthm-seq-map object.
ARGUMENTS
- The ID of the rthm-seq-map object to be made. - A list of nested lists, generally taking the form '((section1 ((player1 (rthm-seq ids)) (player2 (rthm-seq ids)) (etc... (etc...)))) (section2 ((player1 (rthm-seq ids)) (player2 (rthm-seq ids)) (etc...))) (etc...))
OPTIONAL ARGUMENTS
keyword arguments: - :palette. A palette object or NIL. If a palette object is specified or defined here, it will be automatically bound to the given rthm-seq-map object. Default = NIL. - :warn-not-found. T or NIL to indicate whether a warning is printed when an index which doesn't exist is used for lookup. T = warn. Default = NIL. - :replacements. A list of lists in the format '(((1 2 vla) 3 20b) ((2 3 vln) 4 16a)) that indicate changes to individual elements of lists within the given rthm-seq-map object. (Often rthm-seq-map data is generated algorithmically but individual elements of the lists need to be changed.) Each such list indicates a change, the first element of the list being the reference into the rthm-seq-map (the vla player of section 1, subsection 2 in the first example here), the second element is the nth of the data list for this key to change, and the third is the new data. Default = NIL. - :recurse-simple-data. T or NIL to indicate whether to recursively instantiate a recursive-assoc-list in place of data that appears to be a simple assoc-list (i.e. a 2-element list). If NIL, the data of 2-element lists whose second element is a number or a symbol will be ignored, therefore remaining as a list. For example, this data would normally result in a recursive call: (y ((2 23) (7 28) (18 2))). T = recurse. Default = T.
RETURN VALUE
A rthm-seq-map object.
EXAMPLE
;;; Straightforward usage (make-rthm-seq-map 'rsm-test '((1 ((vn (1 2 3 4)) (va (2 3 4 1)) (vc (3 4 1 2)))) (2 ((vn (4 5 6)) (va (5 6 4)) (vc (6 4 5)))) (3 ((vn (7 8 9 1 2)) (va (8 9 1 2 7)) (vc (9 1 2 7 8)))))) => RTHM-SEQ-MAP: num-players: 3 players: (VA VC VN) SC-MAP: palette id: NIL RECURSIVE-ASSOC-LIST: recurse-simple-data: T num-data: 9 linked: NIL full-ref: NIL ASSOC-LIST: warn-not-found NIL CIRCULAR-SCLIST: current 0 SCLIST: sclist-length: 3, bounds-alert: T, copy: T LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL NAMED-OBJECT: id: RSM-TEST, tag: NIL, data: ( [...] ;;; An example using the :replacements argument and binding directly to a ;;; specified rthm-seq-palette object. (make-rthm-seq-map 'rsm-test '((1 ((vn (1 2 3 4)) (va (2 3 4 1)) (vc (3 4 1 2)))) (2 ((vn (4 5 6)) (va (5 6 4)) (vc (6 4 5)))) (3 ((vn (7 8 9 1 2)) (va (8 9 1 2 7)) (vc (9 1 2 7 8))))) :palette (make-rsp 'rs-pal '((rs1 ((((2 4) q e s s)))) (rs2 ((((2 4) e s s q)))) (rs3 ((((2 4) s s q e)))))) :replacements '(((1 vn) 2 7) ((2 va) 1 1) ((3 vc) 1 0))) => RTHM-SEQ-MAP: num-players: 3 players: (VA VC VN) SC-MAP: palette id: RS-PAL RECURSIVE-ASSOC-LIST: recurse-simple-data: T num-data: 9 linked: NIL full-ref: NIL ASSOC-LIST: warn-not-found NIL CIRCULAR-SCLIST: current 0 SCLIST: sclist-length: 3, bounds-alert: T, copy: T LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL NAMED-OBJECT: id: RSM-TEST, tag: NIL, data: ( [...]
SYNOPSIS
(defun make-rthm-seq-map (id rsm &key (palette nil) (warn-not-found nil) (replacements nil) (recurse-simple-data t))
rthm-seq-map/rsm-count-notes [ Functions ]
[ Top ] [ rthm-seq-map ] [ Functions ]
DESCRIPTION
Returns the number of notes in the given rthm-seq-map object for the specified player and rthm-seq-palette.
ARGUMENTS
- A rthm-seq-map object. - The ID of the player whose notes are to be counted. - The rthm-seq-palette object whose rthm-seq object IDs are referred to by the given rthm-seq-map object.
OPTIONAL ARGUMENTS
- T or NIL to indicate whether to count just the number of notes that need new events (i.e., not counting tied notes; also not counting chords, since chords need only one event) or the total number of notes in that player's part in the score. T = count just attacked notes. Default = T.
RETURN VALUE
Returns an integer that is the number of notes counted.
EXAMPLE
(let ((rsmt (make-rthm-seq-map 'rsm-test '((sec1 ((vn (rs1 rs3 rs2)) (va (rs2 rs3 rs1)) (vc (rs3 rs1 rs2)))) (sec2 ((vn (rs1 rs2 rs1)) (va (rs2 rs1 rs3)) (vc (rs1 rs3 rs3)))) (sec3 ((vn (rs1 rs1 rs3)) (va (rs1 rs3 rs2)) (vc (rs3 rs2 rs3))))))) (rspt (make-rsp 'rs-pal '((rs1 ((((2 4) q (e) s s)))) (rs2 ((((2 4) e +s (s) q)))) (rs3 ((((2 4) (s) s +q e)))))))) (print (rsm-count-notes rsmt 'vn rspt)) (print (rsm-count-notes rsmt 'va rspt nil))) => 23 27
SYNOPSIS
(defun rsm-count-notes (rthm-seq-map player palette &optional (just-attacks t))
rthm-seq-map/set-map-refs [ Methods ]
[ Top ] [ rthm-seq-map ] [ Methods ]
DATE
30-Dec-2010
DESCRIPTION
Change the reference IDs of the specified rthm-seq objects in the given rthm-seq-map object.
ARGUMENTS
- A rthm-seq-map object. - The ID of the section in which references are to be set. - The ID of the player for whom the references are to be set. - A list of the new rthm-seq IDs (references)
RETURN VALUE
Returns the modified named object whose ID is the specified player.
EXAMPLE
(let ((rsmt (make-rthm-seq-map 'rsm-test-5 '((sec1 ((vn (rs1 rs3 rs2)) (va (rs2 rs3 rs1)) (vc (rs3 rs1 rs2)))) (sec2 ((vn (rs1 rs2 rs1)) (va (rs2 rs1 rs3)) (vc (rs1 rs3 rs3)))) (sec3 ((vn (rs1 rs1 rs3)) (va (rs1 rs3 rs2)) (vc (rs3 rs2 rs3))))) :palette (make-rsp 'rs-pal '((rs1 ((((2 4) q e s s)))) (rs2 ((((2 4) e s s q)))) (rs3 ((((2 4) s s q e))))))))) (set-map-refs rsmt 'sec2 'vc '(rs2 rs3 rs2))) => NAMED-OBJECT: id: VC, tag: NIL, data: (RS2 RS3 RS2)
SYNOPSIS
(defmethod set-map-refs ((rsm rthm-seq-map) section player new-refs)
sc-map/rthm-seq-map [ Classes ]
[ Top ] [ sc-map ] [ Classes ]
NAME
rthm-seq-map File: rthm-seq-map.lsp Class Hierarchy: named-object -> linked-named-object -> sclist -> circular-sclist -> assoc-list -> recursive-assoc-list -> sc-map -> rthm-seq-map Version: 1.0.0-beta2 Project: slippery chicken (algorithmic composition) Purpose: Implementation of the rthm-seq-map class which maps references to rthm-seq objects for the players in the piece. Extensions to the sc-map superclass are the collection of all the players in the piece and a check to make sure that each list each instrument has the same number of rthm-seq references for each section. Instances of this class must declare sections and players so if the piece is in one section, give it the label 1 or whatever, e.g. '((1 ((vln (2 20 1 9 10 22 16 25 6 14 21 17 4 9 13 2)) (vla (2 23 3 7 13 22 19 3 8 12 23 14 2 10 15 4)) (vc (2 21 3 12 11 22 16 1 8 17 23 20 24 9 12 2))))) Author: Michael Edwards: m@michael-edwards.org Creation date: July 28th 2001 $$ Last modified: 21:51:55 Tue May 8 2012 BST SVN ID: $Id: rthm-seq-map.lsp 1982 2012-05-24 15:35:54Z medward2 $