I love big questions like these! There's this really great book, The Philosopher and Music: A Historical Outline by Julius Portnoy that goes through the history of how the great philosophers viewed music as a medium given their cultural contexts.
It begins with the ancient philosophers, like Plato and Aristotle, who viewed music as a moral law. They literally thought that discordant music could make a person actually evil. And who knows? Maybe it can!
I see you tagged this question "aesthetics" as well, so the sixth section of this book might be of particular interest to you, as it focuses on the enlightenment when philosophers such as Kant, Hegel, and Kierkegaard were tackling the question of "how can we define beauty?" If you can't get your hands on this book in particular, looking into their aesthetic essays could at least get you going.
Hope this helps, and best of luck on your music-philosophy journey! It's certainly a fun one!