Introduction

Aging is a major omni comprehensive phenomenon which brings new challenges and places a large financial burden on society1,2. Research into both healthy and pathological aging is crucial to understand changes in brain function and structure across the lifespan and to eventually identify early markers of the age-related neural decline. Aging is commonly associated with a progression in brain atrophy, reduced neuronal plasticity, and cognitive deterioration in domains such as decision-making, attention, problem-solving, and memory3,4,5,6. However, despite the collective importance of these cognitive domains in daily functioning, developing a unified theoretical framework for cognitive aging poses a scientific challenge due to substantial interindividual variability and varying rates of decline across cognitive domains. Nevertheless, various theories have been proposed. For example, the Compensation-Related Utilization of Neural Circuits Hypothesis (CRUNCH)7, Hemispheric Asymmetry Reduction in Older Adults (HAROLD)8, and Posterior-Anterior Shift in Aging (PASA)9 successfully addressed cognitive and neural changes occurring in aging but fell short of explaining variability between individuals or across different cognitive domains. In contrast, the Cognitive Reserve (CR) theory10 and the revised Scaffolding Theory of Aging and Cognition (STAC-r)11 offered more comprehensive frameworks able to capture the complexity of cognitive aging by emphasising external factors influencing individuals’ compensatory abilities for cognitive disturbances.

More specifically, the CR theory asserts that cognitive reserve, accumulated through lifestyle choices and socioeconomic factors, enhances cognitive and neural flexibility, allowing individuals with similar age-related structural brain changes to vary significantly in cognitive performance. Conversely, the STAC-r theory emerged as a dynamic model of cognitive aging asserting that cognitive function in aging is governed by a balance between adverse and compensatory neural processes. It emphasises the role of compensatory scaffolding, which supports cognitive performance despite aging-related neural challenges and brain deterioration. This compensatory process involves recruiting additional brain regions such as bilateral frontal areas, strengthening existing neural networks, and possibly even promoting neurogenesis through neuroplastic mechanisms influenced by lifestyle factors.

Empirical support for these theories spans behavioural, neurophysiological, and neuroimaging studies. On a behavioural level, empirical data supported the notion that engaging in cognitive enriching activities can significantly enhance cognitive functions in the older adults. More specifically, lifestyle factors such as active intellectual, social, and physical engagement, all of which are proxies for a higher cognitive reserve, were repeatedly associated with improved cognitive performance12,13,14 as well as lower risk of developing Alzheimer’s disease15,16,17 and delayed dementia onset15,18,19. As summarised by Reuter-Lorenz & Park (2014), evidence for compensatory scaffolding was also found in the neuroimaging literature demonstrating that older adults exhibited greater activation or additional recruitment of prefrontal and parietal brain regions during cognitive tasks, compared to younger adults9,20,21. Compensatory mechanisms have also been characterised by a shift to bilateral brain activation during tasks that typically induce lateralised activity in younger individuals9,11,22,23. Such patterns of brain activity were confirmed through meta-analyses, highlighting their widespread occurrence across different cognitive domains including perception, memory, and executive functions24. Here, of particular relevance for the topic of our research are a series of longitudinal studies which have examined music-related changes in the brains of healthy older adults and demonstrated that cognitive stimulation through music preserves or even enhances cognitive performance (for a review, see Refs. 25,26). For instance, Worschech, Marie, Junemann, Sinke, Kruger, Grossbach, Scholz, Abdili, Kliegel, James and Altenmuller27 demonstrated that healthy older individuals who underwent six months of musical training showed marked improvements in speech perception, a key component of cognitive reserve. Other longitudinal studies have observed significant increases in grey matter28 and cortical thickness within bilateral auditory brain structures29. Similarly, it has been shown evidence of stabilisation of white matter microstructure in the fornix30 after six months of piano training and improved fine motor control in older adults after one year of piano lessons31. These studies also showed evidence for increased functional connectivity in the right dorsal auditory stream after one ear’s piano training in older adults32. Such morphological changes highlighted the profound impact of engaging in enriching activities like music on brain plasticity and may additionally shed light into how lifestyle factors contribute to the maintenance of cognitive functions and the mitigation of cognitive decline, providing support for the key tenets of the CR and STAC-r theories of cognitive aging. These findings underscored the potential of lifestyle interventions to foster cognitive resilience against age-related declines and neurodegeneration. Along this line, additional neuroimaging studies have highlighted how older adults may exhibit greater or different patterns of brain activation compared to younger adults. For instance, recent neuroimaging research has used magnetic resonance imaging (MRI) and functional MRI to detect age-related neuroplastic adaption that may serve as compensatory mechanisms33,34.

Similarly, neurophysiological evidence from electroencephalography (EEG) studies supports the idea of scaffolding by detecting age-related compensatory activity. A recent study35 on the role of APOE ε4 status—a genetic marker linked to Alzheimer’s disease—found that healthy individuals without the APOE ε4 allele exhibited increased cerebellar activity indicative of compensatory neural mechanisms which were not present in healthy individuals carrying the gene. This differential response highlighted the influence of genetic factors on the brain’s ability to employ compensatory mechanisms in the face of aging. Moreover, ERP and microstate analyses of EEG data has found differences in neural responses to age-related neural changes across different cognitive demands36. MEG studies investigating the spatial-temporal dynamic of neural recruitment in older adults has also found additional recruitments in frontal, temporal, and parietal regions in older compared to younger adults37, supporting the notion of compensatory mechanisms though cognitive control processes. Moreover, neurophysiological studies indicated that aging impacts evoked responses, such as the mismatch negativity (MMN). The MMN is a component of the event-related potential/field (ERP/F) that arises automatically in response to deviant auditory stimuli and is widely used as an index for auditory sensory memory38. Notably, several studies suggested that aging associates with attenuated MMN responses, characterised by decreased amplitudes and prolonged latencies, indicative of altered sensory memory traces in older adults. For instance, using MEG, Cheng and colleagues39 showed a reduction in the fronto-temporo-parietal activity underlying MMN in response to pitch changes in older compared to young participants. In another MEG study, the authors40 revealed that longer peak latencies and smaller amplitudes were found in the MMN of older versus young adults. Similarly, in an EEG study, Kisley and colleagues41 showed that older adults presented reduced MMN amplitude at fronto-central sites and decreased sensory gating efficiency compared to younger adults. Taken together, these findings suggest that aging is associated with declines in automatic predictive processes in the auditory domain and with a mild decline of the cognitive ear, possibly related to slow brain atrophy typical of aging42.

In summary, extensive neurophysiological and neuroimaging research has explored the brain changes associated with aging, highlighting alterations in automatic predictive mechanisms. Despite these advancements, the impact of aging on conscious predictive processes, particularly pertaining to the long-term recognition of previously memorised auditory sequences, remains poorly understood. Addressing this critical gap, in the current study we used a validated paradigm that was previously employed in samples composed only by young participants in combination with state-of-the-art neuroimaging techniques to study the brain dynamics of healthy older and young adults as they recognised musical sequences. These previous studies in young healthy participants showed that encoding of sounds recruited a large network of functionally connected brain areas, especially in the right hemisphere, such as Heschl’s and superior temporal gyri, frontal operculum, cingulate gyrus, insula, basal ganglia, and hippocampus43. Similarly, long-term recognition of short musical sequences recruited nearly the same brain network, displaying hierarchical dynamics from lower- to higher-order brain areas during recognition of musical sequences44,45,46. In particular, our most recent research has revealed faster (150–250 ms from the onset of the tones) and negative responses to the tones forming the varied musical sequences, in contrast to slower (300–400 ms from the onset of the tones), positive signals generated by the brain when recognising previously memorised musical sequences47.

Given the theoretical framework provided by the STAC-r theory11, which highlights compensatory scaffolding mechanisms, we hypothesised that the aging brain exhibits a functional reorganisation of the networks highlighted in our previous studies on memory recognition of musical sequences44,45,46,47. Indeed, we expected that such transformation in neural predictive processes during aging would not merely show a reduction in the amplitude of the brain signal, but a qualitative change, leveraging compensatory mechanisms. In particular, we hypothesised that during the recognition of musical sequences, the older adults’ brain would be characterised by reduced activity in regions of the medial temporal lobe (e.g. hippocampus and inferior temporal cortex) and increased, compensatory activity in the auditory cortex.

