Reasons of the notes sounding flat or unclear:
3 EASY FIXES FOR BEGINNERS
#1. If you have Low Notes issue - make sure tone holes are fully covered.
I know that may sound obvious for you, but it's actually quite a common problem around beginning ocarinists. On the low notes, not covering the tone holes completely will make the air to leak out, and the sound produced to be out of tune.
Even one not fully covered sound hole will result a change in pitch!
#2. If you have High Notes issue - find the right blowing strength.
That is another common problem around most people who first start playing the ocarina - their air pressure is too delicate. You should blow gently, but firmly, making sure you breath enough air out, especially on the highest notes (as those require a lot of air on most ocarinas).
#3. If you have Tone Quality issue - work on your tonguing.
Do not just blow or "puff" into your ocarina, but breathe out a "tu" or "du" sound instead.
Sometimes the tone becomes better if you tip your chin to your chest on the higher notes. Also, please make sure that your posture is right - sit straight towards the edge of your chair, and do not slouch.
3 PLAYING IMPROVEMENTS FOR ADVANCED OCARINISTS
#1 Work on your Lip Position and an Air Stream Consistency.
You need to make sure the stream of air that you blow is strong and steady. Use your own palm to check, saying "tuuu" as if you are playing your ocarina. You will feel the diameter and strength of your air stream, as well as will notice if there's any inconsistency in the flow of air. The flow should not rise and fall, or have any "gaps" or "breaks" in it, as those make the pitch vary and a tuner needle to jump madly.
Experiment with tightening the muscles around your mouth a bit more or pulling your lips in a little to find the best mouth position for you.
#2 Play with an angle of your Air Stream as well as an Ocarina Angle.
Try to angle your ocarina slowly while blowing a long note, so you can hear at which part your ocarina produces the best sound. That way you will see if you are holding your ocarina correctly, and will be able to adjust the angle of your air stream to find the perfect point at which the sound is more clear.
Some ocarinas sound best when you hold them parallel to the ground, and some are better at 45 degrees. But a general rule is to hold the wind way entrance in line with the mouth.
#3 Practice a Scale Exercise each time before you play.
Now this is too important to be missed! Each time before playing some tune you love, force yourself to practice the whole note scale exercise! Follow all the notes in your ocarina's range up and down, holding each note for about four beats.
Keep in mind that each note you play should be nice and clear, and your air pressure good and steady. You can also use a tuner to adjust your breath pressure accordingly.
In fact, this is a truly amazing exercise, as it won't only allow your muscles to remember your ocarina (its shape, the position of your lips or hands, etc), but also the breath pressure necessary for each note. Practising a scale exercise before playing session is a really good habit, since every ocarina is different and requires its own adjustments.
Thanks and stay in tune! ;)