Check out Harmony Assistant or Melody Assistant.Sorry, I don't have the URL handy. They might not solve your problem, but are robust packages and fun to play with. ie. transpose a midi of Danny Boy into a marching band score. Should the desire ever arise.
Cheers, Bardford