Researchers at the University of California, Berkeley, analyzed recordings from electrodes placed directly on the brains of 29 patients being treated for epilepsy, taken years earlier while the patients listened to Pink Floyd's Another Brick in the Wall, Part 1.
More than 2,000 electrodes captured the electrical chatter of brain regions that process rhythm, harmony and words. A modeling approach built to decode speech was adapted to music, and it reconstructed a muffled but recognizable version of the song, picking up the rhythm and melody well enough for listeners to identify the track from the output alone.
The analysis also located a brain region, the right superior temporal gyrus, that appeared to handle musical rhythm specifically, apart from regions already known for speech. The decoding only worked because these patients already had electrodes implanted for seizure monitoring, unrelated to the study, so the method cannot simply be run on anyone. It points toward communication devices for people who have lost speech but might still produce intelligible output.

Read the original study
Bellier et al., PLOS Biology, 2023 · doi.org/10.1371/journal.pbio.3002176
A brain can hum a tune, apparently.
Source
- Bellier, L., Llorens, A., Marciano, D., Gunduz, A., Schalk, G., Brunner, P., & Knight, R. T. (2023). Music can be reconstructed from human auditory cortex activity using nonlinear decoding models. PLoS Biology, 21(8), e3002176. https://doi.org/10.1371/journal.pbio.3002176