Results

Overview of the experimental design and analysis pipeline

In this study, we investigated the impact of aging on the fast-scale spatiotemporal brain dynamics underlying recognition of previously memorised musical sequences. In brief, during magnetoencephalography (MEG) recordings, two groups of participants (39 older adults [older than 60 years old] and 37 young adults [younger than 25 years old]) listened to the first musical sentence of the Prelude in C minor, BWV 847 by Johann Sebastian Bach and were instructed to memorise it to the best of their ability. As shown in Fig. 1 and Supplementary Fig. 1, participants were subsequently presented with five-tone musical excerpts (M) taken from the music they previously memorised and with carefully matched variations. The variations consisted of five-tone musical sequences generated by systematically altering the M sequences after either the first (NT1) or third (NT3) tone. For each musical sequence, participants were requested to assess whether the sequence was taken from the memorised musical piece (M) or whether it was new (N). Additional details on the stimuli are available in the Methods section. Key background information on the two samples of participants is reported in Supplementary Table 1.

Fig. 1: Experimental design, stimuli, and analysis pipeline.
figure 1

a Thirty-seven young and 39 older adults were invited to participate in the experiment. b The brain activity of the participants was collected using magnetoencephalography (MEG), while their structural brain images were acquired using magnetic resonance imaging (MRI). c Participants were requested to memorise a short musical piece (lasting about 30 s). Then, we used an old/new auditory recognition task (left). Here, one at a time, five-tone temporal sequences (i.e., musical melodies) were presented in randomised order and participants were instructed to respond with button presses whether they were taken from the musical piece they previously memorised (‘old’ or memorised musical sequences, ‘M’) or they were novel (‘new’ musical sequences, ‘N’). Three types of temporal sequences (M, NT1, NT3) were used in the study. The figure shows a graphical depiction of how the novel musical sequences were created with regards to the previously memorised ones (right). The N sequences were created through systematic variations of the M sequences. For example, in the middle row, it is depicted a sequence (NT1) where we changed all tones but the first one (indicated by the red colours). Likewise, the bottom row shows a sequence where we changed only the last two tones (NT3). d After pre-processing the MEG data, we co-registered it with the individual anatomical MRI data and reconstructed its brain sources using a beamforming algorithm. This procedure returned one time series for each of the 3559 reconstructed brain sources. e We constrained the source reconstructed data to eight brain regions of interest (ROIs) which were selected based on previous literature (left). For each of the ROI, we studied the differences over time between the brain activity of young versus older adults (right).

The analysis pipeline of this study is partly depicted in Fig. 1. Initially, we conducted an analysis of the participants’ behavioural performance (Fig. 2). Subsequently, the pipeline involved contrasting the brain activity of young versus older adults at MEG sensor and source levels (Figs. 36, Supplementary Figs. S2S6). This dual-level analysis is considered best practice in MEG research as it ensures comprehensive data disclosure and allows verification that the results in the MEG source space are consistent with those obtained at the MEG sensors48,49.

First, we used Monte Carlo simulations (MCS) on univariate tests of event-related field (ERF) MEG sensor data. This was followed by estimating the sources of the brain activity which generated the differences between young and older adults. Second, we focused on eight key regions of interest (ROIs) which were identified based on their functional properties in our latest study47 on music recognition. Here, we analysed whether their time series differed between older and young adults. Third, we assessed the impact of WM, years of general and musical education, sex, and age groups on the brain activity underlying recognition of the musical sequences.

Behavioural results

We calculated the impact of age on response accuracy and reaction times during the musical recognition task that participants performed in the MEG.

Regarding the response accuracy, there was a statistically significant difference between the two age groups in the memory task (F(3, 61) = 7.18, p < 0.001, Wilks’ Λ = 0.739, partial η2 = 0.26). Follow-up ANCOVAs showed that older adults scored lower than young adults when correctly identifying NT1 (F(1, 63) = 13.03, p < 0.001) and NT3 sequences (F(1, 63) = 19.89, p < 0.001). Years of education (F(3, 61) = 3.37, p = 0.02, Wilks’ Λ = 0.857, partial η2 = 0.14), WM scores (F(3, 61) = 7.07, p < 0.001, Wilks’ Λ = 0.742, partial η2 = 0.26), and years of musical training (F(3, 61) = 4.61, p = 0.005, Wilks’ Λ = 0.815, partial η2 = 0.18) were statistically significant covariates. Specifically, years of education had a statistically significant effect on correctly identifying M (F(1, 63) = 4.58, p = 0.03) and NT1 sequences (F(1, 63) = 6.52, p = 0.01), meaning that higher number of years of education was associated to higher number of correct responses. Similarly, WM capacity had a statistically significant positive effect on correctly identifying NT1 (F(1, 63) = 14.31, p < 0.001) and NT3 sequences (F(1, 63) = 19.24, p < 0.001). Finally, years of musical training had a statistically significant positive effect on correctly identifying NT1 (F(1, 63) = 5.45, p = 0.02) and NT3 sequences (F(1, 63) = 13.80, p < 0.001).

With respect to the average reaction time during recognition of M, NT1 and NT3 sequences, we found a statistically significant difference between the two age groups on the reaction times (F(3, 64) = 2.904, p = 0.04, Wilks’ Λ = 0.880, partial η2 = 0.12). However, this effect was non-significant in follow-up ANCOVAs. Regarding the covariates, only WM scores had a significant effect on the dependent variables (F(3, 64) = 5.18, p = 0.002, Wilks’ Λ = 0.804, partial η2 = 0.20). In particular, we observed that high WM scores were associated with lower average reaction time when correctly identifying NT1 (F(1, 66) = 10.96, p = 0.001) and NT3 sequences (F(1, 66) = 4.29, p = 0.04).

Fig. 2: Impact of aging, education, musical training and WM on the recognition of musical sequences.
figure 2

a Raincloud plots show the overlapping distributions and normalised data points of both age groups with regards to the recognition of the previously memorised and novel (NT1 and NT3) musical sequences. Boxplots show the median and interquartile (IQR, 25–75%) range, whiskers depict the 1.5*IQR from the quartile. Each dot corresponds to the number of correct responses (top plot) or the mean reaction time (bottom plot) of each participant (n = 76). The plot above refers to the number accuracy in the task, while the bottom plot to the reaction times. b Correlation matrix between memorised, NT1, NT3 (number of correct responses, top plot, and reaction times, bottom plot), years of education, WM, years of musical training. Significant correlations are indicated by the stars (*p < 0.05; **p < 0.01; ***p < 0.001).

Aging and whole-brain activity

To assess the difference between the brain activity of older and young adults while they recognised the musical sequences, we calculated several independent samples t-tests with unequal variances and then corrected for multiple comparisons using cluster-based MCS (t-test threshold = 0.05, MCS threshold = 0.001, 1000 permutations). As reported in detail in the Methods section, this procedure was computed independently for the three experimental conditions (M, NT1, NT3).

The analyses returned several significant clusters, highlighting overall reduced brain activity along a wide array of MEG sensors in older participants. In addition, a few significant clusters showed stronger brain activity in older participants. Supplementary Table 2 shows the key information of the larger significant clusters for the three experimental conditions, while Supplementary Table 3 provides complete statistical information.

After analysing the brain activity at the MEG sensor level, we computed source reconstruction analyses using a beamforming algorithm to estimate the brain sources that generated the signal recorded by the MEG sensors. For each of the significant clusters, we contrasted the source-reconstructed brain activity of older versus young adults and corrected for multiple comparisons using a three-dimensional (3D) cluster-based MCS (α < 0.05, MCS p-value = 0.001). These analyses returned several significant clusters of brain activity, revealing that the main brain regions differentiating older from young adults were the primary and secondary auditory cortices, post-central gyrus, hippocampal regions, inferior frontal gyrus, and ventromedial prefrontal cortex. These results are depicted in Figures S3, S4 and reported in detail in Supplementary Tables 4, 5.

