The phenomenal success of J R R Tolkien's literary work has now been translated to screen and stage. Simon Machin traces some Oxford connections, and examines the importance of war and song in Tolkien's writing.

Even world-weary London theatre critics, regular witnesses of the experimental if not the ground-breaking, have been somewhat taken aback that the records for the most spectacular, ambitious and expensive West End production ever mounted should fall this summer to The Lord of the Rings - the musical. Having been the subject of a critically acclaimed film trilogy, each part running to more than three hours, J R R Tolkien's magnum opus has now been shoe-horned into an evening's entertainment requiring a mere £12.5 million investment, a cast of 50 actors, more than 500 costumes and a 40-ton revolving stage.

To Tolkien purists, the prospect of singing and dancing Hobbits, even when camouflaged in production language as 'a musical play performed on an operatic scale with a lot of physical theatre', may seem beyond the pale. Yet the original written works contain their fair share of honest rustic song and merry-making, even if in spirit this is more closely aligned to the English Folk Dance and Song Society, founded in the year Tolkien first came to Oxford, than to Broadway musical block-busting. And recent research undertaken for a CD of classic songs from our Golden Age of writing for children has revealed a collaborative side to Tolkien's oeuvre, redolent of the common-room 'smoker' or informal concert, even a foray into composition - and, as it turns out, a distinctive Oxford legacy.

Tales of C S Lewis, Tolkien and friends drinking, when beer supplies permitted, on wartime Tuesdays in the 'Bird and Baby' - insider slang for the Eagle and Child Inn in St Giles' - have long passed into Oxford's literary mythology. What might have appeared then to observers as merely a weekly donnish ritual has since emerged as the proving ground for many works of enduring literary and religious significance. When it didn't meet in the pub, this literary society, the Inklings, convened in Lewis's rooms in Magdalen, so Lewis has generally been seen as its instigator and mainstay. Yet, at an earlier semi-formal conclave of English Faculty members, the Kolbatar (literally 'coal-biters'), formed by Tolkien to read Icelandic sagas, Lewis's attendance had only been an afterthought. This is a reminder of the even greater importance that the all-male reading group had, from adolescence until middle age, for the literary development of the author of The Lord of the Rings.

Tolkien's unusual upbringing featured many enforced exiles and made him, even for the time, unusually dependent on single-sex institutions. Orphaned at 12, his legal guardianship was conferred on a priest at the Birmingham Oratory, and his education lay in the hands of the city's prestigious King Edward's School. His bank manager father's health had been destroyed by overwork in the inhospitable climate of Bloemfontein, after he stayed on when the family returned to the West Midlands on home leave. His son's only memory was of his father painting 'A R Tolkien' on the family trunk prior to their departure. His mother's subsequent Catholic conversion (a faith that her son kept all his life) led to isolation from Nonconformist relations, poverty, regular changes of lodgings and unremitting domestic pressures which hastened an early death from diabetes. In this uncertain environment, the young Tolkien learned early to depend on similarly bookish school-friends, not only for intellectual stimulus but also for affection and encouragement.

His first literary society, the Tea Club Barrovian Society (TCBS), started as an illicit supper club in King Edward's library, when summer exams diverted schoolmasterly attention elsewhere, and it soon spread to the hard wooden settles of a nearby tea-room from whence came its mock-grand title. The scholars who formed its nucleus, Christopher Wiseman, Rob Gilson, Geoffrey Bache Smith and Ronald, as he was known, shared a knowledge of classical literature and openness to individual enthusiasms ranging from Renaissance painting to the natural sciences, music and English literature. Tolkien contributed recitations from Sir Gawain and the Green Knight (which he was to co-edit as an academic a decade later) and shared his already deep-rooted love of Norse mythology. The friendship survived the asymmetric translation of Tolkien and Smith to Oxford and Gilson and Wiseman to Cambridge. At Oxford, Tolkien helped form two dining and debating clubs, the Apolausticks, principally for freshmen, and the Chequers, but neither supplanted the TCBS, which still met in vacations to discuss literature and read work in progress. It was at its instigation that Tolkien first experimented with verse form alongside his development of invented languages. Even a few hours in the company of these school-friends gave inspiration, helping him voice 'all kinds of pent-up things'. He compared the group to the Pre-Raphaelite Brotherhood, although the others took this idea considerably less seriously.

