Its fairy-tale battlements the colour of honey, its miles of sandy beaches and a bustling blue-and-white medina straight out of a picture book have made this laid-back little port on Morocco's Atlantic coast a magnet for musicians since its hippie heyday in the Sixties.
Jimi Hendrix, Cat Stevens and Frank Zappa all visited Essaouira, and locals stick happily to the story that Hendrix's "Castles Made of Sand" was inspired by the ruins of the Borj El-Berod watchtower, a crumbling former fortress on the water's edge to the south. That the song was recorded two years before Hendrix is known to have visited Essaouira is only a minor inconvenience. "Well, it's obvious, isn't it," says our new friend, Hassan, with a commendably straight face. "He came much earlier. In secret."
Fortunately, Essaouira has no need to rely on dodgy legends for its musical fame. The town hosts an array of music festivals – a classically based Alizés festival every April, an exuberant jazz and world music festival in late June, and a gypsy and flamenco-based Festival of the Atlantic Andalusias in October. But even outside of festival time you'll find eager performers in full swing in venues ranging from the cosmopolitan cool of the town's trendy Caravane Café (2bis Rue Qadi Ayad; 00 212 524 783111) to the ramshackle restaurants of the alleyway Rue El Khabbazine (near the jewellery souk), where local musicians take cheap tagine suppers.
On our first night, Hassan has brought us to one of his favourite music haunts, the Il Mare restaurant (43 Rue Yamen; 00 212 524 476417). Its funkily furnished terraces look directly over the cannon-lined ramparts of Skala de la Ville, the 18th-century sea bastion that runs along the northern cliffs. Sharing a dish of baked oysters and a bottle of local Val d'Argan red wine, we've watched a breathtaking marmalade sunset spilling like shot silk across sea and stones, and now a local gnaoua band is tuning up. This music is Essaouira's hypnotic pulse and living history. Played on traditional instruments – bass drums, iron castanets and the lute-like guimbri – its mesmeric rhythms and chants were first developed by slaves brought to Morocco from sub-Saharan Africa.
More recently, gnaoua players have blended their own distinctive sound with other musical traditions, and tonight, to our delight, is no exception. Alongside an exquisitely inlaid guimbri, carved from local thuya wood by artisans in the archways below Skala de la Ville, a battered electric guitar suddenly strikes up, and Il Mare starts to rock.
We wake up next morning with sore heads but happy hearts – and in the most comfortable bed ever. Essaouira has retained the colour, friendliness and easy charm that first attracted hippie travellers, but there's no longer any need for visitors to rough it. Boutique hotels and chic riads abound, and we're in the most glamorous of all.
Housed in a sumptuously restored former palace, Heure Bleue Palais sits within the medina just inside the Bab Marrakech gate. It's fantastically stylish, with marble pillars, carved cedar panelling and Essaouira's only rooftop swimming pool. Breakfast is served on silver salvers, in a palm-filled courtyard brimming with birdsong and the tinkling of a fountain. Replete with fruits, honey pancakes and sticky cakes, we head down cobbled streets into the heart of the medina. Essaouira's lively souks, clustered around where Avenue Mohamed Zerktouni and Avenue Mohammed El Qouri meet, are just as colourful as the labyrinths of Marrakech but more manageable, less manic.
The main drags are awash with the fumes of new leather from stalls crammed with conker-coloured satchels, belts coiled like sleeping snakes and neat rows of sequinned babouche slippers. But for more authentically exotic shopping, we follow the locals into the specialist markets that pack the adjacent alleyways. In the spice market, Berber women gather shyly to sell siwark (walnut-tree bark), used to redden lips.
Time for a jug of eye-wateringly thick coffee at Dar Tata (202 Marché aux Grains; 00 212 661 774676), one of the friendly open-air cafés that line the arcades of the grain market. Later, we take an atmospheric stroll around the nearby Mellah area, a quiet maze of decaying mansions left by the town's now largely departed Jewish population.
Several of the houses have the town's emblem, the six-petal Rose of Mogador (Essaouira's former name), carved over their entrances, and in one little backstreet filtered by shadows we stumble on the Hammam Babsi steam baths, where Orson Welles filmed for Othello in 1949.
We retire to Place Moulay Hassan, the main town square near the waterfront, to watch the action unfold from the upper terrace of the Bab Laachour café (Place Moulay Hassan; 00 212 524 473102) over a cold Flag beer. It's only noon, but the buskers are already out in force. In the café, a young man, dressed in the traditional multi-coloured robes of gnaoua performers, passes among the tables. He's distributing leaflets for the band that's due to play this evening at the Restaurant Café des Arts (56 Avenue de l'Istiqal; 00 212 666 314221).
You're never far from music in Essaouira.
Linda Cookson travelled with Abercrombie & Kent (0845 618 2213; abercrombiekent.co.uk), which offers four nights' B&B at Heure Bleue Palais in Essaouira plus three nights' B&B at Les Jardins de la Medina in Marrakech from £1,285pp, including return flights from Gatwick to Marrakech and private transfers. British Airways (0844 493 0787; ba.com) flies to Marrakech from Heathrow and Gatwick; easyJet (0843 104 5000; easyJet.com) flies from Gatwick and Manchester.
Heure Bleue Palais at 2 Rue Ibn Batouta, Bab Marrakech, Essaouira (00 212 524 783434; heure-bleue.com), has double rooms from €200 per night, B&B.