What were you doing when you were seven years old? Learning to read? Watching cartoons? Beginning to dress yourself? Well, Prince was busy writing his first song.

Prince Rogers Nelson’s reputation as a musical prodigy is not an exaggeration – the Purple One started early. It helped that he had been born into a musical family on June 7, 1958. His mother, Mattie, had been a jazz singer, before she gave it up to raise Prince and his siblings. His father, John, continued to play piano and write songs after his son entered the world, although that was not his primary occupation. He worked for Honeywell in Minneapolis, but played side jobs as the leader of a band he called the Prince Rogers Trio. John named his son after a stage name he’d already been using for years.

“I named my son Prince because I wanted him to do everything I wanted to,” John Nelson told A Current Affair in 1991. The boy would not disappoint.

To avoid confusion between John’s stage persona and the actual Prince Rogers in the house, Mattie took to calling their son Skipper. Young Skipper’s musical awakening supposedly came in 1963, when he saw his father perform publicly for the first time. There had always been music in the house, but seeing his dad on stage had a lasting impact on the child.

Later, when the event became a legend in Prince’s backstory, the details would shift. In some versions of the tale, Prince snuck out the family car to go see what his father was doing in a local club. In others, his mother took him to see the Prince Rogers Trio play at a theater. But every account seems to involve a parade of dancing girls accompanying the music.

“People were screaming,” he recalled, according to Prince: Inside the Music and the Masks. “From then on I think I wanted to be a musician.”

Even though the youngster had not yet learned an instrument, he began “playing” rocks, banging two of them together to create a rhythm akin to the jazz Prince had heard his father play. Before long, he had taken to banging on John’s upright piano, installed in the Nelson home. Prince would try to play and his little sister Tyka would sing along, as the siblings emulated Mom and Dad.

With encouragement from his father, and plenty of practice, Prince learned to properly play the instrument. He said that the first real song that he was able to perform on the piano was the theme to TV’s Batman series, which became a big hit when Prince was seven. Not long before his death in 2016, the musician reminisced by playing the famous theme in concert during his Piano and a Microphone tour.

The young man’s interest in music was insatiable from that point on. His mother recalled shopping trips to department stores in which her son would quickly rush to the music department to play on the pianos and organs that were on display. When Matte was done, she’d always know where to find Prince.

Not long after Prince learned to play the piano, he wrote his first song, which he called “Machine.” There are numerous publications that claim it was titled “Funk Machine,” but that’s probably not true. It’s more likely that the “funk” was added to a subsequent evolution of the tune.

Here’s why: According to multiple sources, Prince wrote this first song when he was seven. He was that age between June 1965 and June 1966. Batman – the theme of which he learned before he created his first melody – premiered in January ’66, meaning that “Machine” would have to follow sometime before the summer of that year. The reason that “funk” was probably not in the original title is that because the term hadn’t yet become widely known. Although jazz musicians – maybe even including John Nelson – might talk about putting some “stank” or “funk” into their playing, the first well-known song with the word in the title was Wilson Pickett's “Funky Broadway,” released in 1967.

That same year, James Brown released "Cold Sweat," whose rhythm put a greater emphasis on the first beat of a measure than previously heard in African American music. Its success -- reaching No. 7 on the Billboard Hot 100 and No. 1 on the R&B chart -- caused others to experiment with the new sound, which became defined as "funk."

As a musical prodigy, Prince might have been funky, but he wasn’t a “Funk Machine” quite yet. That would happen as he became enamored with the music and performance style of the Godfather of Soul, then Sly and the Family Stone. But he wasn’t just into R&B, also listening to rock, pop and singer-songwriters on the radio. His musical talents became just as eclectic. As the young musician grew older, he briefly tried to play saxophone before learning the guitar, drums and bass.

By the time he was a teenager, Prince had formed his first band with childhood pal Andre Anderson (who later called himself Andre Cymone) on bass and Prince’s second cousin Charles “Chazz” Smith on drums. The group sometimes included other members, mostly played covers of the era’s hits at dances and went by a variety of names – most notably Grand Central, but also Phoenix; Charles, Cousin & Friends and Sex Machine.

That last name might have been a nod to the hit by James Brown or the lengthy album track by Sly Stone, or it may have come about because of a newer rendition of Prince’s first-ever song. Although Grand Central was primarily a cover band, they did sneak some originals into their sets, including Prince’s “Machine,” which by then had become “Funk Machine” or “Sex Machine.” Supposedly, when the band played the tune in the early-to-mid-’70s, the lyrics involved some graphic sexual content and compared a sexy woman to a mechanized object. Again, the Purple One started early.

Through his high-school years, Prince was amassing a catalog of songs, many of them about women – both real and imagined. Even though he had become part of a successful local band as a teenager, and even done some recording sessions, he was growing frustrated at the limitations of being in a group known primarily for playing covers. In early 1976, when he was 17, it looked like that was ready to change.

After Morris Day had replaced Smith on drums in Grand Central, Day’s mother Lavonne began managing the group and booked the boys some time at ASI Studio in Minneapolis. With Prince on guitar and keyboards, Anderson on bass and Day on drums, the band would record six original compositions – “Machine” being one of them – overseen by David Rivkin (the brother of future Revolution drummer Bobby Z.). Prince was so excited by the experience, he boasted about it in the high school newspaper.

But the thrill was short-lived. The recordings failed to lead to what the teenage musician was dreaming about: a recording contract and the opportunity to make a debut album. If he wasn’t able to do that with this band, then he’d have to go it alone. Prince did exactly that, recording his own demo tape that got him signed to Warner Bros. Records as a solo act. He released his first LP in 1978.

All these years – and hundreds, if not thousands of songs – later, the 1976 recording of “Machine” remains unreleased. Not only was it the first song that Prince ever wrote, it was one of the first recordings that was denied to his die-hard fans. Prince’s songwriting started with “Machine” and, in a way, so did his vault.

More From Ultimate Prince