Case in point, I'm trying to learn the University of Georgia Bulldogs "Glory Glory Dixieland" at the moment. I've played my own version of Battle Hymn of the Republic for years, in a Southern Gospel style. There's some commonality with Dixieland, but a lot of differences too. Since I'm trying to learn it in order to help a friend play it, it's necessary to be as exact as possible with the melody, which is where memory loss can really complicate learning a new song.
Most of the time, I learn by listening, matching the keys, doing a ton of repetition to help remember the melody. Easy enough, the only hard part is matching the key if it's not one I'm good at, and remembering the full melody if it's not a tune I already know well. But this version of the Battle Hymm is in a key I'm not great with... and the melody drifts in and out with the different instruments like a fox laying a trail for the hounds.
There might be better options, but I'm a big fan of "Free", and Audible is free, open source, and a fantastic audio editor. As usual, I only learn what I need as it's needed. Audible is way beyond me in all the many things that it can do, it helps to focus just on the useful parts. I mainly use it to edit audio clips, digitize audio from analog sources, and to make sure all my audio is output in WAV. WAV is uncompressed and lossless, and excellent for audio editing. Learning to play a song with Audible is a new process for me, but as I get older and my memory declines, it's become a great help for learning songs in smaller chunks of sound. And in the case of "Glory Glory Dixieland", slowing the audio down enough to hear the distinct notes being played is a Godsend.
When a song doesn't have a clear melody being played by a single instrument, listening to a small segment over and over will also help you pick out which line you prefer to follow. In "Glory Glory Dixieland", at times there's kind of a jumble of sound. I'll listen to it until one part stands out over another part, and pick that as the melody to follow.
To start, open Audible and load the music file. If you simply play the song, it will play the complete file and stop. If you click and drag in the audio track, you'll highlight a section of the audio. Now when you play, it will play the highlighted section and stop. At the end of the playback controls, clicking on the "Loop" command will add a looping region that matches your highlighted section. (It shows as two bars in the timeline above the audio track.) Now it can play that one loop over and over, and you can focus on that one brief clip until you've figured out the notes you need.
Right click on the loop track, select clear, and you can choose another section to highlight. Or select either side of the selected range and drag to reposition them. Listening to the music, piece by piece, you can learn the entire song in this fashion.
If the music is fast, or too complex at normal speed, you can slow it down. For a quick fix, there's an information line below the tracks, and in that line you'll see a green arrow. Hoving over it shows "Play-At-Speed." To its right, you can change the speed it plays back by sliding the button. This will change playback speed on the fly. It's great if you just need a quick comparison, but as you change the speed, the pitch will also change. Meaning it won't play back in the same key.
I like to highlight the entire audio track, and from the "Effect" dropdown menu, choose "Change Tempo." This will let you adjust the speed to your liking. (I like to reduce the speed by about 30%.) If you click "Preview", you can hear a short sample with the new setting. If the new speed sounds right, click "Apply." Now you have the entire song slower, but still playing in the original key!
Save your work when it's done processing. I export a WAV file, then save a "Project" file. If you want to change the speed again at a later point, reload your original audio and make the change. Reason being, changing the tempo while keeping the pitch results in artifacts in the file. I haven't noticed them at one iteration, but the Audible website says it gets worse with each iteration, like making a xerox copy, then a copy of the copy, then a copy of the copy... it winds up losing a lot of quality.
Now it's just a matter of learning the song at an easier pace. Choose a small segment, listen over and over until you can match it. If there's too many instruments, keep replaying the section, but listen for a melody that stands out over the rest of the instruments. When you're trying to convert a whole band into a single person playing on the piano, you have to choose which parts work and which parts aren't necessary. I'll learn several segments, then practice playing them all in one run, then adjust the highlighted playback to the longer segment, and learn to play all those parts in time with the audio clip. I'll learn the song as I go, and wind up being able to play along with the original music at it's original pace.
As always, I'm primarily writing this to accommodate my own memory loss. If the time comes I can't remember how, this guide will remind me. If it helps anybody else, that makes it even better. :^)