What sort of algorithm enjoys music?

Aesthetics is confusing me a bit right now. You might also ask the question “why?” with painting or architecture, for example. I am singling out music because I got to thinking about it via how we understand music.

Neurological problems can separately disable pitch/​melody recognition, rhythm recognition and emotional reaction to music, and people can lose all of these without losing speech and speech processing. This is odd. Liking music is then some messy neurological process with its own special pathways. And it’s probably not all that complicated, from a brain standpoint, just fuzzy and parallel.

What do we know? We know that we don’t generally like contextless musical objects, but instead enjoy relationships between musical objects, especially with some rhythm. And yet we enjoy music “in the moment,” (a musical object in the context of the last few measures) without having to listen to a whole piece. We tend to ascribe emotion to music (particularly the stress patterns, which seems vaguely connected to speech), and people can express themselves through music. Music can differ from culture to culture, but we usually like discrete, repeating scales and rhythms that partially repeat.

One proposal is that we form a vague (consistent with many possibilities) model of what the musician is likely to do next, and enjoy it when the model feels accurate. The emotional content also suggests that “musical grammar” model, where different elements of the music communicate things to us and what we enjoy is deciphering the communication and experiencing the communicated emotions. I’d enjoy it if people had more suggestions and possible experiments. Going more abstract, should these proposals generalize well to other sorts of aesthetics, or should we assume that since it’s probably all different neurons we shouldn’t try too hard? If so, why do we feel like we enjoy aesthetic pursuits in similar ways?