How do you even dream of making music when your family and religious leaders disapprove, when you live at the edge of the Sahara desert, and you cannot afford an instrument?

It helps that the Tuareg musician Mdou Moctar, from Niger, is not easily discouraged. Unable to acquire a guitar, he made one out of a piece of wood with brake wires from an old bicycle for strings, and taught himself to play in secret. “I was from a religious family and music was not welcome, but I would go and listen to local musicians and dream of being like them,” the 32-year-old singer-songwriter says over the phone while on tour in the US.

“My parents didn’t have the means to buy me an instrument and wouldn’t have done so. To them, becoming a musician would mean I was a delinquent, a terrible person drinking beer and taking drugs. I never told them I wanted to play the guitar, I didn’t dare. So I made one.”

The next challenge was reaching an audience. Moctar, born in the village of Abalak in the Azawagh desert of northern Niger, began playing at weddings, singing in Tamasheq, the Tuareg language. His first album Anar – composed for a lost love – was recorded in Nigeria in 2008: it introduced Moctar’s simple, raw guitar sound and haunting lyrics, a style known locally as “assouf”, a word that does not easily translate, but evokes desert blues. Anar wasn’t officially released; instead, it spread across the continent via Bluetooth swaps between mobile phone data cards.

Watch Mdou Moctar performing live on KEXP

In 2011, one of the album songs, Tahoultine, featured on Music from Saharan Cellphones. It was compiled by Christopher Kirkley, the creator of the Sahel Sounds label, who made it a personal mission to track down the nomadic Moctar.

“I would hear about this foreign man who was asking after me, but I didn’t know what for,” Moctar says. “In 2011, he came to see me. He knew I play left-handed and one of the first things he asked was whether I had a left-handed electric guitar. When I told him I didn’t, he sent me one.”

Kirkley also made Moctar the star of a homage to Prince’s rock opera Purple Rain. As there is no word for “purple” in Tamasheq, the film, released in 2015, is called Akounak Tedalat Taha Tazoughai: Rain the Colour of Blue With a Little Red in It. It tells the story of a musician from Agadez who struggles with rivals and a conservative father to make music, while riding through the desert on a purple motorcycle.

Kirkley had to make some changes to Prince’s risque love story for local actors from a traditional Muslim background. “We obviously couldn’t do a kiss on the screen. We even had problems with a hug. I thought: ‘Well, maybe we can just end the film with the two of you hugging?’ And they said no,” Kirkley said in 2015. So the alcoholic, wife-beating father from Purple Rain became a strict and pious Muslim who bans music in his household and burns his son’s guitar to save the boy’s soul, telling him: “Only drug addicts and alcoholics play guitar.” Moctar is rapturous about making the film: “It was magic. Just magic. A dream.”

The purple one: Moctar in a still from Akounak Tedalat Taha Tazoughai: Rain the Colour of Blue With a Little Red in It Photograph: Publicity image

Today, Moctar, who says his traditional music has been influenced by Jimi Hendrix, Van Halen and Prince, has a new album, Ilana, meaning The Creator. The electric guitar has refined the sound to become more soulful and sophisticated; western influences can be heard in the complex riffs and a greater use of the bass, without drowning out the overriding traditional feel. Much of the album was created spontaneously in the studio and the lyrics cover everything from love songs to attacks on French-owned industry in Niger. He is a vocal critic of France’s influence on its former colony, which became independent in 1960.

“For 48 years France has exploited the uranium in our country, and yet we still don’t have roads, medicines and in many places there is no water or electricity,” he says. “France says we are independent now but we have no independence, we are modern slaves. They say this is an Africa problem, but we have had enough of what France is doing to us; it’s as if we’re still in the 15th century.”

Moctar insists he is doing his bit to help his country with plans to build a school and health clinic in his local village; religious leaders there were sceptical of his music, but he has won them round with his lyrics of respect, honour and tradition. “I am religious, but being a Muslim doesn’t stop me being an artist. Music is not criminal. My music satisfies people and through it I am helping people, which counts for something. I’m just an ambassador, like a messenger of music, telling what is happening in my world.”

Even his mother no longer despairs of his career choice. “She now says I am someone who is good. I don’t take drugs or drink and I don’t vex people. She is happy with me, and I am happy.”

• Ilana (The Creator) is released on 29 March on Sahel Sounds