‘Everything here happens at gunpoint,” someone tells me when I arrive in Caracas. Venezuela is in crisis, suffering from a lack of power, water and basic supplies and enduring widespread violence on the streets: the Venezuelan Observatory of Violence estimates that the country has the world’s highest murder rate at 81.4 per 100,000 people. According to the UN, around 4.5 million people have fled since 2015, escaping an economy in a state of hyperinflation and the authoritarian rule of president Nicolás Maduro.

The chaos has intensified recently, as opposition leader Juan Guaidó – recognised as the true president by more than 50 countries – was forced to storm a barricade of riot police to gain access to the country’s national assembly. Donald Trump has now rolled out economic sanctions to try to squeeze Maduro out of power – but they will squeeze an already embattled Venezuelan public, too.

But music doesn’t stop when times get difficult and Venezuela boasts a rich and diverse culture that continues to thrive. I am here to teach for the British Council, and the locals I meet tell me they’re exasperated that, because foreigners are advised not to visit, the country is being defined by negative headlines. In reality, the country’s music scene is flourishing, from rap to reggaeton, tropical indie to synth-pop. The population in Caracas is young and energy levels are high.

Venezuela’s music remains as varied as its geography. On one side the country borders the Caribbean; to the south is the Amazon; in the centre are Los Llanos, the great tropical plains of cowboy country. There is indigenous tribal music, the rich influence of the Caribbean, from reggae to African-influenced styles, and llanero, emotional flamenco-like songs played with harps and petite guitars called quatros. And these are just the traditional styles.

Facebook Twitter Pinterest Strongman amid chaos … Venezuela’s president Nicolás Maduro at a rally this month. Photograph: Reuters

By law, radio must play a 50/50 split between traditional Venezuelan music and other sounds, although this is sometimes dodged by playing new Venezuelan music with folk influences. Batita González and Lorenzo Martinez are the presenters of a show on Caracas commercial station CircuitoX, and have known each other since they were teenagers. When I arrive at the station for an interview, they can’t go on air for their New Music Friday show because the government controls all radio and TV networks, and President Maduro is speaking. This means all channels are broadcasting his voice, and will do so until he stops, which may be in 20 minutes or two hours.

In the downtime, Martinez tells me that he collects vinyl, but that there aren’t really any shops, and trade these days happens between people on social networks, save for one wild dealer who has boxes and boxes of stuff. He recommends I check out Venezuelan composer Vytas Brenner – 70s Tangerine Dream-style synthesisers with added proggy guitar.

Their studio has a view of El Avila, the mountain that looks over the city, a moody barometer cast in lush green shade or pink evening light depending on the weather and time of day. It is sometimes greyed out in heavy rains that overcome the city for 20 minutes, then stop, and roads that had become rivers become roads again. Between us and El Avila is Caracas’s Ballardian architecture – high rises and modernist concrete stacks that sprang up in the boom years when the city expanded at pace. It is a beautiful modern city in a tropical climate, but the rug is being pulled from beneath it. Further out are the barrios where water supplies are failing.

González sees her job as giving people a platform to be heard. “All of our musicians are making the soundtrack to a country that has been through a lot in the past 20 years,” she says. “Censorship, shortages, a huge exodus, among other tragedies, have made our music more mature.” She says bands such as the pop-punk of La Vida Bohème or jangly indie of Mexico-based Venezuelans Los Mesoneros might not be explicitly political but are “the soundtrack of a generation that decided to fight through their music, inspiring performances in a country where no other artists can come and perform”.

Facebook Twitter Pinterest Pop punks … La Vida Bohème in 2011. Photograph: Rodrigo Varela/WireImage

Others looking to raise up Venezuelan acts include Jonathan Loaiza, a photographer and video producer who is developing the website Kluster Music to showcase Venezuelan music. “It’s really hard to find Venezuelan albums on the internet, especially rock music,” he explains. “They’re overlapped by bigger ones from other countries.” Mafe Burbano, meanwhile, is a giddy encyclopaedia of her country’s music, dressed in black-rimmed glasses and a band T-shirt. She is creative director of Cusica, which promotes and supports Venezuelan musicians in various ways. After I left, Cusica put on its first festival in five years – three days of non-stop Venezuelan indie, pop, rock and punk. It was a big deal to have a Venezuelan-only festival. One reviewer wrote: “This weekend, we weren’t just surviving. We were actually living.” Just three years ago the city was racked by violent protests – outside their offices there is a list of 50 names painted on the road, commemorating those who died. The names are fading on the tarmac, but protests still happen regularly.

Burbano takes me on a 90-minute whistle-stop tour of Venezuelan music. I scrawl 10 pages of notes about bands I have never heard of – celebrated punk and rock groups that have been around for decades, such as Caramelos de Cianuro (Cyanide Candies), who she describes as “the Rolling Stones of Venezuela”; Sentimiento Muerto (Dead Feeling) and ska band Desorden Público (Public Disorder) who are loved by parents and their kids alike. Reggaeton saturates the city, by, for example, Chino Y Nacho, who had a very public split and now perform solo. Rap is healthy – Burbano plays me the velvety neo-soul hip-hop of MicroTDH. She also tells me about her favourite garage band, HolySexyBastards, who have a female drummer. She talks about folk music such as gaita, and the traditional polyrhythmic vocal music of Betsayda Machado. One piece she plays knocks me for six: a luminous tonada – folk song – by the “father of Venezuelan music”, Simón Díaz. It is a cow-milking song about the moon and it is gorgeous, diaphanous and lonesome.

Burbano also plays a track by Anakena, a sort of Venezuelan version of Vampire Weekend. She says that all the indie rock bands, including Anakena, have a song about separation on their recent albums. A group called Malanga took a break because its members were all in different countries, and their story is not unique. Extended families are now spread across the world, and it’s difficult to keep a band together, because those who can leave often do. The musical diaspora, from Devendra Banhart to queer producer Arca, is also often more visible than those at home. Contemporary quatro musicians C4 Trio have a track with singer Luis Enrique about “the walkers” – those who migrate on foot.

Putting shows on is difficult. It is expensive for people struggling under hyper-inflation to attend, and it’s not safe to go out at night. Concerts and festivals usually happen at weekends or in the early evening; at late shows, venues sometimes lock the doors so people can stay talking and drinking until daybreak. It’s not ideal, but it works. Some years ago, a fresh and springy style of super-fast dance music called changa-tuki sprang up largely through afternoon club sessions. In a gallery built under a bank, I catch an early show of experimental breaks and fugged-out drones by Andrea Ludovic and Juan Sebastián Ávila, with Diamanda Galás-like vocals by a singer called Janis Denis. I follow it up with a blues-funk band in a hotel called Mr Bosch and the Bluetones, sponsored by a local beer.

For indie and rock fans, the country’s biggest annual event is the Nuevas Bandas (New Bands) festival, which has been going for nearly three decades. It had finished the day before I arrived, and everyone was buzzing about that year’s winner – a guitar player called Wilmer Franco who had apparently come from nowhere. Franco’s contemporary blues make him sound as if he has walked straight out of Nashville – he sings in a perfect southern drawl – but he is from Acarigua, where people’s lives are more difficult, and basic infrastructure like power cannot be relied on.

In contrast, I am a protected and privileged European here, and I’m staying in the relatively fancy area of Altamira, but I’m also not allowed to walk anywhere or go out alone. Houses have electric fences; many cars are armoured. I ask if there are any free newspapers, but there’s no paper, and censorship comes down hard on anyone seen to be criticising the government. A stall selling apples is a remarkable sight – such expensive imports are rarely seen.

I speak to Batita González by email when I get home, about whether she thinks things will change. “Everything is linked to the economy,” she writes. “I think that little changes are coming, such as Cusica fest or the Sunset Roll fest, so I want to be optimistic, but in the short term, I’m not sure.”

Facebook Twitter Pinterest Optimistic … electronic specialist Miguel Noya. Photograph: Siné Buyuka

Someone who remains positive about Venezuela’s future is Miguel Noya, an elder statesman of the country’s electronic music scene who has been active since the 70s, when he played in fusion bands. He tells me the country used to get records before the rest of South America – once receiving a Queen record two days after it was released in the UK. “We were sponges,” he says.

He now lives in Madrid and Caracas, making music in a style he calls “electro-shamanism”, which uses binaural effects to generate physical changes in his audience. He studied Venezuelan indigenous shamanistic practices to make it and an album has just been released on Brighton label Phantom Limb. Noya remembers returning home from winter in Boston one February: “I arrived at night, and in the morning I opened the curtains and the colours just blew my mind. It is an influence in all the artistic expression in Venezuela – the power of nature, the power of colours, the power of the weather.”

Noya recently had to stop teaching electronic music in Caracas because of power outages, lack of equipment, his students being unable get to school and terms being cut short. Despite this, he remains unflinchingly hopeful. He asks if I liked meeting people in Caracas: “Aren’t they all heart, and always trying to communicate with you?”

He says he sees the same fierce hunger in the younger people he works with that he himself had as a youth. “We are constricted,” he says. “But younger generations want something different – it’s a thirst for the new, a thirst for modernity. And while we have that, it will be difficult to kill the culture.”