I stopped watching Breaking Bad early in season three for a strange reason: I felt it was bad for my soul. Frankly, I had never been that concerned about my soul before, but when charred plane fragments began to rain down on Albuquerque (fans know what I'm talking about), I felt a dull ache, an unusual suffering, and I decided enough was enough. If you like, Breaking Bad is the Goldberg Variations of misery. How many terrible consequences can Walter White reap from his first bad decision? At least as far as I watched, the show's approach was exhaustive: a survey of emotional, physical, and spiritual harm. The Goldbergs are also exhaustive, and contingent on Bach's first fateful decision, on the bassline he has chosen, the parameters he has set forth.

In fact, the Goldberg Variations have caused me more misery than any other piece of music in history, with the exception of the Tchaikovsky Trio (for totally different reasons). How many hours have I spent backstage fretting, knowing that there will be several insufferable know-it-alls in the audience, with their 700 recordings and deeply considered opinions? How many hours have I spent practising those passages where the two hands climb over each other, then turn around (as if revisiting the site of an accident) and head for each other again?

The Goldbergs, originally for a two-keyboard instrument, become uniquely treacherous when played on just one. There are many impossible crossings, many unplayable moments. You have to decide which hand goes over the other, and practise how to make the switch smoothly; but there is always the possibility you will be on stage, communing with the spheres, and your fingers and wrists will literally tangle – like two dancers who stumble over each other – scattering wrong notes into paradise. You must always also be reminded that the instrument you are playing them on is the "wrong" one, especially by critics.

On top of their difficulty, the Goldbergs are terrifyingly clean. The work clings mostly to the purity of G major, and its materials are so self-evident: the variation with the scales chasing each other in thirds (horrible memories of practising scales as a child); the variation with the arpeggios (ditto); the variation with the scurrying passages in one hand and the leaps in the other. It almost like a lesson plan, with modular units, and everyone knows them – they are as well-travelled as a seasoned flier in an airport lounge.

I never wanted anything to do with the Goldbergs, but one day – I don't know how – my friend Toby Saks convinced me to learn them for her festival in Seattle. She thought it would change my life. With one hasty yes I was committed – you cannot do a programme substitution with the Goldbergs; it would be like trying to replace George Clooney. As usual, I procrastinated, and a panicky, cold December and January ensued, a Christmas holiday spent with a piano, wondering why it couldn't have just been 15 variations, say, or 18, instead of 30? I broke them into bundles of five, to cope with the project's enormity.

The day before my first performance, I remember sitting in a Vietnamese restaurant, hunched over a giant bowl of Pho (outside fell classic Seattle drizzle), while my musician friends murmured consoling epithets at me – "I'm sure it will be fine" – treating me like a patient who was about to undergo an operation.

The first performance was a bit like a dream, much of it bad, but a few variations had something, I felt. My first taste of Goldberg addiction. Was I encouraged or war-scarred? A second period of obsession began, going over those stubborn variations in order to understand the independence (or lack thereof) of my hands, trying to find the most transparent and loving way to express them. And now, nine years later, with a recording under my belt, I probably belong in Goldbergs Anonymous.

The Goldbergs, insular and obsessed, have all the failings of classical music in general. The piece is a text reflecting on itself, satisfied in its own world, suggesting that everything you would ever want to know is contained within. The variations (by definition music about music) are subject to countless insider discussions in the outer world, to comparisons of recordings like heavyweight bouts, to that annoying word "definitive". Despite this, Bach's smile wins through. The piece is a lesson in many things, but primarily in wonder: the way that the tragic variations fuse seamlessly into the breathlessly comic, the way that simple scales become energy, joy, enthusiasm, the celebration of the most fundamental elements of music. This is the kind of beatific happiness that Beethoven eventually tried to attain, after the heroic happiness of the middle period. The last movements of Beethoven's Op 109 and Op 111 invoke the Goldbergs, and represent a joy beyond achievement.

The copout of Breaking Bad, shared by many great novels and works of art (I'm thinking of you, Balzac!), is to leave us mired in a sea of human degradation. It is often easier to write sadness. And happiness easily becomes a shortcut, or a falsehood; "happy ending" is often a derogatory term. Of course, the ending of the Goldbergs is cut with melancholy (unlike Walter's pure blue stuff). When the theme returns at the end, you realise this is the last time you will hear that turn into bittersweet E minor (melancholy about melancholy), and also the last time you will experience the chain of fifths with which Bach escapes from it. I'll admit it always chokes me up, not because the piece is over, not because things are ending, but because of a sense of the completeness of everything that has come before, the rightness, and – if it doesn't sound too cheesy to say – the radiance of experience. It gives you that rare thing in human existence: a sense that, at the end of something, it has all been worthwhile.

Jeremy Denk's recording of JS Bach's Goldberg Variations is out now on Nonesuch. Read our review. Denk performs the Goldberg Variations and Ligeti Etudes at LSO St Luke's, London EC1 on 24 May 2014 (barbican.org.uk).