A little south of Oslo in the city of Tønsberg are medieval memories, moored longboats and the booming harbour of Oslofjord, where twentysomethings in sun hats blast tunes from their parents’ yachts. This is the daytime soundtrack of Norway’s oldest city, established way back in 871. The music of Darkside and Hot Chip sails past flower barrels and seafood diners, weaving along the promenade and up into alleys with misshapen cobbles. It rolls beyond the quaint cabinlike houses with jammed-open windows, and as its bassy vestiges depart the quayside they prosper toward Slottsfjell, an elevated haven where some Norse royals snuffed it in viking times.

There’s something economical about Norwegian landscapes. They seem condensed or remixed, delicately edited to leave the sweetest impression. It’s evident at the Slottsfjell festival site, a heavenly sanctuary that evokes literature as much as nature. The views are to die for. Up a long stone staircase stands a stage framed by never-ending sunsets. These backlight a glistening fjord and sweeping Nordic hills, themselves seemingly hand-crafted and picture perfect, every angle a new postcard pitch. It's Thursday afternoon and Alice Boman warbles gently into the hilltop breeze, a festival aperitif of cascading folk melodies and a trumpeter named Tilda...

Initially, though, the music is secondary to long jaw-to-the-floor walks, drinking in the day. Central on site is Slottsfjellet, a nineteenth-century tower built to commemorate the original Tønsberg fortress, now in ruins.

Eveningtime comes and the silhouette of Lykke Li - an ornate popstar with complex appeal - wanders onstage. For the young crowd it's early hits like ‘Little Bit’ and ‘Dance Dance Dance’ that provoke the fiercest reaction, empowered by beaming melancholy to near-Motown heights of redemption. Yet almost as popular are songs like ‘Jerome’, the kind of cinematic chain-gang ballad Nick Cave was writing in his heroin years. “Lonely, I’m so alone now,” Li sings on 'No Rest for the Wicked', elevated by fellow voices. “There’ll be no rest for the wicked / There’s no song for the choir.”

If Lykke glamourises melancholy, her inverse is the mysterious SOPHIE, a neon-bright producer who mangles cuteness. With a leather jacket, lopsided blonde curls and skinny jeans that funnel his legs into glistening boots, SOPHIE plays an hourlong set at club venue Kastellnatt. He plays schizoid bangers that skelter from honey-glitter to hip-hop in strange, horizontal transitions. As much as the music dazzles, the impulse is to laugh, repeatedly, which you do. His themes - overstimulation, advertising, irony, gender, pornography, elitism, globalisation - perfectly complement that foreign-festival displacement that attendees tend to suffer just after the boozy first wind.

In a private forcefield among the sparse crowd, immune to clueless male advances, resides SOPHIE's perfect foil. A near-alien presence, she moves in fluid swanlike arcs with cutesy mimes and heel flicks, a sort of grime ballet decorated by kawaii frippery. (She’s rumoured to be an NYC performance artist preparing SOPHIE’s full live show.) Meantime, following suit behind-stage is a slightly less limber Jacques Greene, whose own set of darkly enwombing house later succumbs to the more marketable Diplo, all programmed drops and screams of ‘Norway!’, magpie electro for men in quirky tights.

Sober next-mornings are the correct setting for the home-country likes of Highasakite, who make soaring, downtempo folk that suits the country’s luxuriant pace to a tee. Choose roving rivers over railroad revivals, they beseech. Stagefront fans fix one another with longing gazes, performing the kind of revelatory hand gestures usually associated with distraught parents facing tragedy on the TV.

Across the site and beside a kids’ library and lounge is P3 Urørtscenen, a stashed-away stage that hosts hopefuls like unshowered Westerbergian punks Hjerteslag and the songwriter Tellef Raabe, whose blunt vocals faintly evoke Will Oldham were he less amused by than enamoured with his darkness. A highlight of the Urørtscenen bands is Farao (pronounced Pharaoh), a sternly captivating presence who seems suspicious when anyone cheers, yet sings soft molten ballads that can't help squeezing your heart.

Friday midnight after Phoenix (one of those secretly massive European bands whose popularity is at once surprising and sound), Lxury rolls unassumingly onto Kastellnatt’s main stage and teases dance nerds and Diplo fans alike with his playful strand of eclectic house. It creates a false sense of security for the punishing Evian Christ, who capitalises on his cautiously populous draw with manic flourishes and gloriously haemorrhaging bass. He giggles spasmodically at the notorious “civil rights sign” lyric in his Kanye-production, ‘I’m in It’, before closing with a deathly ambient rendering of DJ Sammy’s ‘We’re in Heaven’, as lovers dance and twirl with sarcastic earnestness.

Midday on the promenade a tanned jogger in yellow boxers tap-dances through tourists, squinting at the sun and sprinting past longboats.

Nearing the end of a three-day festival that has bordered on fantasy, it’s fair to say Saturday’s activities begin precariously. They're approaching a nadir, when rolling out the valley comes the music of the Lumineers, who are performing a sea shanty cover of Bob Dylan’s ‘Subterranean Homesick Blues’. The set is relentless. To wild applause they craft scenes of pageantry; American bandstands and fictional women whom they address as “lovely girl”.

A heavy current of bodies drives towards Kastellscenen. On arrival it must be said that Skambankt!'s saw-toothed logo and uniformly male audience promise little. But in fairness the atmosphere’s wild. The Norwegian four-piece stomp into the metal tradition of toying rhythms and trapdoor resolutions, rather than SEO-optimised nicety. Still, even the band’s very own theme song can’t stop us departing cross-site for Buraka Som Sistema, a worldly party band who seem to spend most of their time in festival reviews. You have to admire the schtick. Credit to any band that has hungover hoardes heli-twirling their tops in the dying sun.

Post-festival the backstage area abounds with boozy goodwill. First Aid Kit orbit with beaming smiles as the craziest member of Haim carries a plastic plate stacked with potato salad and salmon. Evian Christ is noble and gracious when I mistake him for Jacques Greene. Up from across the lake and over the festival glides a giant blimp promoting juice drink Solo, which resembles Fanta, and which ghosts sweetly through the clouds like a funeral motorcade.