Aging and functional brain regions of interest (ROIs)

To strengthen the reliability of our results and allow an easier comparison with previous literature, we computed a complementary analysis by investigating the difference between the brain activity of older versus young adults in a selected array of functional ROIs that were previously described by Bonetti and colleagues47. These areas (described in detail in Supplementary Table 6 and shown in Supplementary Fig. 2) were the bilateral medial cingulate gyrus (MC), bilateral ventromedial prefrontal cortex (VMPFC), left (HITL) and right hippocampal area and inferior temporal cortex (HITR), left (ACL) and right auditory cortex (ACR), and left (IFGL) and right inferior frontal gyrus (IFGR). We contrasted the brain activity of young versus older adults by computing an independent-sample t-test for each ROI, timepoint, and condition. We corrected for multiple comparisons using 1D cluster-based MCS (t-value threshold = 0.05, MCS p-value = 0.001).

This analysis returned several significant clusters showing differences in the brain activity of older compared to young adults. Of particular interest are the clusters reported in the HITR (p < 0.001, k = 25; max t-val = 4.70, time: 640–736 ms) and IFGR (cluster 1: p < 0.001, k = 38; max t-val = −4.59, time: 464–612 ms; cluster 2: p < 0.001, k = 33; max t-val = −5.04, time: 1260–1388 ms) showing reduced activity for older versus young adults when recognising previously memorised musical sequences. In addition, older versus young participants were characterised by a weaker signal in response to the variation of the original musical sequences. This was particularly evident for HITR (NT1: p < 0.001, k = 24; max t-val = −3.53, time: 1284–1376 ms; NT3: p < 0.001, k = 21; max t-val = −4.01, time: 1320–1400 ms), VMPFC (NT1: p < 0.001, k = 15; max t-val = −3.57, time: 1320–1376 ms; NT3: p < 0.001, k = 23; max t-val = −3.97, time: 1672–1760 ms), and HITL (NT3: p < 0.001, k = 12; max t-val = −3.31, time: 1324–1368 ms).

Finally, older adults showed a stronger activity in ACL in response to the first tone of the sequences in all conditions (M: p < 0.001, k = 14; max t-val = 5.37, time: 84–136 ms; NT1: p < 0.001, k = 15; max t-val = 5.86, time: 88–144 ms; NT3: p < 0.001, k = 16; max t-val = 6.04, time: 84–144 ms) and in relation to each tone until the variation was introduced (Fig. 3, first row). These results are depicted in Figs. 3, 4 and extensively reported in Supplementary Table 7.

Fig. 3: Older adults show stronger activity in auditory cortex and reduced responses in medial temporal lobe during recognition of musical sequences.
figure 3

a The results show that the older (n = 39) compared to young (n = 37) adults have significantly stronger activity in the left auditory cortex compared to young adults only when recognising the melodies that were previously memorised. In fact, the top graphs indicate a component occurring about 300 ms after the onset of each tone that was stronger for the older adults for all the tones in the M condition and for all the tones before introducing the variations in the N conditions (i.e. one tone for NT1 and three tones for NT3). In addition, the N100 response to the first tone of the sequences was significantly stronger for old versus young adults in all conditions. b Conversely, older adults showed significantly decreased activity in the hippocampal and inferior temporal regions. This was particularly evident for conditions NT1 and NT3. Here, as highlighted by the red bottom graphs, the older versus young adults exhibited reduced prediction error responses when the sequence was varied. This happened especially for the first tone which introduced the variation in the melodies (i.e. tone two for NT1 and tone four for NT3). Finally, even if to a smaller extent, reduced activity in older adults was also observed for the M condition, where positive components of the neural signals were reduced for all the tones except for the first one. Note that the figure shows the source localised brain activity illustrated for each experimental condition (M, NT1, NT3) in four ROIs (left and right auditory cortex, left and right hippocampal and inferior temporal regions). Grey areas show the statistically significant differences of the brain activity between young (solid red line) and older adults (solid blue, shading indicates standard error in both cases), while red and blue graphs highlight neural components of particular interest. The sketch of the musical tones represents the onset of the sounds forming the musical sequences. The brain templates illustrate the spatial extent of the ROIs.

Fig. 4: Impact of aging on the cingulate gyrus, ventromedial prefrontal cortex and inferior frontal gyrus responses during recognition of musical sequences.
figure 4

The red graphs in the second row highlight that the VMPFC produced a weaker activity indexing prediction error for the older (n = 39) versus young (n = 37) adults for conditions NT1 and NT3, in an analogous manner to the right hippocampal and inferior temporal regions shown in Fig. 3. Notably, while these two brain regions also showed a decreased activity for the M condition for older versus young adults, this did not happen for the VMPFC. Finally, the last row of this figure shows a much stronger activity originated in the right inferior frontal gyrus of the young versus older adults. This was particularly evident for the M sequences and consisted of a negative component peaking approximately 250 ms after the onset of each musical tone. Note that the figure shows the source localised brain activity illustrated for each experimental condition (M, NT1, NT3) in four ROIs (medial cingulate gyrus, ventromedial prefrontal cortex [VMPFC], left and right inferior frontal gyrus). Grey areas show the statistically significant differences of the brain activity between young (solid red line) and older adults (solid blue, shading indicates standard error in both cases), while red and blue graphs highlight neural components of particular interest. The sketch of the musical tones represents the onset of the sounds forming the musical sequences. The brain templates illustrate the spatial extent of the ROIs.

WM, musical expertise, education level, aging and neural data

Finally, we computed two additional analyses to assess whether potential confounding variables had an impact on the relationship between aging and the neural mechanisms underlying recognition of musical sequences.

In the first analysis we computed three independent multivariate analyses of covariance (MANCOVAs), one for each experimental condition. In each MANCOVA, the dependent variables were the highest peaks of the neural data for the eight ROIs, while the independent variables were age, sex, years of formal musical expertise, WM, and years of formal education (see Methods for additional details).

The results of the MANCOVAs showed a significant main effect for age in all experimental conditions: M (F(8, 59) = 4.62, p = 0.0002, Wilks’ Λ = 0.614, partial η2 = 0.39), NT1 (F(8, 59) = 3.117, p = 0.005, Wilks’ Λ = 0.703, partial η2 = 0.30), and NT3 (F(8, 59) = 3.575, p = 0.002, Wilks’ Λ = 0.674, partial η2 = 0.33). This confirmed the impact of age on the neural data. The other variables did not show any significant results, indicating that no confounding variables affected the relationship between age and the neural data. However, WM approached the significance in all experimental conditions, showing moderate effect sizes: M (F(8, 59) = 4.62, p = 0.09, Wilks’ Λ = 0.802, partial η2 = 0.20), NT1 (F(8, 59) = 1.313, p = 0.25, Wilks’ Λ = 0.849, partial η2 = 0.15), and NT3 (F(8, 59) = 1.691, p = 0.11, Wilks’ Λ = 0.814, partial η2 = 0.19). This indicated that WM may partially affect the brain dynamics of musical recognition in relation to aging.

Following the results of the MANCOVAs, we computed independent analyses of variance (ANOVAs) for each time-point, ROI and condition and used cluster-based 3D MCS to correct for multiple comparisons. We used two-way ANOVAs with the following levels: WM (high and low performers) and age (older and young adults). The analysis returned significant key clusters for three main ROIs in the NT3 condition: HITR (NT3: p < 0.001, k = 40; max F-val = 17.66, time: 1308–1464 ms), VMPFC (NT3: p < 0.001, k = 32; max F-val = 13.57, time: 1300–1424 ms), HITL (NT3: p < 0.001, k = 24; max F-val = 9.36, time: 1304–1396 ms). Figure 5 show the time series of these ROIs in relation to age and WM, while detailed statistical results are reported in Supplementary Table 8.

