A number of MIDI sequencers can adapt user-written patterns to other chord types: You author your pattern in a particular chord (let's say CM7) and the sequencer automatically adapts it to whatever chord is playing in a chord track (let's say Gm).
For example, the following two pattern-based hardware sequencers can do this:
* Yamaha's QY100 (described on page 108 of the English manual
* Roland's PMA-5 (described on page 51 of the English manual
I'd like to implement similar functionality in some software I'm writing and I wonder if anyone here can give me guidance or direct me to an authoratative resource (e.g. book, article, code, etc).
Transposing a pattern to a new root is straightforward but adjusting the pitches to a different chord type is less so. I could use my limited knowledge of music theory to implement something basic but I'd prefer the algorithm to be properly grounded.
The most obvious approach is to move notes to the nearest note on the target scale. However, it's not clear how to handle the situation if the source note is equally far from two candidate notes in the scale.
Thanks for any advice,