With the number of people who are living with dementia continuing to rise, scientists are looking for ways to prevent or delay it – and it appears that playing a musical instrument could be one approach worth exploring.

A team led by researchers from the University of Exeter in the UK analyzed data on 1,107 people over the age of 40 without a dementia diagnosis, mapping cognitive ability against self-reported musical ability, whether or not they played a musical instrument or sang in a choir, and their music listening habits.

The analysis showed "significantly better performance" in working memory and executive function from those who played a musical instrument, as well as associations between singing and executive function, and overall musical ability and working memory. There was no equivalent improvement based on music listening habits.

"A number of studies have looked at the effect of music on brain health," says Anne Corbett, a cognitive psychologist from the University of Exeter. "Overall, we think that being musical could be a way of harnessing the brain's agility and resilience, known as cognitive reserve."

This idea of cognitive reserve is exactly what it sounds like – a buffer against the effects of aging. The thinking is that people with a larger cognitive reserve, in part built up through lifestyle choices and activities, are less susceptible to diseases such as Alzheimer's.

Despite the strong links shown here, they don't prove cause and effect; other factors may be at play too. Those with a higher income might be able to afford both music lessons and a better quality diet, for example, and it could be the diet that is driving improved brain performance.

However, it makes sense that playing an instrument would help to keep the brain well exercised, and it's an association that has been spotted in several previous studies too – adding to the likelihood that there's something going on here.

"Although more research is needed to investigate this relationship, our findings indicate that promoting musical education would be a valuable part of public health initiatives to promote a protective lifestyle for brain health, as would encouraging older adults to return to music in later life," says Corbett.

If you're thinking of learning to play an instrument – or perhaps going back to one – the cognitive boost was highest when it came to the keyboard, with those who tinkled the ivories generally showing far better performance in all three working memory tasks.

Across all instruments, continuing to play in later life led to increased benefits.

One of the individuals the researchers contacted was 78-year-old Stuart Douglas from Cornwall in the UK, who plays the accordion in a band. He backed up the idea that regularly playing an instrument can keep the mind sharp in later life.

"We regularly play at memory cafes so have seen the effect that our music has on people with memory loss, and as older musicians ourselves we have no doubt that continuing with music into older age has played an important role in keeping our brains healthy," says Douglas.

The research has been published in the International Journal of Geriatric Psychiatry.