Their fellowship was irrevocably disrupted by the Great War, and the status of junior officers put them disproportionately at risk. Tolkien never forgot the 'animal horror' of the trenches. Gilson died leading his men over the top on 1 July 1916, the first day of the Somme offensive. Soon afterwards, Smith was killed by a stray shell. Not long before, he had written to Tolkien insisting that death could not put an end to the 'immortal four' and urging him to complete a project that the TCBS had discussed. This was the creation of an epic, modelled on the Finnish Kalevala - an English mythology, made up of interconnected legend and folklore. Trench fever rescued Tolkien and returned him to England in November 1916 for the war's duration.

A pre-enlistment First in English Language and Literature had virtually assured Tolkien of an academic career. A readership took him to Leeds University, where the founding of the Viking Club for tutors and undergraduates to fraternise, drink beer, read sagas and sing comic songs helped make him a popular teacher. Back at Oxford in 1925 as Professor of Anglo-Saxon, his declamatory Beowulf lectures, re-enacting the bard in the mead hall, deeply impressed all who heard them; Auden later told Tolkien that his voice was the voice of Gandalf.

Silently, in parallel with academic responsibilities, and domestically, raising four children, the creative processes of Tolkien's mind, like a seed germinating in the dark, slowly developed the languages and lore of Middle Earth. Meetings of the Inklings in the 1930s and '40s heard early drafts of The Hobbit and The Lord of the Rings, providing the most congenial environment for their propagation, since all members shared a common respect for mythmaking. In a sense, the regular weekly gatherings, ranged round a blazing coal fire, drinks at their elbow, listening to his work amid curls of pipe-smoke, provided a comforting warmth against the chill draughts of literary modernism, since, unlike Eliot, Tolkien's intention was never so much to purify the dialect of the tribe as literally to preserve it.

The urge to conserve, against the threat of imminent loss, is perhaps experienced most keenly by a wartime generation. Tolkien, Lewis and their circle had consciously distanced themselves in dress and outlook from the flamboyant Bright Young Things of the Betjeman-Acton-Waugh set and the politically radical undergraduates of the 1930s. A second European war placed dons on an equal footing with undergraduates, freeing them from decades of collective self-censorship. Although Tolkien always dismissed allegorical interpretation, a wartime letter to his son and fellow Inkling, Christopher, describes the battle against Nazism as 'attempting to conquer Sauron with the Ring'. And he further acknowledged how, in the Great War, the genesis of his mythology had taken place as an act of mental displacement in canteens, by candle-light in bell-tents, and even in dugouts under shell-fire.

Perhaps it was the shared experience of an Oxford education disrupted by war that unconsciously attracted Donald Swann (Christ Church 1941), the composer and performing partner of Michael Flanders (Christ Church 1940), to The Lord of the Rings, which he re-read every spring. Conversely, it should be no surprise that a writer who specialised in gentle philological puns would be an ardent admirer of Flanders' adroit wordplay.

Swann's affinity with Tolkien's writings was eventually expressed in a song cycle, The Road Goes Ever On. They struck up a friendship, Tolkien providing his imprimatur prior to publication with one minor revision. This was for 'Namárië', a farewell lament in Elvish, for which Tolkien suggested a replacement melody in the style of Gregorian chant, to which Swann assented. As this is sung unaccompanied, both words and music are effectively Tolkien's. Swann subsequently performed the completed work at the Tolkiens' golden wedding celebration at Merton College in 1966, accompanying the bass baritone William Elvin. 'A name of good omen', Tolkien wryly observed beforehand.

Swann viewed Tolkien's work not as escapist fantasy, but as a paradigm of human life with its sense of destiny and purpose. An unprepossessing hero, Frodo, is scarred permanently by his quest, as many veterans were by war experience; this loosens his attachment to the Shire. After Tolkien's death, his secretary handed Swann the unpublished 'Bilbo's Last Song'. Swann set and then appended it to the song-cycle. Its closing words - 'Lands there are to West of West, / Where night is quiet and sleep is rest' - encapsulate the valedictory quality of Tolkien's magnum opus, its 'Northernness' and other-worldly longing. Later, Swann was moved to sing it at the Commemoration for Michael Flanders. 'Namárië' resurfaced at a Holywell Music Room concert earlier this year, its performer, Roderick Williams commenting that Oxford was possibly the only place where it could be taken for granted that the audience would understand the lyrics.

Simon Machin (CCC 1978) collaborated on a recently released CD of classic children's songs for voice and piano for Just Accord Music.