Fig. 5: Impact of WM and aging on the ventromedial prefrontal cortex and medial temporal lobe responses during recognition of musical sequences.
figure 5

The black graphs in the NT3 plots (all rows) highlight that the strongest brain prediction error in response to the variation of the original musical sequences occurred in young adults who performed very well in the WM tasks. The strength of the prediction error was lower and very similar for young adults with low WM (n = 17) and older adults with high WM (n = 17). Finally, older adults with low WM (n = 22) presented the most reduced prediction error signal in the brain, while young adults with high WM the strongest (n = 17). This was particularly evident for the right hippocampal and inferior temporal regions as well as for the VMPFC. A similar, but less pronounced, effect was observed in the VMPFC for M and NT1. The figure shows the source localised brain activity illustrated for each experimental condition (M, NT1, NT3) in three (ventromedial prefrontal cortex [VMPFC], left and right hippocampal and inferior temporal regions). Graphs indicates the key event of interest in the brain responses, while the three lines show the statistically significant effect of the ANOVAs conducted for each time-point and corrected for multiple comparisons using cluster based MCS. Here, o indicates the main effect of age, + the main effect of WM and * the interaction age x WM. Solid line indicates the average over participants, independently for the four groups, while the shaded area the standard errors. The sketch of the musical tones represents the onset of the sounds forming the musical sequences. The brain templates illustrate the spatial extent of the ROIs.

We computed an additional sub-analysis to assess whether we could distinguish a sub-sample of the older participants based on their brain activity. To this aim, we used one-way ANOVAs contrasting three age-groups: young (younger than 25), older adults 60–68 (age between 60 and 68, n = 23) and older adults >68 (older than 68, n = 16). Then, we corrected for multiple comparisons with cluster-based 3D MCS. The results highlighted that the oldest group within the older adults was characterised by overall reduced brain activity, especially in response to the variation of the original sequences. This was particularly evident for HITR (NT3: p < 0.001, k = 22; max F-val = 7.92, time: 1312–1396 ms), VMPFC (NT3: p < 0.001, k = 15; max F-val = 7.73, time: 1320–1376 ms), HITL (NT3: p < 0.001, k = 13; max F-val = 10.01, time: 1316–1364 ms). Figure 6 shows the time series of these ROIs in relation to the three age groups, while detailed statistical results are reported in Supplementary Table 9.

Finally, we computed two additional analyses. The first one aimed to assess whether the level of dissonance of the novel sequences affected the neural signal. Here, we first divided the novel melodies in two sub-categories: in-key and out-of-key and then computed one two-way ANOVA for each time-point, ROI and category of novel sequences (i.e. NT1 and NT3). The levels of the ANOVAs were age (older and young) and musical key (in-key and out-of-key). The results of the ANOVA (main effects for age and musical key and interaction age x musical key) were corrected for multiple comparisons using a one-D MCS (α = 0.05, MCS p-value = 0.001). This analysis revealed a few significant clusters indicating an overall increase in prediction error in response to the out-of-key melodies, especially in the young adults. The results are illustrated in Supplementary Fig. 5 and described in detail in Supplementary Table 10. The second analysis aimed to assess whether the familiarity of the participants with the Bach’s prelude before joining the experiment affected the brain signal. Here, we computed a correlation between the brain signal recorded at each time-point, ROI and experimental condition and the self-reported familiarity of the participants with the Bach’s prelude and corrected for multiple comparisons using one-D MCS (α = 0.05, MCS p-value = 0.001). This analysis only returned a few, scattered clusters which are illustrated in Supplementary Fig. 6 and reported in detail in Supplementary Table 11.

Fig. 6: Ventromedial prefrontal cortex and medial temporal lobe responses during recognition of musical sequences for three age groups (young adults, adults between 60 and 68 years of age, adults older than 68).
figure 6

The black graphs in the NT1 and NT3 plots (all rows) highlight that the strength of the brain prediction error in response to the variation of the original musical sequences was modulated by age. In fact, the strongest signal was recorded for the young adults (n = 37). A reduced prediction error was observed for the adults aged between 60 and 68 (n = 22), while the weakest signal occurred for the adults older than 68 years (n = 17). As observed for the WM in Fig. 5, this effect was particularly evident for the VMPFC and right hippocampal and inferior temporal regions. Note that the figure shows the source localised brain activity illustrated for each experimental condition (M, NT1, NT3) in three (ventromedial prefrontal cortex [VMPFC], left and right hippocampal and inferior temporal regions). Graphs indicates the key event of interest in the brain responses, while the grey areas show the statistically significant differences of the brain activity between the participants grouped in the following three groups: young adults (i), adults between 60 and 68 years of age (ii), adults older than 68 years (iii). Solid line indicates the average over participants, independently for the four groups, while the shaded area the standard errors. The sketch of the musical tones represents the onset of the sounds forming the musical sequences. The brain templates illustrate the spatial extent of the ROIs.

Discussion

In this study, we have investigated the age-related neurophysiological changes underlying the recognition of previously memorised and novel musical sequences. Our findings challenge simplistic notions that non-pathological aging merely diminishes neural predictive capabilities by showing age-related reorganisation of the brain functioning during predictive and memory processes.

During the recognition of the previously memorised melodies, the left auditory cortex exhibited stronger activity in response to each sound of the sequence for the older compared to young adults. Conversely, other brain regions of key importance for memory and predictive processes such as the hippocampus, inferior temporal cortex and inferior frontal gyrus showed an overall decreased activity for the older adults. In response to the varied musical sequences, the left auditory cortex did not exhibit any difference between older and young adults after the musical sequence was altered. Conversely, a much-reduced activity generated by prefrontal regions and the medial temporal lobe was observed for the older adults after the sequence was changed. This effect was particularly strong for the condition NT3 where the sequence was altered after the fourth tone, and it primarily regarded hippocampus, inferior temporal cortex and ventromedial prefrontal cortex.

Working memory (WM) abilities also affected the brain responses, especially for the condition NT3, both in older and young individuals. The brain activity after varying the original musical sequence was reduced for participants with lower WM skills.

In relation to the behavioural responses, no differences between older and young adults were found when inspecting the accuracy and reaction times associated with the recognition of the previously memorised sequences. Conversely, older adults reported lower accuracy when recognising the varied musical sequences (both NT1 and NT3). No differences were observed for the reaction times.

As expected, the results of this study are consistent with our previous research on the brain dynamics underlying the encoding and recognition of musical sequences in healthy young individuals, which showed that the recognition of the previously memorised and varied musical sequences is built over time through a rapid hierarchical pathway of components originated in the auditory cortex and progressing to the hippocampus, ventromedial prefrontal cortex and inferior temporal cortex43,44,45,46,47,50,51. Beyond this, the most notable finding of the current study is the altered brain functioning observed in older compared to young adults. On the one hand, this was related to an overall reduction of the brain activity generated in memory-related brain regions, supporting previous findings which reported diminished brain responses in aging populations in a variety of different contexts, spanning from resting state to automatic neural responses and conscious tasks39,40,52,53,54,55,56,57. On the other hand, only for the recognition of the previously memorised sequences, older adults showed increased activity in the left auditory cortex. This phenomenon was observed for the N100 component to the first sound, as well as for the positive component peaking around 350–400 ms after each sound of the sequence. Here, while the increased N100 aligns with previous evidence of enhanced sensory-evoked responses associated with aging58, the increased amplitude of the later component, peaking at 350–400 ms, offers a notable addition to the literature. This altered brain functioning supports the hypothesis that neural predictive processes in non-pathological aging are not simply reduced, but qualitatively transformed59. This result aligns with the STAC-r theory11,37, which emphasises the role of compensatory scaffolding in aging brains. According to this theory, compensatory scaffolding involves recruiting additional brain regions to successfully perform activities and complex tasks. In the current study, the additional recruitment of the left auditory cortex likely serves as a compensatory mechanism to offset the reduced functionality observed in the medial temporal lobe regions, such as the hippocampus and inferior temporal cortex. This finding can also be interpreted through the HAROLD theory8,33, which proposes that aging leads to a reduction in the asymmetrical activation of the brain’s hemispheres during cognitive tasks. Interestingly, our study observed a different effect: the enhanced activity in the left auditory cortex of the older adults was not accompanied by a similar response in the right auditory cortex. This might seem surprising but can be explained by the specific nature of our stimuli, which are musical sequences. It is well-established that musical material is processed differently by the two hemispheres, with the right hemisphere primarily involved in holistic music listening, while the left hemisphere is more critical for conscious, linguistic evaluation of musical sequences60,61,62. Given that our memory task required participants to actively extract information from the musical sequences, it is conceivable that the left auditory cortex exhibited compensatory mechanisms in older adults, whereas the right auditory cortex showed only marginal differences between older and young adults. This interpretation is further supported by Zatorre and colleagues’ studies63,64,65 on hemispheric differences in music and auditory processing, which indicate that the degradation of temporal features of auditory information primarily affects the left auditory cortex, impairing the brain’s ability to understand speech and extract linguistic and musical information from acoustic material. This degradation does not impact the right auditory cortex in the same way. Therefore, in our study, the reliance on the left auditory cortex to extract meaningful information from musical sequences, and the enhanced activity observed in this region among older adults, may align with the need to compensate for reduced functionality in the temporal lobe regions.

