Derive a composition plan from a reference profile.
The plan keeps the reference's meter and span. Its keys are the reference's,
moved to opts.key with each key's variant kept, and its phrase registers
are the reference's mapped onto opts.register. Each dimension named in
opts.preserve is kept, replaced or interpolated by its weight; a draw for
a discrete item is addressed by the dimension and the item's index, so the
same reference, options and seed always give the same plan. The resolved
seed and algorithm version are recorded in the plan.
If the reference is not a valid profile or has
no melody onsets, an option is out of range, opts.key is of another
variant than the reference's home key, opts.ctx carries an rng, or the
default register moved to the new key leaves the MIDI range.
Derive a composition plan from a reference profile.
The plan keeps the reference's meter and span. Its keys are the reference's, moved to
opts.keywith each key's variant kept, and its phrase registers are the reference's mapped ontoopts.register. Each dimension named inopts.preserveis kept, replaced or interpolated by its weight; a draw for a discrete item is addressed by the dimension and the item's index, so the same reference, options and seed always give the same plan. The resolved seed and algorithm version are recorded in the plan.