There are two classics of mid-20th-century melancholia in English Literature. One, Brideshead Revisited, a book of 340-odd pages, became a television series lasting 11 hours. The other, A Dance to the Music of Time, reaches the small screen this week. Channel 4's adaptation runs for only eight hours; yet the work on which it is based extends across more than 2,000 pages of text, written over 24 years (1951-75). In fact, Anthony Powell's sequence of 12 novels about English life from the Twenties to the Seventies is rather longer than War and Peace, with at least as great a cast of individually drawn characters (there are getting on for 500 of them). And although not quite on the scale of Tolstoy's epic, Powell's Dance takes these characters through a similarly eventful journey, from the frivolities of peacetime through the privations of total war and back again, all the time managing to report on their doings with a detached and leisurely air. It is for precisely this reason that A Dance to the Music of Time has often appeared to stand alongside War and Peace as one of the great unfilmable works of fiction.

But appearances can be deceptive. Although attempts have been made to dramatise Powell's books before (by Dennis Potter among others), they have tended to fall down on the seeming impossibility of reconciling Powell's authorial voice - relaxed and resigned - with the hectic and sometimes hysterical pace at which things happen to the people he is writing about. But just because Powell is no Tolstoy, there is no real need to try to reconstruct with absolute fidelity his take on events. What A Dance to the Music of Time offers is not some overarching vision, but a wonderfully varied series of vignettes. The motifs that run through the books, including the central motif of its title, are drawn not from philosophy, but from the visual arts. To get the books across successfully on the screen, all that is needed is to choose judiciously from the hundreds of moments that Powell freezes in time, the various steps of the dance.

This is what Hugh Whitemore, by choosing to adapt the books into four two-hour films, has done. Whitemore, who specialises in bringing to the screen the hidden depths of buttoned-up Englishmen (he was the scriptwriter of 84 Charing Cross Road and Franco Zeffirelli's recent Jane Eyre), breaks the action down into a series of choice encounters, in which the same characters circle relentlessly round Powell's alter ego, Nicholas Jenkins, played over the course of his long life by James Purefoy and John Standing. All the significant characters are there, but they are usually glimpsed only in passing, on the edge of apparently unconnected events. The flavour of each is conveyed in the fleeting attitudes they strike, and in the snatches of Powell's dialogue which have been faithfully reproduced. And it works, not least because the dialogue often gives a better sense of Powell's voice than the convoluted authorial monologues that sometimes precede it in the novels. The inner life of the narrator is dispensed with altogether.

The one thing Whitemore can't do is give the books more of a plot than they have on the page, no matter how much the action is condensed. A Dance to the Music of Time is not a conventional costume drama; perhaps to emphasise this, the first scene of nudity in the books, which comes towards the end of volume three, occurs 10 seconds into the televised version when Claire Skinner, as Jenkins's girlfriend, opens her very respectable front door with nothing on. But it is costume drama none the less, and as such it is bound to disappoint those who have set expectations of the genre. For while a great deal goes on, and although the costumes are wonderful, not a lot actually happens. The events which constitute the drama itself are pretty innocuous - a man has sugar poured over him at a party, a man gets drunk and has to be put to bed, a woman is sick into an urn at a funeral. There are marriages, divorces, births and deaths, but these punctuate the story at the same rhythm as the rest of the action. Familiar characters constantly reappear, older but not usually wiser. The wicked are not often punished. There are no happy endings.

Yet Channel 4 can take comfort from the fact that Pride and Prejudice was not the only historical drama to strike a chord in the last couple of years. The adaptation of A Dance to the Music of Time is less like Brideshead Revisited and more like Our Friends in the North - or South. It is played out against a similarly vast backdrop of historical events and, perhaps surprisingly, it has a similar theme, as various characters struggle to come to terms with the moral imperatives of socialism. Powell, who was famously the only Tory George Orwell could bring himself to like, is rather more diffident about this aspect of the political life than Peter Flannery was. But as a result, his version of events benefits from the one thing Our Friends in the North conspicuously lacked. It is very funny. It is, admittedly, humour of a rather familiar, Withnail-esque kind, a humour imbued with the spirit of former public schoolboys getting drunk and whispering to each other sotto voce, "Who is that extraordinary little man?" It's the humour of snobbery and humiliation. Yet in Powell's hands it is affectionate, while yet remaining genuinely cruel.

A Dance also benefits from the attentions of a stellar cast, drawn by the chance to make unfilmable literature look easy. Everywhere you look, a familiar face is turning in an exemplary cameo, from John Gielgud as

the narcissistic novelist St John Clarke, to Alan Bennett as the Oxford don "Sillers" Sillery, a man able to pull strings anywhere, from the Vatican to the TUC. Miranda Richardson slips into the role of Pamela Flitton, a psychotic nymphomaniac, while Paul Rhys is magnificent as the alcoholic Stringham, Jenkins's oldest friend.

But the star of the show, on screen as on the page, is Kenneth Widmerpool, played from the ages of 16 to 70 by Simon Russell Beale (currently turning in a pretty mean Iago in the National's new Othello). It is Widmerpool, first glimpsed lumbering through the mists at Eton, who comes in the end to dominate the dance. Vain, hideous and cruel, he is able to see off the more sexually successful of his school contemporaries, but nothing can spare him the agonies of his own love life. The scene in which he is forced to seek Jenkins's advice as to whether he should attempt "personal relations" with his rather more worldly fiancee before their wedding-night is one of the funniest in 20th-century literature, and Russell Beale does it full justice.

It remains to be seen whether A Dance to the Music of Time gives Channel 4 the sort of hit it may be hoping for as the station approaches its 15th anniversary. The locations - Eton, Oxford, Belgravia - are ideal. The interiors are lavish. But the failings of the book are hard to get away from on screen. Too many of the female characters appear merely as the agents of sexual retribution, while one irreproachable woman, the narrator's own wife (played first by Emma Fielding and then by Isobel Jenkins), is kept well away from all the nastiness. Her miscarriage, for example, is described only slightly less perfunctorily on screen than it is in the books. Moreover, there is nothing Whitemore can do about the fact that the first nine novels in the series are much better than the last three, at which point literary life comes to the fore and melodrama takes over.

Neither the era - the middle part of this century - or the setting - the upper fringes of English bohemia - are the ones that anyone hoping for a huge audience would choose. There are parties, there is sex, there are some lovely dinner jackets, but on the whole Powell's world can seem to be neither one thing nor the other, a bit dated for now, a bit dingy for then. And yet, A Dance succeeds in showing us a state of mind - observant, amused, mildly despairing, above all tinged with melancholy. Its era and its social setting have never been better done.

'A Dance to the Music of Time' (C4) begins on Thurs at 9pm. 'Brideshead Revisited' will be shown in its entirety at the NFT, SE1 (0171 928 3232), on Sun 12 Oct.

Tourists are limp, leaderless and distinctly UnAustralian

Andrew Grice: Inside Westminster

Blairites be warned, this could be the moment Labour turns into Syriza

The mystery of Britain's worst naval disaster is finally solved - 271 years later

Exclusive: David Keys reveals the research that finally explains why HMS Victory went down with the loss of 1,100 lives

'I saw people so injured you couldn't tell if they were dead or alive'

Nagasaki survivors on why Japan must not abandon its post-war pacifism

The voter Obama tried hardest to keep onside

Outgoing The Daily Show host, Jon Stewart, became the voice of Democrats who felt the President had failed to deliver on his ‘Yes We Can’ slogan. Tim Walker charts the ups and downs of their 10-year relationship on screen