Another essential brain region for understanding and producing language and music is the inferior frontal gyrus66,67, which also indicated a functional reorganisation in older adults in our study. In young participants, we observed a sharp increase in negative responses to each sound of the previously memorised sequences. Conversely, older adults displayed a less pronounced yet noticeable increase in positive responses generated by the right inferior frontal gyrus to each tone of the sequences. This finding is coherent with previous research showing altered functionality in the inferior frontal gyrus in aging populations68 and expands on it by providing evidence of age-related changes in its functioning during memory and predictive processes of musical sequences. Additionally, our previous studies44,45,46,47 indicated that the inferior frontal gyrus does not typically play a pivotal role in recognising memorised musical sequences. However, our current findings suggest that it may provide an additional, relevant contribution to music recognition, differing between young and older adults. This functional reorganisation of the inferior frontal gyrus may also align with several studies reporting reduced abilities in linguistic, predictive, and memory tasks among older adults69,70,71. Interestingly, unlike the reorganisation observed in the left auditory cortex, the changes in the inferior frontal gyrus may not necessarily indicate a compensatory mechanism but perhaps solely a shift in the functional response of this brain region. In this light, this finding would relate less to the STAC-r theory, but it would instead be consistent with the CRUNCH7 and PASA9 theories, which propose that older adults may employ different neural networks, strategies, or functionalities of frontal brain regions to achieve similar cognitive tasks as young adults.

We also examined the impact of aging on the recognition of varied musical sequences and the prediction error arising when the original sequences were altered. We identified the key involvement of the left and, especially, right hippocampus and bilateral ventromedial prefrontal cortex. The hippocampus is a central brain region for prediction error72,73 and its reduced activity in older adults suggests that aging is associated with decreased ability to consciously process errors and deviations from previously learned sequences. Similarly, the ventromedial prefrontal cortex, a brain region implicated in reasoning and evaluation processes74, exhibited reduced activity in older adults. In accordance with our findings, studies have shown that age-related changes in the ventromedial prefrontal cortex are associated with decline in cognitive control and decision-making abilities75,76. For instance, O’Callaghan and colleagues75 found that individuals with ventromedial prefrontal cortex damage and healthy older adults reported reduced awareness of the presented stimuli during learning tasks. This relates to our results, suggesting that the reduced activity in the ventromedial prefrontal cortex observed in older adults might represent the neural signature of the decreased conscious prediction error and awareness of the musical novelty in aging.

In contrast to the neural mechanisms observed during the recognition of previously memorised sequences, the perception and evaluation of varied melodies between older and young adults did not display evident functional reorganisation or compensatory mechanisms in the brain. While both the memorised melodies and their variations elicited reduced responses in the medial temporal lobe among older compared to young adults, no compensatory mechanisms in the auditory cortex were observed. Consistent with these neural findings, while older adults showed unaltered recognition of previously memorised sequences, their ability to detect varied melodies was significantly impaired. This suggests that detecting novelty within auditory sequences poses a greater cognitive challenge than recognising previously learned information. This observation aligns with existing research indicating that older adults often struggle to adapt to changes and process novelty across various domains of life59,77,78,79. On a neural level, this study suggests that the impaired processing of novel information shown by the older adults may be explained by the absence of compensatory mechanisms in their auditory cortex. These mechanisms, which counterbalance the reduced functionality of the medial temporal lobe when recognizing previously memorised melodies, appear to be altered. Understanding why a consciously perceived prediction error does not rely on these compensatory mechanisms poses a central question for future research.

Overall, our results can also be interpreted within the large framework of the PCT, providing a relevant contribution to the age-related changes of its neural underpinnings59. PCT posits that the brain is constantly updating internal models to predict information and stimuli from the external world80. Recently, it has been successfully linked to complex cognitive processes, finding a notable example in the neuroscience of music. Vuust and colleagues81,82 suggested that, while processing music, the brain repeatedly generates hypotheses and predictions about the upcoming unfolding of musical sequences. When the prediction matches the incoming sounds, the brain recognises the music. Conversely, when the expectation is violated by different sounds, predictions errors arise. Our findings point to impaired conscious predictive coding processes in healthy older adults, as evidenced by reduced brain activity during the prediction and recognition of the varied musical sequences. These results are coherent with previous research which showed an age-related reduction of automatic predictive processes such as MMN39,40,41,83. Notably, our study largely expands on their significance by showing age-related changes of conscious predictive processes and novelty detection and not only automatic responses to subtle environmental irregularities as typically done in MMN studies. Along this line, we revealed decreased activity in older adults during the recognition of the varied musical sequences in brain regions particularly relevant for memory and predictive processes, such as the hippocampus (especially in the right hemisphere)72,84. Accordingly, numerous studies have shown the detrimental effects of aging on the hippocampus and memory performance. For instance, it has been reported that aging is associated with reduced hippocampal size85,86 and that it affects the long-term potentiation (LTP) and long-term depression (LTD) occurring in the hippocampal neurons87. The altered size and functionality of LTP and LTD in the hippocampus occurring with aging might be reflected in the reduction of hippocampal activity that we observed in older adults in our study during the conscious detection of the varied sequences. Conversely, as described above with regards to the recognition of previously memorised sequences, our findings revealed an intriguing pattern of increased activity in the left auditory cortex of older adults during the recognition of musical sequences. In a coherent view which takes into consideration not only the PCT82 but also the CRUNCH7 and STAC-r11 theories, it may be hypothesised that the increased activity in the left auditory cortex is a result of top-down influences from the hippocampus and ventromedial prefrontal and inferior temporal cortices, which are supposed to actively monitor the unfolding musical sequence82. In this case, when they successfully predict the sequence, they require less effort from the left auditory cortex. In a young and more effective brain, the more refined prediction and higher control exerted by those brain regions would result in a reduced activity in the auditory cortex. Conversely, when such top-down processing is reduced, compensatory mechanisms in the auditory cortex may be necessary, exactly as we observed in our study.

Interestingly, no significant differences were found between older and young adults in terms of accuracy and reaction times when recognising previously memorised sequences. This finding suggests that brain activity may undergo alterations before behavioural manifestations become apparent. Supporting the STAC-r theory11, the enhanced activity in the left auditory cortex appears to compensate for the reduced functionality of the medial temporal lobe, resulting in unaltered behavioural performance. This observation raises exciting possibilities for using brain activity as a potential biomarker for the early detection of cognitive decline. Future studies could hypothesise and test whether the level of compensatory mechanisms and reorganisation of the brain network during musical sequence recognition can index the aging status of the brain.

