Playing by ear can actually mean two different things. In one case it is working out how to play a tune while you are listening to it. Secondly it can mean working out how to play a tune that you have in your head on an instrument. This page focuses on the first topic.
For several years after picking up music, I believed that I was incapable of playing by ear. This assumption had been drawn as I believed 'playing by ear' meant 'the ability to play something perfectly on first exposure'. Naturally I tried a few times, failed and gave up.
I began to reassess this assumption after sitting in with the fiddle teacher at a local traditional music group. He is an exceptionally good player, who both learns new tunes and teaches exclusively by ear. I only had limited exposure to his teaching as he left shortly after I joined the group. However in this limited time I did gain insight into how to approach playing by ear.
His method was very simple: break a tune into short phrases, which are played repeatedly. The learner plays in unison; at first most of their notes will be wrong. But through repetition, a few notes are found and the others gradually fall into place. While this is initially arduous, over time the mind starts to develop a sense of relative pitch. Sounds are linked to fingerings and the note hunting reduces.
From this I came to a realisation: the ability to play by ear is a learned skill just like other aspects of music. An advanced practitioner may be able to pick something up on first exposure. However someone approaching the practice for the first time will not be able to do so. The skill must be developed gradually.
How easy something is mostly depends on how much time you have spent doing it. Unfortunately, outside of music, paying very close attention to pitch is not a commonly used skill. So you are already starting from a disadvantage relative to other things. Fortunately, the task can be made a lot easier with good approach.
The point about playing by ear is to learn the instrument well enough to use it as an extension of your voice. In order to do this, you really need to be able to move between different notes subconsciously. You may be able to get away with thinking about fingerings if the music is slow, but it will limit you as you try to go faster.
I've outlined a simple example of playing by ear, but what does this look like in practise, and how can you apply it if you don't have a teacher? This section breaks down the approach into a sequence of steps. It is demonstrated using the first part of a simple Irish tune, played on an alto C ocarina, using no accidentals or sub hole notes. I haven't named the tune to discourage you from looking for sheet music. If you were to do so, you will bypass the process of developing your ear. the most important thing here is to try. You may struggle to begin with but it does get easier.
Begin by simply listening to the music that you want to learn played at normal speed. If you are learning from a teacher, get them to play it repeatedly, or make a recording. If you are working from a recording from the start just listen to it over and over, at least 10 to 20 times. You want to be able to hear it in your head from start to finish. Do not try to play over the melody at this stage.
It is important to find out as much as you can about the music before you try to play it. Playing by ear is easiest to do when you can make assumptions about what you are hearing. For example, try playing the following audio sample by ear on the provided instrument, clicking or tapping the buttons produces a note.
I'm sure that you where able to do these without much difficulty. This is easy, as the example is played slowly, and the number of notes that you have to choose from is small. You want to take advantage of similar knowledge when beginning to play by ear. For example, it helps if you identify some key aspects of the music, such as the first note and the key. Once you know the key, your possible range of 12 notes has been reduced to 7, possibly with a few accidentals.
To make this task easier for the example, I've played the first note as a long tone, which you may play over. For other music you may wish to learn, if you have a teacher they can do the same for you. If you are instead working from a recording, you may loop the first note to make this easier. See the next section.
The key note is the note a piece of music centres around, and moving away from it creates a sense of tension. Returning to the key resolves this tension, and as music usually seeks to end with resolution, the key is often the final note. In the case of the example, the key is the same as the starting note. Sometimes finding the key can be more involved, and you can find other sources demonstrating how to do this.
Among genres of music commonly played by ear, these assumptions are often baked into the tradition itself. Irish traditional music for example is usually in G, D and relative modes, fitting in a range of an octave and a 6th, D to B in the second octave. Because of this it is relatively easy to find the notes by 'hunting' which results in an early sense of success.
When you are first starting out with playing by ear, trying to play over a piece of music at full speed is often too difficult. Because of this, you should slow it down. This is easiest to do if you are playing with a teacher, as they can play at a speed you can manage. However if you are learning from a recording you are not out of luck.
Modern software is able to slow down recordings without changing their pitch. Any good digital audio workstation will be able to do this. Audacity for example is free, it doesn't sound great when making large changes to the speed but it does work. Other tools such as Amazing Slowdowner and commercial DAW's such as Reaper produce a cleaner sounding result, even when slowing a lot.
In addition to listening to the music played slowly, you also want to be able to work on short sections at a time. This can be done using the loop feature found in most audio software. If working with a teacher, they can just play a short section for you.
Below I have broken down the example tune into 4 separate pieces, which I have played slowly and repeated. The final example is all of these separate pieces played together, but slowly. Listen through them and aim to pick out the notes on your instrument. If a note that you play is wrong, try to hear if your note is higher or lower, and compensate appropriately.
If you find yourself getting frustrated, either try a different section, or have a break and come back to it. You will find it easier next time, once your subconscious has done its thing.
There are two different ways to approach playing by ear, one is to work out one note at a time in sequence, going back until you get it right. The second is to identify critical notes and then go back to fill in the gaps you have left. You may find the second approach advantageous as you get better at playing by ear. Instead of having to loop short sections, you can put the whole tune on repeat: learning the important notes first, then gradually filling in the details.
In any regard, as you get more experience you will begin to recognise intervals by ear, and automatically know the finger transitions that correspond to them. You will then start to be able to play more fluently.
Finally you should note that the notes used in music are not random. Melodies often include common patterns like ascending or descending scale runs and arpeggios. Within a single piece of music, you will often see whole phrases which repeat. For instance, you may have noticed in the first and third sections in my example are the same.
Once you have learned to identify and finger such a pattern, you will be able to do so without considering the individual notes, and this is easier as it is less to think about. By analogy, when you are fluent with a language, you don't process words one at a time, but know the meaning from the whole sound.
The first time you play something by ear it may take you several days, this is ok. As you keep practising this, you will gradually internalise it. You will gradually find that you can pick up slow simple melodies without needing to break it down as much. Over time this evolves into more and more complex music.
That being said, attempting to play arbitrary music by ear on the ocarina can be challenging. The problem is that the limited range often means that notes are used that are out of range, which can be very confusing. The best way of dealing with this is probably through playing with a teacher or crafted exercises. Playing ocarina along with another ocarina in the same key is relatively straightforward, assuming that they are playing in tune. You know that the notes they are playing exist on your instrument.
In theory, a lot of vocal music is playable on the ocarina as the voice has a similar range to the ocarina. However the technique of playing over a recording may not work as the key may not match. People have varying vocal ranges. You can work around this by transposing the recording with a DAW. The other way of playing by ear, that is getting the tune into your head and learning it on the instrument from memory would also work well, as you can transpose the melody into range.
In practise I often find it easier to use a different instrument to work out the tune, then work out how to fit it on the ocarina later. Personally I often use the flute for this, and a cheap MIDI keyboard is also a useful tool. Both have a large range and keyboards can be transposed into different octaves, so you can assume that notes you hear actually exist on the instrument. If you slow down the recording enough one finger playing is fine as a starting point.
I think that it would be useful to have a collection of graded exercises within the range of the ocarina, such that a player knows that something is actually playable on their instrument. However, I don't intend to create them, at least not in the foreseeable future. I leave this as an opportunity for the reader.