Move the melody into the key it is harmonized in. The search reports the
shift it chose in transposeSemitones; transposing the melody by that many
semitones puts it in the returned key, so melody and harmony always agree.
Use it for a melody notated in one key that has to be sung or played in
another. It never changes register on its own — that is octaveSearch.
Search octave placements as well, so a melody written too high or too low is moved into a comfortable register. Octaves leave every pitch class where it was, so this changes neither the key nor the chords.
Options controlling harmonizeMelody.