The lines “And did those feet in ancient time, Walk upon England's mountains green?” open what is probably England's most rousingly patriotic anthem. And yet the name of the man who set William Blake's poem Jerusalem to music as England was mired in war is largely unknown today.

Sir Hubert Parry, who was born in 1848 and spent the latter 38 years of his life in Rustington, near Littlehampton, is Prince Charles's favourite composer, and the royal has become his most tireless promoter. Four pieces of Sir Hubert's music were played during the wedding ceremony of Charles and Diana in 1981, including I Was Glad, the coronation anthem for Edward VII , which also launched last year's wedding of Prince William and Kate Middleton, and which “gives you tingles up the spine, and tears in the the eyes”, says Charles.

So passionately does the prince feel about the Victorian composer and the lack of recognition for his work beyond Jerusalem that he made a BBC4 film called The Prince and the Composer because, the film's director John Bridcut said, “he felt Parry was a neglected figure who had written five marvellous symphonies, which hardly anyone has ever heard, with a quintessentially English flavour”. In fact, it wasn't until 2010 that Sir Hubert's 5th Symphony was heard for the first time at the BBC Proms, 98 years after it was written.

So it's fitting that almost a century after his death in 1918, Rustington Museum is telling the story of Sir Hubert's life in the village, and celebrates his works, in a new exhibition that runs until next Spring. “The exhibition tells the story of the time Sir Hubert spent in Rustington, once a sleepy village by the sea, and favoured at the turn of the century as a summer residence for many artists, writers and radical thinkers of the time,” says museum curator Jessica Petit. “The exhibition shows many original photographs of Sir Hubert and his family at Knights Croft House, the Arts & Crafts-style house he had built for him in Rustington. And it makes the connection with Parry and his circle of culturally elite friends who gathered in the village in the years before the First World War.”

The well-connected and charismatic Sir Hubert, the son of a Gloucestershire squire, surrounded himself with leading lights of the literati of the day: the artists Edward Burne-Jones and William Morris, Art Nouveau potter William de Morgan, the illustrator Arthur Rackham, and Peter Pan author J. M. Barrie, who holidayed in the village each summer with the du Maurier family.

Perhaps Sir Hubert needed the distraction of his friends. For although he was publicly feted and celebrated as the greatest English composer since Purcell, the 17th century Baroque master, his aristocratic wife Lady Elizabeth Maude Herbert, daughter of the statesman Sidney Herbert, had “no interest in music, who quickly found him tiresome and who, by the account of one of his sons-in-law, bullied and manipulated him”, as Simon Heffer put it in an article in the Telegraph.

Another account describes how the glamorous young man fell for the aristocratic teenager even though her mother felt he wasn't quite up to her social standard and tried to end their romance. But Sir Hubert was determined, meeting Maude in secret, and finally winning the approval of her mother. They married in 1872, but despite having two daughters, it was to be an unhappy marriage, and music became his refuge.

The youngest of six children of accomplished artist and musician Thomas Gambier Parry and Isabella Fynes-Clinton, Sir Hubert's mother died 12 days after giving birth to him. He grew up in the family's imposing Gloucestershire mansion with just one brother and one sister, as their other three siblings had all died in infancy, until his father married for a second time and had another six children.

Sir Hubert's passion for music was encouraged at Eton, and it was here that he first began to compose. So talented was he that he was the youngest person ever to sit and pass the Oxford Bachelor of Music exam. Despite this distinction, however, his father was determined he would take a different and steadier career path, and so at Oxford Parry studied law and history.

His musical ambitions continued to be thwarted, as in 1870 he took a job as underwriter at Lloyd's of London and, even though he proved to be an unsuccessful salesman of insurance, remained there for seven years, with the approval not just of his father but also his new in-laws.

But he pursued his interest privately, taking piano lessons with pianist Edward Dannreuther, who lived in Hastings and introduced Parry to the music of Wagner, and when Sir Hubert and his family moved into Knights Croft in 1880, he was inspired to write the music for three hymns called Amberley, Angmering and Rustington.

But even as his compositions began to achieve public recognition, he was once again diverted into an alternative career, appointed to the prestigious posts of Director of the Royal College of Music and Professor of Music at Oxford, where his powerful charms would inspire worship among his pupils, among them Ralph Vaughan Williams and Gustav Holst. Credited as heralding a renaissance in English music, many music experts would lament his development of the careers of other composers because it came at the expense of his own.

In his later years, his compositions were overshadowed by his own former pupils. He retired at 60 in 1908 and, as an ardent admirer of German classical music, was devastated when England and Germany went to war in 1914. He wrote the music for Jerusalem in 1916, two years before he succumbed to the Spanish flu epidemic and just five weeks short of the ceasefire in November 1918.

'Hubert Parry, an English composer in Rustington' Exhibition at Rustington Museum, 78 The Street, Rustington, until Spring 2013. Open Tues-Sats 10am-4pm. Free admission. Phone 01903 788478 or visit www.rustingtonpc.org