Use the phone as a feedback device which will tell you if the notes you are playing on an instrument are on pitch. Visual or haptic feedback could get more or less intense depending how far you are off the correct note. Could also be used to check if you are playing in time with a metronome. Might be best to load music you will play into phone as midi files.
If we loaded a pre-defined music score using midi - and displayed this on the screen which scrolls as you play. You would need to tell it how fast you are going to play the music - usually expressed as beats per minute. It then would measure the pitch correctness as well as rhythmic accuracy using visual feedback - but often music needs to speed up and slow down in sections to make it more expressive. If we strapped the phone onto a piece of headgear which positions it about 10 inches in front of your eyes. you could use head movements to either speed up or slow down the music - which is quite natural - many musicians move their heads or their feet in time to music when performing anyway.