Taylor Swift wrote her infamous letter to Apple at 4 in the morning

Jamie McCarthy / Getty Taylor Swift made headlines last month when she wrote an open letter shaming Apple for not paying artists during the three-month trial of Apple Music, its new music streaming service.

"We don't ask you for free iPhones," Swift said on behalf of her fellow artists. "Please don't ask us to provide you with our music for no compensation."

Now Swift has revealed what happened the night she decided to write the letter to Apple.

"I wrote the letter at around four A.M.," Swift told Vanity Fair for the magazine's September cover story. "The contracts had just gone out to my friends, and one of them sent me a screenshot of one of them. I read the term 'zero percent compensation to rights holders.' Sometimes I'll wake up in the middle of the night and I'll write a song and I can't sleep until I finish it, and it was like that with the letter."

While conspiracy theorists have suggested that the letter was some kind of marketing stunt, Swift cleared the air by revealing that the only person who read the letter before it was published was her mom. "She's always going to be the one. I just said, 'I'm really scared of this letter, but I had to write it. I might not post it, but I had to say it.' "

What about Swift's stance on Spotify? The Shake It Off singer still doesn't think very highly of the Apple Music rival.

"Apple treated me like I was a voice of a creative community that they actually cared about," she told Vanity Fair. "And I found it really ironic that the multi-billion-dollar company reacted to criticism with humility, and the start-up with no cash flow reacted to criticism like a corporate machine."