There were stray notes everywhere. At first they were scattered here and there, once Pakistan had finished batting and were at their most upbeat. They made sense then only in abstract ways - the no-balls, or the inexplicable tactics that were viable only if a cricketing tactic is to not take wickets.

Only on this final day did all those notes begin to gather themselves together with sufficient coherence for them to be recognised for what they were, for a melody to take shape. The notes were only a guide to what you would be listening to but not why you might be listening to it, or how they came to be - that is PhD-level study material.

It's a little bit like learning to play the guitar without formal and basic grounding in music and how it is constructed. You can learn to play the guitar from YouTube tutorials. You can, from rote, recognise what notes or chords come next in a sequence. But you're blind to why music is the way it is, and why it sounds better this way and not that way.

So the first note came with the morning's first ball. Sohail Khan, stiff, clunky but, jogged in to deliver the first ball, which was the last ball of his last over from the previous day. The only thing it had going for it was that it reached the other end, and given its bearing it would have been better off not reaching at all. In not interrupting its journey with one hand, throwing it back to Sohail and asking him to get serious, and instead punching it through covers for four Steven Smith committed an act of mercy.

Later, Sohail would drop Mitchell Starc at long-off, and so simple was the chance, its spilling had no explanation. But there it was. It begins in the field, as it had done on day three, in those wild, unregulated sessions where Australia battered Pakistan for five runs per over.

Then the obligatory early wicket. The ball from Josh Hazlewood had nothing to recommend or distinguish it. It wasn't even really bothering anyone: length, around off, ho-hum. Defend it as he has defended a million balls before - except Sami Aslam, a prisoner to the history of Pakistan openers, defended and left as one, with inevitable results.

A break arrived, which meant a wicket had to. Seven years ago to the day, at this ground, Pakistan had begun the final day with two set batsmen at the crease, a firm little partnership suggesting maybe, just maybe, they could save the game. They lost two wickets in the first over of the morning.

Babar Azam fell to the first ball after lunch. He had fallen to the last ball before lunch on the first day. They don't do statistics for this kind of thing but Pakistan, it can be confidently ventured, would lead any table of ill-timed dismissals either side of breaks in play.

Hazlewood's first ball after lunch, the seventh of the session, was when the tune began to take shape. It didn't take a wicket but that one delivery carried the horrors of history just as Aslam's shot-not-shot had, a history past and a history future. It dipped into Azhar Ali, newly Pakistan's best batsman, and then jagged away, past the outside edge. Everyone in the cordon, all of the small crowd, the commentators - all of Australia and the world - now heard and knew this tune: Pakistan in Australia, last day, outgoing deliveries haranguing edges likes the flies of this country harangue its humans. In this country, it said, you can only lose Tests, that you have lost the last ten here and lol, forget winning, you'll be lucky to draw a game.

Now everybody knew this song and you know what? It's the anthem everyone knows the words and music to. Azhar blocked a Hazlewood delivery that rolled this close past the stumps and instead of thinking maybe this won't be Australia's day, it was clear that it will be. It had to be.

Anthems work for being predictable so we knew what was next. An unexpected hero had to arrive. Who could it be? Smith with the ball? Decent shout. Nic Maddinson with the ball, under pressure and not really a bowler? Warm. Nathan Lyon, cult figure, on the verge of an axing with eight expensive wickets in his last four Tests? Bingo, my friends, bingo.

As soon as his first ball turned big, more than any ball in the Test, Pakistan had just the profile of a man it would sprinkle some stardust on to. You must be busy, so only some of the names of those who have benefited from Pakistani largesse: Colin de Grandhomme, Marcus North, Nick Cook, Paul Harris, Nathan Hauritz.

Lyon now delivered the chorus, which is handy given his place as deliverer of the team song: first Younis Khan and then, dramatically, Misbah-ul-Haq and both not long after afternoon drinks (remember?). The Nathan before this one - Hauritz - dismissed Mohammad Yousuf and Misbah within three balls in Sydney last time around to dismantle a chase.

What was left? That's right - the catch, freakish or incredible, take your pick. A long, long time ago, when the tune was first revealed, Ross Edwards had taken a scarcely believable catch at point to get rid of an in-form Sadiq Mohammad. Pakistan never recovered from this start to a chase of 159. Merely a long time ago, Geoff Marsh flung himself to his left at cover point to end Ijaz Ahmed's resistance and deny Pakistan the draw they were so close to. A long, long time from now, somebody will tell you about Peter Handscomb's catch to dismiss Asad Shafiq, the catch that ended Pakistan's best chance to not lose a Test in Australia.

Nothing was left after that. It had all come together, this tune and it'll be stuck inside your head for eternity.

Osman Samiuddin is a senior editor at ESPNcricinfo