2.5 User Constraints
An important feature of the software is the provision for users to have control over the search process.
Before selecting an instrument/pitch/dynamic level, for example, libsporch.so optionally calls
one or more user callback functions asking whether or not
a match can be used and added to the list. Another callback function might return a score value that is multiplied or added (or both) with the algorithm's own score.
Users can then effectively reply with either a “yes” or “no” or rate the choice according to how well the match fits into other criteria.
Following is an example list of useful constraints that can be specified:
- The composer wants certain types of instruments (brass, for example) to be emphasized more than other instruments.
- When analyzing at successive time points, a callback function compares the instrument and pitch with the most recent pitches in that part, rating the
voice leading so that large leaps or octave jumps are avoided.
- The composer wants the pitches to conform to certain relationships (for example, only consonant intervals can appear).
- The user already has a collection of pitches in mind and wants to assign instruments and dynamic levels only.
A function therefore returns a zero if the pitch isn't in the chord (and isn't repeating a pitch already chosen).
- The user wants to morph gradually from one sonority to another and control the rate of change. With each
analysis of the second sound source, only one pitch is allowed to change. This can be done by doing multiple
analyses at each step in the process, each time constraining all of the instrument/pitch choices to the previous harmony and allowing
the last choice to be left up to the algorithm.
- The callback function calls another instance of the libsporch.so library on some other sound source each time, returning the score from that
one. The results are effectively merged together so that the results are a hybrid of running the algorithm on both sounds.
The list can easily be expanded.
Future enhancements to SPORCH will include ways of improving the amount of flexibility and control
the program offers. These will include alternate ways of modeling spectral components, alternate ways of matching
peaks (for example, using the critical bandwidth curve), different search strategies, and as many ways of altering
the search through callback routines as possible.