Let's face it: no pianist like memory lapses. You know, when you draw a "blank" while playing a piece you know perfectly. I don't like it, you don't like it, and Vladimir Horowitz didn't like it. (Yes, even HE had memory lapses!)
I'm not going to try to convince you to love those difficult moments, but hear me out on this: there is a bright side. We generally learn things in the way that comes easiest to us. This is simply a part of being human. So let's say you've learned a complex piece of piano music. Maybe you memorized it easily. In this case, it's probably mainly "muscle memory." Your fingers remember where to move and which notes to play. Finger memory is an essential part of learning piano, but it's not the whole picture.
So you see your friend and decide to play this piece for them, which you know so well. Everything's going along fine until... Blank. Nothing. You can't remember what comes next. First of all, just smile to yourself and don't get frustrated. It happens to all of us and it isn't the crisis you think it is. Your friend still likes you and thinks you're a good musician. Simply find a place in the music you can pick up from and continue. Your friend only cares about enjoying the music, not your mistakes. (BTW, I once saw the legendary classical guitarist Segovia have a memory slip. He simply played something what sounded like "Heart and Soul" over and over until he could move on with his Bach. No one cared.)
The REAL interesting thing happens when you get back to practicing the piece again. This is a GREAT opportunity to strengthen your knowledge of the piece by learning it in a slightly different way. If you had muscle memory before, now you can analyze the chord progression. Perhaps you've never noticed that the music modulates to the key of G major at exactly the spot where you forgot what comes next. Now, you can think about this key change when you play the piece and mentally keep your fingers "on track." It's like having two people remember something instead of just one, so you'll have more security.
When I was a kid, I broke a finger while playing baseball. (Right now, all you pianists out there are saying "Ouch"!!!) My doctor explained to me that when the bone healed (which it did), it would be stronger than it had been before the break.
Memorization is like this. It's a 3-step process:
1. Memorize a piano piece
2. Unintentionally forget part of it
3. Re-learn that part, using a different learning strategy
Eureka! You now know the music better than ever!
So if you find yourself forgetting some music that you previously knew, don't despair. Use that moment as an opportunity to learn the piece in a more complete way. For one thing, you don't have many other options. And secondly, you'll become a much better musician in the process
In addition to learning written music, it's fun to improvise, since you don't have to memorize anything! Here are some lessons to get you started: Beginner Piano Improv Lessons
Get my free ebook: Left Hand Techniques for Jazz Piano
You'll also get my weekly jazz newsletter with practice tips and inspiration