how to change music tonality in runtime?
Have a look at Capo.
From their Website: 


  Pitch Adjustment
  
  Capo lets you adjust the pitch of your songs—so you can change their
  key or fine tune them to match your instrument.