12/28/2014 06:00 EST | Updated 02/27/2015 05:59 EST

How Pharrell Williams struck gold with his mega-hit Happy

Pharrell Williams struck pop music gold and spread joy around the world this year with his bouncy mega-hit Happy.

The celebratory single first grabbed attention on the soundtrack for the animated comedy film Despicable Me 2.

Sensing a hit on his hands, Pharrell released the world's first 24-hour music video, a novel concept featuring ordinary people dancing to Happy in the streets, with celebrity cameos and appearances by the creator himself.

A version of it went viral on YouTube, now boasting more than 500 million views.

It was the beginning of an unprecedented global movement of happiness.

"The right piece of music or collection of music can help tilt your mood or balance toward being more trusting, feeling more engaged with society and with your life," neuroscientist and musician Daniel Levitin told CBC News.

"Happy does subscribe to these ideals."

Fans from dozens of countries uploaded hundreds of homemade videos to a website dedicated to Pharrell, showing people coming together to dance to the Happy groove. Williams broke down in tears of joy in an interview with Oprah Winfrey after watching a compilation of the videos, processing the true impact of his song.

The tides changed when a group of Iranians posted a "Happy we are from Tehran" video online that showed them dancing in public and the women unveiled. They were arrested, sentenced to jail time and lashes for violating Islamic laws.

After an international outcry, their sentences were suspended for three years. The individuals will not go to prison unless they re-offend.

Almost overnight, Happy also became an anthem for freedom. All the while, forging ahead as a pop culture touchstone, ranking No. 1 on charts like Billboard, iTunes and Spotify.

"It just took people not getting tired of [Happy] and that's really the trick," explained Levitin. "The composer has to find the right balance between simplicity and complexity, between familiarity and novelty, and if they get it just right, a song can hook you for a long, long time."

Watch Jelena Adzic's full report on Happy's impact in the video above.