change-data/get-change-data [ Methods ]

[ Top ] [ change-data ] [ Methods ]

DESCRIPTION

 Get the change data (for example, from an instrument-change-map object) for
 a specified sequence.

ARGUMENTS

 - A change-data object.
 - An integer that is the number of the sequence within the given
   change-data object for which to retrieve the data.

OPTIONAL ARGUMENTS

 - An integer that is the number of the bar within the specified sequence
   for which to return the change data.

RETURN VALUE

 The change data of the specified sequence (and bar).

EXAMPLE

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

=> ALTO-SAX, NIL

SYNOPSIS

(defmethod get-change-data ((cd change-data) sequence &optional (bar 1))

change-data/make-change-data [ Functions ]

[ Top ] [ change-data ] [ Functions ]

DESCRIPTION

 Create a change-data object, which holds data for use by a change-map
 object. The data stored in change-data object will be that of parameter
 changes for a whole section, such as tempo values.

 The data is passed to the make-change-data function as a list of
 three-element lists, each consisting of the number of the sequence, the
 number of the bar within that sequence, and the new data.

ARGUMENTS

 - An ID for the change-data object to be created.
 - A list of three-item lists, each consisting of the number of the sequence
   in which the data is to change, the number of the bar within that
   sequence in which the data is to change, and the data value itself. The
   sequence number and bar number are always integers > 0. If no bar-number
   is given, it will default to 1.

RETURN VALUE

 A change-data object.

EXAMPLE

(make-change-data 'cd-test '((1 1 23) (6 1 28) (18 1 35)))

=> 
CHANGE-DATA: 
            previous-data: NIL, 
            last-data: 35
SCLIST: sclist-length: 3, bounds-alert: T, copy: T
LINKED-NAMED-OBJECT: previous: NIL, this: NIL, next: NIL
NAMED-OBJECT: id: CD-TEST, tag: NIL, 
data: ((1 1 23) (6 1 28) (18 1 35))

SYNOPSIS

(defun make-change-data (id data)

sclist/change-data [ Classes ]

[ Top ] [ sclist ] [ Classes ]

NAME

 change-data

 File:             change-data.lsp

 Class Hierarchy:  named-object -> linked-named-object -> sclist -> 
                   change-data

 Version:          1.1.0

 Project:          slippery chicken (algorithmic composition)

 Purpose:          Implementation of the change-data class.  Holds data
                   regarding parameter changes for a whole section
                   (e.g. tempo).  For use in change-map.  The data in the
                   <changes> slot is a three-element list: the sequence
                   number, the bar number of the sequence where the change
                   takes place (defaults to 1) and the new data (e.g. a
                   tempo value).

                   When giving this data, the sequence number and bar
                   numbers are always integers > 0, unlike sequences
                   themselves which may be given any kind of id.  Therefore
                   it's OK to sort the given data according to integer
                   precedence and perform numeric tests on them too.

                   No public interface envisaged (so no robodoc entries).

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

 Creation date:    2nd April 2001

 $$ Last modified: 20:31:51 Mon May 14 2012 BST

 SVN ID: $Id$