GENERIC-CNSTR
Arguments: cnstr var-inds option &optional levels arity [generic-function]
Defines an arbitrary constraint which can be independent of the intended chord interpretation of domains in SITUATION.
'cnstr' must be a predicate. 'var-inds' are the variable indexes where the constraint is applied. If
'indexes?' is not NIL, the variable numbers are included in the call to cnstr. 'levels' are the levels
of the domains of the variables where the constraint is applied. Default is 0. 'arity' is the
number of variables that 'cnstr' constraints. If NIL, the number of arguments of the predicate 'cnstr'
is taken. 'option' can be one of the following:
f or (f i) the predicate is applied exactly to the variables in 'var-inds'.
a or (a i) the predicate is applied to all combinations of variables in 'var-ind'
s or (s i) or (s number i)
'cnstr' must be a predicate. 'var-inds' are the variable indexes where the constraint is applied. If
'indexes?' is not NIL, the variable numbers are included in the call to cnstr. 'levels' are the levels
of the domains of the variables where the constraint is applied. Default is 0. 'arity' is the
number of variables that 'cnstr' constraints. If NIL, the number of arguments of the predicate 'cnstr'
is taken. 'option' can be one of the following:
f or (f i) the predicate is applied exactly to the variables in 'var-inds'.
a or (a i) the predicate is applied to all combinations of variables in 'var-ind'
s or (s i) or (s number i)
the predicate is applied to all sequences of variables in 'var-ind'.` When given as a [[list]] (s n), subsequences used for applying the constraint are taken from the [[sequence]] in length-n steps.
For instance a constraint requiring the sequence of pitches 60 64 67 in the lower voice could be
specified as follows:
'cnstr' = #'(lambda (p1 p2 p3) (equal (list p1 p2 p3) (list 60 64 67)))
'var-inds' = (0_16s2) even variables (thus lower note) for the first 8 chords
'option' = (s 3)
'levels' = NIL or, equivalently, (8* 0)
'arity' = NIL
specified as follows:
'cnstr' = #'(lambda (p1 p2 p3) (equal (list p1 p2 p3) (list 60 64 67)))
'var-inds' = (0_16s2) even variables (thus lower note) for the first 8 chords
'option' = (s 3)
'levels' = NIL or, equivalently, (8* 0)
'arity' = NIL