The band’s uneven 2003 album has been judiciously reworked to accompany a staging of Shakespeare’s tragedy with quite extraordinary results

According to the programme notes, Thom Yorke had serious reservations about director Christine Jones’ idea to stage a production of Hamlet featuring music from Radiohead’s 2003 album Hail to the Thief. Who can blame him?

Many criticisms have been laid at Radiohead’s door but being hopelessly naff isn’t one of them, and, alas, naff is very much the adjective you’d apply to a lot of attempts to meld Shakespeare and rock music.

You’re often in the realm of high camp – portentous, Bard-quoting heavy metal lyrics; Return to the Forbidden Planet’s jokey blending of The Tempest with 50s rock’n’roll; 2015’s These Paper Bullets, which relocated Much Ado About Nothing to swinging London, complete with Beatle-y songs by Green Day’s Billie Joe Armstrong – or of buttock-clenching disasters like Catch My Soul, a 1971 rock adaptation of

Othello which required Black American soul singer PP Arnold to star opposite impresario Jack Good, playing the title role in blackface.

Yorke was won around, at least in part because he felt the album in question was “the record that got away”.

Such things are obviously relative when it comes to a band with a fanbase as rabid as Radiohead’s – there exists a four-part podcast series that involves a quartet of devotees discussing Hail to the Thief for six hours – but it certainly doesn’t have a reputation to match that of its gamechanging predecessors, Kid A and Amnesiac, or its follow-up In Rainbows, which has a fair claim to be called the best album

Radiohead ever made.

By contrast, Hail to the Thief received decidedly mixed reviews, not least from some members of Radiohead: bassist Colin Greenwood even suggested some of its songs were released unfinished.

A historically shaky idea allied to an album of mixed quality: it’s hard not to feel a slight degree of trepidation.

If you’re on the alert for naffness when you arrive at the Barbican, a set littered with guitar amps and a backdrop depicting Elsinore partly constructed from PA speakers might set alarm bells ringing, but no: the Royal Shakespeare Company and Factory International’s production works quite extraordinarily well.

For one thing, the music – played by a five-piece band, whose musicians all have roots in jazz, and who perform in what looks like a recording studio at the rear of the stage – just fits the action. If you want something to soundtrack a play in which ghosts and mental disarray figure heavily, the keening tone of Yorke’s vocal melodies is pretty much perfect.

Ineffably eerie without ever slipping into Halloween-costume parody, they’re burnished further by the way they’re reworked here: on the version of 2+2 = 5 that opens the play, Meg Hill and Ed Begley’s vocals are swathed in reverb until they sound disembodied.

Similarly, the fragments of the album’s more upbeat tracks that litter the play are largely stripped of their electronic arrangements, which amps up their physicality: the riff of Where I End and You Begin feels less jittery, more brawny.

The fear that the music might intrude on or interrupt the action is similarly unfounded: a brisk 1 hour 40 minutes long, Hamlet Hail to the Thief’s brevity means both Shakespeare’s text and Radiohead’s music require judicious editing, the latter into what Yorke calls “shattered pieces”. The fragments augment, rather than interrupt.

The opening verses of the album’s most beautiful song, Sail to the Moon, have elbowed out the stuff about herbs and flowers from the scene depicting Ophelia’s descent into madness: a ballsy move given how celebrated those lines are, but it fits remarkably well, the oddness of the lyrics – “I sucked the moon, I spoke too soon” – jarring against the heartbreaking melody.

The Gloaming soundtracks her funeral, denuding the song of its historical context (on Hail to the Thief, it functions as a horrified response to the Iraq war) and transforming it into a more generalised response to corrupt power structures that suits the play’s court: “Murderers, you’re murderers / We are not the same as you”.

In turn, the necessary adaptation burnishes the music. One of Hail to the Thief’s problems is that it’s too long and unfocused, the sound of a band frantically throwing out ideas, not all of which work. Here, the lesser tracks