Kesha "begged" for a keyboard when she was in rehab.
The 'Tik Tok' hitmaker was in a "very dark place" when she was battling an eating disorder and she just wanted to make some music to "deal" with her emotions.
She shared: "I was in a very dark place. I was alone and scared in rehab for an eating disorder that had gotten wildly out of control. I wasn't allowed to work or have any technology - no phone, no computer, no texting, no social media. At first, they wouldn't let me have any kind of instrument either.
"I begged them to let me have a keyboard - even a toy keyboard. I had so many emotions, and I didn't know how else to deal with them. Writing songs is the only way I know how to process things. I was relentless. I remember I begged and begged, until they finally agreed I could have a keyboard for one hour a day ... My boyfriend Brad sent me his keyboard and some crappy headphones that were falling apart. Every day I sat there on the floor and played."
And the 30-year-old singer doesn't want her past to define her.
She wrote in an essay for Refinery29: "There's a line in 'Rainbow' that I really love: 'What's left of my heart is still made of gold. I truly believe that. It's true for me and it can be true for others, too. I know giant pieces of my heart have been held captive in the past. But not anymore. And what's left is f***ing pure gold and no one can touch that.
"The naiveté and the joyfulness of a child is one of the most beautiful things in the world, and somewhere along the way you can get injured or hurt or heartbroken and sometimes you lose little pieces of joy. I just don't want to be that broken person. And I'm not anymore. I am a walking testament to anyone out there that with honesty and self-love, you can feel whole again."