Music wasn't "written" in a single year—it is an ancient, evolving art form using organized sound and silence. While notation systems developed gradually (ancient Greece, China, medieval Europe), music itself predates writing by tens of thousands of years.
But bone flutes (40,000+ years), vocal traditions, and percussive rituals long preceded any written record. Music is humanity's first language—notation is just a late-arriving technology to preserve it.