To be noted, splitting the older adult participants into two age groups further strengthens the reliability of our previously described results, as it reveals a more pronounced reduction in brain activity in participants older than 68 compared to those aged 60–68. This highlights the progressive nature of age-related changes in brain functioning. In addition, we showed a relationship between the participants’ WM abilities and the brain activity. Participants with higher WM exhibited stronger brain activity, particularly when recognising the varied musical sequences. This finding underscores the potential of using WM as a predictor of preserved brain activity in older adults. In fact, older adults with high WM capacity showed brain activity levels similar to those of young adults with lower WM capacity. This finding is strongly in line with previous research on cognitive reserve, suggesting that higher cognitive abilities in older populations represent a protective factor against mild cognitive impairment and dementia88,89,90. Finally, upon analysing the novelty detection of sequences composed in the original musical key (in-key) versus those in a different musical key (out-of-key), we found a few significant clusters indicating an overall increase in prediction error in response to the out-of-key melodies, especially among young adults. Although limited, this finding suggests that the out-of-key sequences, being more dissonant91,92, were perceived by the brain as more different from the previously memorised sequences, as indicated by the overall increased neural responses. Additionally, our findings also suggest that the marginal level of familiarity our participants had with the musical piece before joining the experiment used in this study did not significantly influence the brain activity. While this observation does not rule out the potential impact of previous familiarity on brain responses, it underscores the need for dedicated studies aimed at investigating this aspect further. Regarding individual differences, although our participants did not exhibit significant hearing loss and the stimuli were calibrated to their auditory thresholds, future research could focus on aging individuals with more pronounced hearing loss93 to investigate its impact on the neurophysiology of auditory long-term memory. Finally, future studies could also build on our results by incorporating additional neurophysiological and neuroimaging techniques, such as stereo-electroencephalography (SEEG) and functional magnetic resonance imaging (fMRI). While MEG can safely reconstruct subcortical sources, it does so with less accuracy compared to cortical regions. Thus, utilising SEEG and fMRI could provide an additional confirmation and expansion of the results presented in the current study.

In summary, our study offers valuable insights into the effects of aging on brain function, particularly in relation to the recognition of previously memorised auditory sequences. It demonstrates a comprehensive reorganisation of the brain associated with age in this cognitive process. Moreover, the observed partial discrepancy between age-related changes in brain responses and behavioural performance highlights the potential of our methodology, if implemented in future longitudinal studies, to identify possible biomarkers for healthy aging and early detection of transformative changes in brain function.

Materials and methods

Participants

After excluding one participant who was not able to perform the task, the sample consisted of 76 participants (34 males, 42 females, sex, biological attribute, self-reported), divided into two age groups: young and older adults. We have not collected information about participants’ gender since this was beyond the scope of our research. The older adult group consisted of 39 participants (24 females, 15 males) aged 60 to 81 years old (mean age: 67.72 ± 5.35 years). The young group included 37 participants (18 females, 19 males) aged 18 to 25 years old (mean age: 21.89 ± 2.05 years). The nationality of all participants was Danish. The inclusion criteria for the participants were the following: (i) normal health (no reported neurological nor psychiatric illness), (ii) age between 18 and 25 years old (young adults’ group) and older than 60 years (older adults’ group), (iii) normal hearing according to the age group of each participant, (iv) normal sight or corrected to normal sight (e.g., contact lenses), and (v) understanding and acceptance of participant information. The exclusion criteria that we applied were: (i) use of prescribed medication that could affect the central nervous system, (ii) neurological or psychiatric illness, (iii) lack of cooperation or verbal agreement for participating in the study, (iv) magnetic resonance imaging (MRI) contraindications, (v) age between 26 and 59 years old, and impaired hearing (vi). The sample size was determined based on previous neurophysiological studies (using MEG and EEG) which either employed similar paradigms43,44,45,46,47 or compared analogous groups of participants55,94,95,96. Additionally, a power analysis, accounting for the anticipated brain signals across the eight ROIs utilised in the study, alongside correction for multiple comparisons, corroborated the appropriateness of employing two groups consisting of approximately 30–40 individuals each.

The project was approved by the Institutional Review Board of Aarhus University (case number: DNC-IRB-2021-012). The experimental procedures complied with the Declaration of Helsinki–Ethical Principles for Medical Research. Participants’ informed consent was obtained before the beginning of the experiment and received compensation for their participation in the study. All ethical regulations relevant to human research participants were followed.

Experimental stimuli and design

In this study, we presented participants with an auditory recognition task based on the old/new paradigm that we developed in our previous works44,45,46,50,51. At the same time, we recorded their brain activity using magnetoencephalography (MEG). The participants were required to listen to a brief musical piece (roughly 25 s) twice and were instructed to memorise it as best as they could. The musical piece comprised the initial four measures of Johann Sebastian Bach’s Prelude No. 2 in C Minor, BWV 847. The wave audio file that we used in the experiment was generated using Finale (version 26, MakeMusic, Boulder, CO) and presented using Psychopy v3.0. The volume of the musical stimuli was set to 60 dB for 67 participants and to 70 dB on average for nine of our participants older than 70 years who presented a very mild hearing impairment, as typically occurring with aging. To limit the adjustment of the volume across participants to only a few of them, we used sounds that almost always fell in the range 125–650 Hz, which is only marginally affected by the typical hearing loss occurring with aging97. Each tone within the piece had the same duration of around 350 ms. In the second phase of the task, participants were presented with 81 musical sequences consisting of five tones and lasting 1750 ms. They were then asked to identify whether each sequence was part of the original musical piece (old or memorised sequence [M]) or if it was a different musical sequence (new or novel sequence [N]) (see Fig. 1). For the purpose of this study, we presented participants with 27 sequences from the original musical piece and created 54 variations of the original melodies. The musical sequences used in the study are depicted in Supplementary Fig. 1. The two types of stimuli used in the study were created as follows. The M sequences were comprised of the first five tones from the first three measures of the musical piece. These sequences were presented a total of 27 times, nine times for each sequence. The N sequences were generated by systematically altering the three M sequences (see Fig. 1). This involved changing every musical tone of the sequence while keeping the first tone (NT1) or the first three tones (NT3) the same as the M sequences. Nine variations were created for each of the original M sequences and each of the two categories of N. As a result, there were 27 N sequences for each category and 54 N sequences in total. The variations were created following specific rules:

  • Inverted melodic contour (used twice): this involved creating a variation with a melodic contour that was inverted relative to the original M sequence. (i.e., if the melodic contour of the M sequence was down-down-up-down, the N sequence would be up-up-down-up).

  • Same tone scrambled (used three times): this involved scrambling the remaining tones of the M sequence (e.g., M sequence C-E-D-E-C, was changed into NT1 sequence C-C-E-E-D).

  • Same tone (used three times): this involved using the same tone repeatedly, sometimes varying only the octave (e.g., M sequence C-E-D-E-C, became NT1 sequence C-E8- E8- E8 E8).

  • Scrambling intervals (used once): this involved scrambling the intervals between the tones (e.g., M sequence 6 thm - 2ndm – 2ndm – 3rdm, was changed to NT1 sequence 2ndm, 6 thm, 3rdm, 2ndm).

We adopted this procedure to study the difference between young and older adults with regards to their brain dynamics underlying (i) the recognition of previously memorised auditory sequences and (ii) their conscious detection of the varied sequences.

Neural data acquisition

During this study, MEG recordings were conducted at Aarhus University Hospital (AUH), Aarhus, Denmark, using an Elekta Neuromag TRIUX MEG scanner with 306 channels. The data was recorded with an analogue filtering of 0.1–330 Hz at a sampling rate of 1000 Hz. To ensure accurate co-registration with the MRI anatomical scans, the head shape of participants and the position of four Head Position Indicator (HPI) coils were registered using a 3D digitizer (Polhemus Fastrak, Colchester, VT, USA). During the MEG recordings, two sets of bipolar electrodes were also used to record cardiac rhythm and eye movements, allowing for removal of electrocardiography (ECG) and electro-oculography (EOG) artifacts in a later stage of the analysis.

