WSOLVER
Arguments: n-obj p-pts n-pts i-dst cnstr x-dst &optional data x-sol n-sols &[[rest]] merge [generic-function]
Searches solutions for the Music Constraint-Satisfaction Problem.
1. 'n-ch' is the number of chords.
2. 'Dens' defines the number of notes for each chord.
1. 'n-ch' is the number of chords.
2. 'Dens' defines the number of notes for each chord.
It can be
-A list of lists: The i-th sublist contains the options for the number of notes in
the i-th chord. e.g. (3 4 7), admits chords having 3 4 or 7 notes.
-A number: Gives the number of notes for every chord.
-A flat list: Gives the options for every chord.
If the [[length]] of 'Dens' is less than n-ch, it is completed with default
values according to the values in 'vint'.
3. 'vint' defines the possibles intervals for each chord.
It can be a ([[flat]] or 2-level) [[list]] that defines the possible intervals
for a chord. For instance the list ( 3 4 7 11 ) defines chords having
(possibly repeated) consecutive intervals from that list.
The list ((4 7 11) (10 12)) defines chords with intervals EITHER from the [[first]]
or [[second]] sublist.
When a sublist begins with the symbol 'f' the intervals are EXACTLY those given.
For instance, (f (4 7 11) (10 12)) defines either
(4 7 11) or (10 12) as the only possible intervals for the chord, in that order.
If the length of 'vint' is less than n-ch, it is completed with its last
value if any. If 'vint' is NIL and no 'data' are given, 'vint' is set
to (1 2 3 4 5 6 7 8 9 10 11 12) by default.
4. 'Amb' has the form (*1) where (ij sj) defines the ambitus
for the j-th chord. If the length of 'Amb' is less than n-ch, it is completed with its last value if any, else it is completed with '(0 120).
5. 'cnstrs' is the list of constraints for the problem.
6. 'n-sols' gives the number of solution required. Default is 1. -1 means all.
7. 'data' is a list of elements ( <index-list> <list of chords> )
6. 'n-sols' gives the number of solution required. Default is 1. -1 means all.
7. 'data' is a list of elements ( <index-list> <list of chords> )
where <index-list> is the list of indexes of variables representing chords and <list of chords>
is the list of possible values (chords) for these variables. <index-list> can also be a single
index.
8. 'x-sol' is an index representing a chord number. Starting from this chord,
(i.e. finding a new value for it, but keeping the values of previous chords, if possible) another
solution is searched for.
'x-sol' can also be one of the following lists:
a. (index t) : Starting from the chord represented by 'index', but IGNORING
ITS constraint, another solution is searched for.
b. ('b index) : Starting from the base of the chord represented by 'index'
another solution is searched for.
c. ('i index) : Starting from the intervals of the chord represented by 'index'
another solution is searched for.
d. ('b index t) or ('i index t) : Similar to b or c.,
except that the corresponding constraint (i.e. base constraint or interval constraint) are
ignored.
NOTE: 'x-sol' should be NIL unless at least one solution has already been found.
9,10,...Each of these entries represent a sub-problem ( given by the adjoint-problem box, see UserLib/Situation1.b menu )
to be adjoint to the current solved problem.
Every time only the last entry is considered, because we assume that the previous ones has been
adjointed already.