The Vatican knew it had a winner on its hands with Allegri’s "Miserere" and, wanting to preserve its aura of mystery and exclusivity, forbade replication, threatening anyone who attempted to copy or publish it with excommunication. But that didn't stop the teenaged Mozart.
… 2 times, transcribed it from memory, and produced one of the earliest records of musical piracy.