The MRI scans were recorded on a CE-approved 3 T Siemens MRI-scanner at AUH using the following structural T1 sequence parameters: echo time (TE) = 2.61 ms, repetition time (TR) = 2300 ms, reconstructed matrix size = 256 × 256, echo spacing = 7.6 ms, and bandwidth = 290 Hz/Px.

The MEG and MRI recordings were conducted on separate days.

Working memory, musical expertise and background data

We evaluated domain-general working memory (WM) abilities using the Digit Span and Arithmetic subtests from the Wechsler Adult Intelligence Scale IV’s Working Memory index. The Digit Span subtest required participants to listen and repeat sequences of numbers in the same, inverse, or ascending order. The Arithmetic subtest involved solving mathematical operations provided orally by the experimenters without external aids. We combined the raw scores from both subtests to calculate individual WM abilities, with scores ranging from five to 70. Additionally, we assessed formal musical training using the Goldsmiths Musical Sophistication Index (Gold-MSI) questionnaire, which includes 39 questions on musical skills, experience, and habits. We used the Musical Training facet, which estimates an individual’s history of formal musical training, and scores range from seven to 49.

In addition, we collected general background data such as the years of education and self-reported familiarity before joining the experiment with the Bach’s prelude used in the study. The familiarity was expressed along a Likert scale from 1 to 7 (1 = no familiarity at all; 7 = extreme familiarity). These data were then used in later stages of the analysis to assess whether they had an impact on the relationship between age and neural data during recognition of auditory sequences.

Behavioural data during MEG recording

During the auditory recognition task, we recorded participants’ responses and reaction times. We then used this data to estimate differences in response accuracy and average reaction time between young and older participants, and to calculate the impact of sex, years of education, WM abilities, and years of musical training on the behavioural data.

We computed two independent multivariate analysis of variance (MANCOVA, Wilk’s Lambda [Λ], α = 0.05)98 using group as the independent variable (young vs older) and years of education, WM scores, years of musical training, and sex as covariates. In one MANCOVA, number of correct responses (divided into M, NT1 and NT3) were used as the three dependent variables. In the other MANCOVA, average reaction time during correct responses (divided into M, NT1, and NT3) were used as the three dependent variables. The effect size was calculated using partial eta squared (i.e., partial η2).

To determine the effects of the independent variable and covariate, univariate analyses of covariance (ANCOVA) were computed individually for each of the dependent variables and statistically significant covariates.

MEG data pre-processing

The MEG data obtained from 204 planar gradiometers and 102 magnetometers was initially subjected to pre-processing with MaxFilter99 (version 2.2.15), which helped to reduce external interferences. We applied signal space separation and the following MaxFilter parameters: spatiotemporal signal space separation [SSS], down-sample from 1000 Hz to 250 Hz, correlation limit between inner and outer subspaces used to reject overlapping intersecting inner/outer signals during spatiotemporal SSS: 0.98, movement compensation using cHPI coils (default step size: 10 ms).

