(CNN) -- Earle Hagen spent a couple of months trying to come up with suitable music for "The Andy Griffith Show."
He awoke one morning, convinced the theme should be simple enough to whistle. In about 10 minutes, Hagen had composed the music that, like the show, became a fixture in American culture.
Tuesday's death of Andy Griffith, who played Sheriff Andy Taylor in the fictional town of Mayberry, brought a range of tributes to the legendary actor.
For its part, YouTube showcased an eclectic mix of theme song variations.
One clip features a hip-hop instrumental version. A whistling cockatiel stars in another, and a guitar-playing performer sings the little-known words to "The Fishin' Hole," as the theme became known, in a third clip. Everett Sloane wrote the unused lyrics.
In 1997, Hagen told the Television Academy Foundation's Archive of American Television that he provided the whistle for the original recording.
"I never whistled before in my life and never since," he said.
After Hagen came up with the toe-tapping music, the show's producers filmed the familiar intro shot of Griffith and his son, Opie, played by Ron Howard, walking to their favorite Mayberry fishing hole.
"Andy can't go anywhere without somebody starting to whistle that theme at him," said Hagen, who died in 2008.
Although he wrote music for other TV hits, including "I Spy," "The Mod Squad" and "The Danny Thomas Show," Hagen knew there was something special about "The Andy Griffith Show."
"Mayberry has become utopia for a lot of people," he said.