Trainor says she wrote it to distract herself from her recent vocal troubles.

Meghan Trainor Pens "Better When I’m Dancin'" For The Peanuts Movie

Meghan Trainor wrote “Better When I’m Dancin'” during her recent vocal troubles.

It’s no easy feat to write a promising song representing iconic characters in a classic like the upcoming Peanuts movie, but Trainor pulled from her recent real-life experiences and the result is magical. The movie’s director, Steve Martino, asked Trainor to create a song for the film that exudes confidence, something she’s struggled with in the last few months after facing an uphill battle to return to performing live after undergoing mandatory vocal cord surgery.

“They wanted a song about confidence and knew I was good at writing those. I feel better when I’m onstage dancing and having fun, so I wrote about that,” Trainor said. “I feel better when I’m on stage, dancing and distracted. So that’s what I wrote about: feeling better when you’re dancing and having fun and forgetting about everything else.”

The studio version has yet to hit the blogosphere, so for now enjoy a very recent surprise performance of the song from one of Trainor’s shows.

They also turned Trainor into her own Peanuts character, and the result is as follows: