The rest of the world looks up to Brazil as world champions of partying, and by the same token, Brazilians doff their hats to the north-eastern state of Bahia and its capital, Salvador, as the undisputed kings and queens of carnival, music and knowing how to have a bloody good time.
As early as the 17th century the magnificent Bahia de Todos os Santos (Bay of All Saints, which Salvador overlooks and which gives the state its name) was given the epithet e de Quase Todos os Pecados (and of Nearly All the Sins), because of its reputation for decadence and bawdiness. Today it's a funky town – tropical, soulful and intoxicating. I went on holiday to Brazil in the early 1990s, fell in love with Salvador and stayed for five years.
But unlike in Rio or São Paulo, you won't find a hip party scene here. In fact they don't do nightclubs or trendy bars too well at all in Salvador – the best parties take place in outdoor spaces or in the street, and no one really cares how you're dressed – shorts and flip-flops will do. Paradoxically, the carefree spirit exuded by Bahians is the direct result of 350 years of slavery. Around 40% of all African slaves transported to the New World came to Brazil – officially 4.5 million, perhaps many more. Millions came to Bahia, the centre of Brazil's sugar and slave trades, and today more than 80% of the population has African ancestry.
Salvador is the oldest city in Brazil and was its capital for more than 200 years, until it was replaced by Rio de Janeiro in 1763. Bahia then went into decline. Isolated from Brazil's wealthy south, it was left to simmer under the tropical sun for two centuries, a melting pot of Africans in exile who developed a culture – music, dance, cuisine and religion – unique to this corner of Brazil, and more connected to Africa than anywhere else in the Americas. On the great sugarcane plantations of Bahia's interior, samba slowly evolved from the ancient African rhythms. Sugar was to samba what cotton was to the blues in the American south.
Bahia's energy is celebrated in Brazil! Brazil!, a show that has just opened in London, part of a summer-long festival showcasing Brazil's music and arts. It is an adrenaline-pumping journey through Bahia's musical history, taking in samba, capoeira (the fusion of dance and martial arts), slavery and even football, performed by a troupe of musicians and acrobatic dancers.
Its producer, Toby Gough, found inspiration for the show after visiting Salvador and meeting Carlinhos Brown, the city's most gifted musician and songwriter, who helped cast many of the performers of Brazil! Brazil!, some from his own music school Pracatum (named after the noise the hand makes when striking a timbal drum), which he set up in Candeal, the poor neighbourhood he grew up in. Brown is a musical phenomenon who always has a string of projects on the go. One of his most recent was the restoration of the old gold market in the lower city and turning it into a music venue, the Museu du Ritmo. It's worth catching his funky percussion group Timbalada there for their ensaios, the rehearsals-cum-shows that all of Salvador's main music acts hold in the months before carnival.
The music industry in Bahia revolves around carnival (and the preparations for it) when for six days and nights every February a million and a half people dance, sing, drink and flirt their way through the streets behind trios elétricos. There are dozens of these giant trucks, banked with walls of ear-splitting speakers with the band on top. It is by some distance the biggest party on earth and I still count my first two or three carnivals as the most joyous weeks of my life.
For me the highlight of carnival is always the soulful rhythms of Ilê Aiyê, an Afro bloco, or street band, of more than 100 drummers playing in the suburb of Curuzu, miles from the centre of town. Ilê was formed in the mid-70s as an alternative to the whites-only carnival schools of the time. Only black people are allowed to join the bloco at carnival, but all are welcome to its brilliant Saturday-night ensaios which take place throughout the year. Sadly these have moved from the atmospheric yard of a colonial fort to an indoor space in Curuzu, but it is still well worth the trip out there. Take a taxi (all the drivers know it) and don't bother showing up until after midnight.
Many other Afro blocos play in Praça Tereza Batista in the Pelourinho, Salvador's magnificent but neglected old town, home to some of the finest colonial architecture in South America. You can still find good music here on Tuesday nights and weekends but the Pelourinho (which means whipping post) is in such a sorry state that last week the President of Brazil, Luiz Inácio Lula da Silva, went to Salvador to pledge money to renovate the area and appease Unesco's threat of withdrawing its world heritage site status.
A bar close to the old town is Galpão Cheio de Assunto (Rua Djalma Dultra 40, Sete Portas), brainchild of percussionist Peu Meurray. It attracts a cool clientele on Saturday nights and big names such as Mano Chão and Seu Jorge. If you want to combine a great vibe with music and a spectacular setting, the Saturday afternoon jam session at Solar do Unhão is the place. This former old sugar mill is a complex of colonial buildings, including a modern art museum overlooking the bay.
Rio Vermelho is the lively Atlantic suburb that is the home of the Yemanjá festival on 2 February. It's the best pre-carnival warm-up party, with followers of Candomblé, the animist religion introduced by west African slaves, presenting flowers and other gifts to the sea goddess. On the day of the festival the small beach is crammed with devotees dressed in white offering flowers to the sea. The rest of the year Rio Vermelho's Teatro SESI has live regional music on the patio every night of the week. Across the street is Boteco São Jorge, which is good for samba.
If drumming and samba provide the rhythm to life in Salvador, Candomblé is its spiritual driving force and practised as widely as Catholicism – from which it has borrowed certain rituals. It was illegal to follow Candomblé until the 60s, and even when I lived here in the 90s it was a difficult world for outsiders to enter.
It was impossible back then to visit genuine terreiros, or places of worship. But I found a new spirit of openness on my most recent visit, last year. At the Ilê Axé Opô Afonjá terreiro, one of the oldest in Salvador, I was welcomed as if attending a church ceremony – although any comparison with orthodox religion stopped there.
Around 20 men and women in white and green African costumes were circling the room, singing to the beat of three drums. Round and round they went, swaying to an ancient rhythm. Suddenly a woman started to jerk, shout and then spin like a dervish. An older man and several more women followed, entering the same trance-like state. The orixás, ancestral spirits, had taken temporary possession of their bodies. Their faces were contorted by the orixás, yet they were clearly in a blissful place, and for the next hour they shuffled and danced in and out of the room in a joyous procession. I was the only outsider there; it may be a good idea to take a guide to explain the complex rituals.
Afro-Brazilian tourism – for decades ignored by the white elite – has also come a long way. The state government has a department tasked with encouraging visitors to get more involved with this heritage. I tried two classes recently launched by UK tour operator Audley Travel – drumming and Bahian cookery. (It also offers Afro-Brazilian dance and capoeira but my knees creaked at the very idea.)
Down in the seaside suburb of Pedra Furada, in the lower part of Salvador, Tia Maria (yes, really; it means Auntie Mary) taught me to make a moqueca, Bahia's delicious signature dish – seafood stewed in coconut milk and dendê (palm oil).
"The cooker's playing up again," said Maria pointing at the rusting four-ring hob. There are no laminated recipes to follow during lessons in her kitchen (Restaurante Tia Maria) – we just got a big knife and a bucket of fresh fish. The restaurant is the converted garage of her home – a few plastic tables and chairs overlooking the fishing boats which supply Maria's seafood. I had great fun letting Maria boss me round the kitchen, and the moqueca was one of the best I'd ever eaten.
Thanks to the pedigree of my tutor Giba Conceição (click here to see him in action), my drumming lesson was more professional – he has played with many of Bahia's top artists, including Gilberto Gil, now Brazil's minister of culture. Giba taught me the basics of creating a rhythm on the tall timbal. I sounded like a kid banging a drum – and had just as much fun – while Giba coaxed such complex rhythms out of his that he seemed to have an orchestra in his fingers.
My dreams of becoming a baterista were shattered, but a couple of hours listening to Giba explain, in words and music, the history of Afro-Brazilian percussion, did lead to a tiny epiphany. I had danced many times to this beat in the streets of Salvador without ever really knowing why it made me feel so alive. One of the reasons, I now realised, is that every time you hear it, it is playing out the history of Bahia.
• TAM Airlines (+44 (0)20-8897 0005) flies daily from Heathrow to Salvador via São Paulo from £673 return. From 10 August TAM will also fly to Salvador via Rio. An 11-night trip with Audley Travel (01993 838 650), staying three nights in Rio, three nights in Salvador (with classes including drumming and cuisine) plus three nights at a Bahian beach hotel, costs from £1,250, including breakfast (and dinner on the beach), but excluding international flights. For further information visit braziltour.com
Brazil! Brazil! is on in London until 18 July as part of the Southbank Centre's Festival Brazil which opens today and runs until 5 September, and at the Edinburgh festival from 5-30 August