After conversion to Statistical Parametric Mapping (SPM) format, the data was pre-processed and analysed in MATLAB using both in-house-built codes (LBPD, https://github.com/leonardob92/LBPD-1.0.git) and the freely available Oxford Centre for Human Brain Activity (OHBA) Software Library (OSL)100 (https://ohba-analysis.github.io/osl-docs/), which utilises Fieldtrip101, FSL (version 6.0)102, and SPM12103 toolboxes. We visually inspected the filtered MEG data using OSLview to remove large artifacts, which accounted for less than 0.1% of the total data. We employed independent component analysis (ICA) to separate and remove eyeblink and heartbeat interference from the brain data104. This involved decomposing the original signal into independent components, discarding the components that detected eyeblink and heartbeat activities, and reconstructing the signal using the remaining components. We then epoched the signal into 81 trials and baseline-corrected it by subtracting the mean signal recorded in the baseline from the post-stimulus brain signal. The trials lasted 3500 ms (3400 ms after the onset of the first tone of the musical sequence plus 100 ms of baseline time) and were categorised into three groups (M, NT1, NT3) with 27 trials each.

MEG sensor level and aging

To assess the difference between the brain activity of young and older adults while they recognised the musical sequences, we calculated several independent samples t-tests with unequal variances and then corrected for multiple comparisons using cluster-based Monte-Carlo simulations (MCS). As it is common in MEG and EEG task studies48,49, we computed the average over trials in each condition before performing t-tests, which resulted in three mean trials (M, NT1, NT3). For each condition separately, we computed a t-test for each MEG magnetometer channel and each time-point between 0 and 2000 ms, contrasting the brain activity of young and older adults. We then reshaped the matrix to obtain a two-dimensional (2D) approximation of the MEG channels layout for each time-point, binarising it based on the p-values obtained from the previous t-tests (threshold = 0.05) and the sign of t-values. The resulting 3D matrix (MX, 2D x time) consisted of 0 s when the t-test was not significant and 1 s when it was. To correct for multiple comparisons, we identified clusters of 1 s and assessed their significance using MCS. Specifically, we performed 1000 permutations of the elements of the original binary matrix MX, identified the maximum cluster size of 1 s, and built the distribution of the 1000 maximum cluster sizes. We considered clusters that had a size bigger than the 99.9% maximum cluster sizes of the permuted data to be significant. We applied the MCS procedure to the absolute values of magnetometer MEG channels for both young versus older adults and vice versa.

Source reconstruction

MEG provides excellent temporal resolution, but to fully understand the brain activity underlying complex cognitive tasks, the spatial component of the brain activity must also be identified. To estimate the sources of the brain that generated the signal recorded by the MEG sensors, we computed a source reconstruction protocol using a combination of in-house-built codes and codes available in OSL, SPM, and FieldTrip.

The source reconstruction analysis consists of designing a forward model and computing the inverse solution. The forward model considers each brain source as an active dipole and describes how the unitary strength of each dipole is reflected over all MEG sensors. We used magnetometer channels and an 8-mm grid to obtain 3559 dipole locations within the whole brain (voxels). After co-registering the individual structural T1 data with the fiducial points (i.e., information about head landmarks such as the nasion and the left and right pre-auricular points), we computed the forward model using the widely used “Single Shell” method, which resulted in a leadfield model stored in matrix L (sources x MEG channels)105. In cases where structural T1 was unavailable, we used a template (MNI152-T1 with 8-mm spatial resolution) for the leadfield computation.

Afterwards, we calculated the inverse solution, using the established beamforming method, which is a popular and effective algorithm available in the field of neuroscience. The process involves utilising a distinct series of weights that are applied successively to the source positions, enabling the separation of the impact of each source on the activity detected by the MEG channels. This is carried out for every instance of the brain data captured. The beamforming inverse solution is comprised of several key stages, which can be outlined as follows.

The data measured by the MEG sensors (B) at time t, can be described by the following Eq. (1):

$${B}_{(t)}=L * {Q}_{(t)}+{{{\rm{\varepsilon}}}}$$
(1)

where L is the leadfield model, Q is the dipole matrix which carries the activity of each active dipole (q) over time, and Ɛ is noise (see Huang and colleagues for details106). In order to resolve the inverse problem, Q has to be computed. In the beamforming algorithm, to calculated Q, a series of weights have to be computed and applied to the MEG sensors at each timepoint. This is done for each single dipole q and shown in Eq. (2):

$${q}_{(t)}={{W}^{T}}*{ B}_{(t)}$$
(2)

To obtain q, the weights W have to be computed (here, the subscript T indicates the transpose matrix). The beamforming method relies on the matrix multiplication between L and the covariance matrix between MEG sensors (C). This matrix is calculated on the concatenated experimental trials. More specifically, for each brain source (dipole) q, the weights Wq are calculated as shown in Eq. (3):

$${W}_{(q)}={({{L}_{(q)}}^{T}* {C}^{-1}* {L}_{(q)})}^{-1}* {{L}_{\left(q\right)}}^{T}* {C}^{-1}$$
(3)

The calculation of the leadfield model was performed for the three main orientations of each brain source (dipole), as done in the field (see, for example, Nolte105). Then, prior to computing the weights, the orientations were reduced (from three to one) by using the singular value decomposition algorithm on the matrix multiplication reported in Eq. (4). This procedure is widely adopted and used to simplify the beamforming output107,108.

$$L={svd}{({l}^{T}* {C}^{-1}* l)}^{-1}$$
(4)

In this context, l denotes the leadfield model with the three orientations, while L is the resolved one-orientation model that was used in the estimation of the brain sources in Eq. (3). The weights were then applied to each brain source and timepoint, with the covariance matrix C being computed based on the continuous signal that resulted from concatenating the trials across all experimental conditions. To counterbalance the source reconstruction bias towards the head’s centre, the weights were normalised according to Luckhoo and colleagues108. Since we worked on evoked responses, the weights were applied to the neural activity averaged over trials.

This procedure allowed us to obtain a time series for each of the 3559 brain sources and each experimental condition. To adjust the sign ambiguity of the evoked responses time series for each brain source, the sign was matched with the N100 response to the first tone of the auditory sequences44,45,46,50,51.

MEG source level and aging

For each of the significant clusters emerged from the previous analysis at the MEG sensor level, we contrasted the brain activity of young versus older adults. We averaged the time series of all brain sources over the time-window of each significant cluster and computed independent-sample t-tests contrasting the brain activity of young versus older adults. This procedure was computed independently for the three experimental conditions (M, NT1, NT3). Finally, we corrected for multiple comparisons using a 3D cluster-based MCS (α = 0.005 [older vs young adults], α = 0.05 [young vs older adults], p-value = 0.001). Here, we used a stricter α level for older vs young adults since the difference in their brain activity was particularly strong and we wanted to highlight the main focus of such differences. For this procedure, we first determined the sizes of significant clusters consisting of neighbouring brain voxels. Subsequently, we generated 1000 permutations of the initial data and estimated the sizes of significant clusters formed by neighbouring brain voxels in each permutation. This process yielded a reference distribution of the largest cluster sizes observed in the permutated data. Finally, we identified original clusters as significant if their size was larger than 99.99% of the clusters in the reference distribution. Further details on the MCS algorithm can be found in previous works by Bonetti and colleagues44,45,46,50,51.

Functional regions of interests (ROIs)

We computed an additional analysis by investigating the difference between the brain activity of young versus older adults in a selected array of functional ROIs, previously described by Bonetti and colleagues47. These were derived from the whole-brain analysis of the active brain regions of young adults during recognition of the same musical sequences used in the current study. These areas roughly corresponded to the bilateral medial cingulate gyrus (MC), bilateral ventromedial prefrontal cortex (VMPFC), left (HITL) and right hippocampal area and inferior temporal cortex (HITR), and left (ACL) and right auditory cortex (ACR). In addition, we incorporated the left (IFGL) and right inferior frontal gyrus (IFGR) because these regions displayed marked differences between young and older adults.

This additional analysis allowed us to reconstruct with greater precision the time series of each brain region that played a central role in auditory sequence recognition. Thus, while it did not provide additional information to the previous analysis, it refined its significance. In Supplementary Table 6, we reported the Montreal Neurological Institute (MNI) coordinates of each voxel forming the eight ROIs. The ROIs are visually displayed in Supplementary Fig. 2.

Aging and ROIs time series

We contrasted the brain activity of young versus older adults by computing an independent-sample t-test for each ROI, timepoint, and condition. We corrected for multiple comparisons using 1D cluster based MCS (α = 0.05, MCS p-value = 0.001). First, we identified the clusters of the significant values which were continuous in time. Second, we performed 1000 permutations, consisting of randomising the significant values obtained from the t-tests. For each permutation, we then extracted the maximum cluster size, and we built their reference distribution. To summarise, we considered significant the original clusters that were larger than the 99.9% of the clusters emerged in the permutations. Additional details on this procedure can be found in previous works by Bonetti and colleagues44,45,46,50,51.

In addition, since there were a few novel sequences which were out-of-(musical)-key in relation to the original Bach’s prelude and to most of the melodies presented in the recognition task, we have computed a further analysis by comparing the brain responses to the out-of-key -of-key versus the in-key melodies. Here, we first divided the novel melodies in two sub-categories: in-key and out-of-key. Then, we computed one two-way ANOVA for each time-point, each ROI and each category of novel (i.e. NT1 and NT3). Here, the levels of the ANOVAs were age (older and young) and musical key (in-key and out-of-key). The results of the ANOVA (main effects for age and musical key and interaction age x musical key) were corrected for multiple comparisons using the same 1D cluster based MCS (α = 0.05, MCS p-value = 0.001) described above in this paragraph.

Finally, we computed an additional analysis to assess whether the familiarity of the participants before joining the experiment with the Bach’s prelude affected the brain signal. Here, we computed a correlation for each time-point, ROI and experimental condition between the brain data and the self-reported familiarity of the participants with the Bach’s prelude. As before, multiple comparisons were controlled using 1D MCS (α = 0.05, MCS p-value = 0.001).

WM, musical expertise, education level, aging and neural data

We computed two additional analyses to assess whether potential confounding variables had an impact on the relationship between aging and the neural responses underlying the recognition of the musical sequences.

In the first analysis we computed three independent multivariate analyses of covariance (MANCOVAs), one for each experimental condition (Wilk’s Lambda [Λ], α = 0.05). In each MANCOVA the dependent variables were the neural data for the eight ROIs, the independent variable was age, and the covariates were years of formal musical expertise, sex, WM, and years of formal education that participants received. To be noted, the neural data was collapsed into one single value for each ROI and participant. This was computed by averaging the main response (neural peak ± 20 ms) to each tone in the M condition. With regards to the N conditions, we selected the main response (neural peak ± 20 ms) to the tone that introduced the variation in the sequence. This analysis was conducted in R109.

The second analysis consisted of computing analyses of variance (ANOVAs) for each time-point and each ROI and then using the same cluster-based 1D MCS to correct for multiple comparisons that we described in the previous paragraphs.

In this case, we computed two independent sets of ANOVAs. In the first one, we used one-way ANOVAs contrasting three age-groups: young (younger than 25, n = 37), older adults 60–68 (age between 60 and 68, n = 22), and older adults >68 (older than 68, n = 17). In the second set, we used two-way ANOVAs with the following levels: WM (high and low performers) and age (young and older adults). Here, we tested the main effects of WM and age as well as their interaction. This allowed us to further test the changes in the brain activity over different age-groups as well as to better highlight the impact of WM on the ROIs time series.

Figures 5, 6 report the ROIs which showed the strongest results, while Supplementary Tables 8, 9 disclosed the complete details of the statistical results.

To be noted, four participants (three young and one older adult) did not complete the WM assessment. For this reason, the analyses described in this paragraph were computed with a sample of 72 participants.

Statistics and reproducibility

The behavioural data was analysed using two independent multivariate analysis of variance (MANCOVA, Wilk’s Lambda [Λ], α = 0.05) and follow-up ANOVAs. The MEG sensor data was analysed using paired-sample t tests and corrected for multiple comparisons using cluster-based Monte-Carlo simulations (MCS). The MEG source data was first restricted to eight regions of interest (ROIs) and analysed using paired-sample t tests and corrected for multiple comparisons using cluster-based Monte-Carlo simulations (MCS). Additional two-way ANOVAs were conducted to establish the effect of working memory (WM) and age on the neural responses and the effect of age and the musical key of the novel sequences on the neural responses. Multiple comparisons were addressed using cluster-based MCS. An additional MANCOVA was computed to establish the influence of covariates such as years of formal musical expertise, sex, WM, and years of formal education received by the participants on the neural responses. Finally, Pearson’s correlations were conducted to establish the relationship between the neural responses and the familiarity participants self-reported with the Bach’s prelude before joining the experiment. Multiple comparisons were addressed using cluster-based MCS. Details of these procedures are extensively reported throughout the Methods section. The analyses involved 76 participants (39 older and 37 young adults).

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.