GSK Contemporary, billed as a "meeting of music and arts", opens at the Royal Academy (RA) next month. It will feature portraits by Robert Mapplethorpe and David Hockney, Malcolm McLaren's multimedia work, Shallow, which combines film portraits set to music, and live performance from Berlin dramatist René Pollesch.

The three-month exhibition will also see the academy opening its doors until midnight three nights a week to showcase DJs and live music, which organisers hope will help to draw people to the venue.

While classical music has been a staple at museums since time immemorial, the RA is just one of a number of museums that is adding alternative music to its arsenal of outreach initiatives to bring in extra revenue and to attract new, diverse and, above all, younger audiences.

From Nick Cave at Tate Britain to Leona Lewis at the Australian Museum of Contemporary Art, recent examples have seen Duran Duran at the Louvre, Simian Mobile Disco at the American Museum of Natural History, New Young Pony Club at the Science Museum in London, and Throbbing Gristle's one-off performance at Tate Modern last year, while National Museums Liverpool hosted a gig featuring the runners-up of a local battle-of-the-bands competition at the World Museum Liverpool.

Ruth Lloyd, the coordinator of the Exhibition Road Cultural Group, recognises the pulling power of live music more than most. Lloyd's group organises Music Day, an annual event that sees bands playing at venues around Exhibition Road in London.

This year's event in June saw some 50,000 people descend on the road, which was closed off for the occasion, to see electro-rockers Late of the Pier at the Serpentine Gallery; indie band British Sea Power at the Natural History Museum (NHM); and musicians at the Victoria and Albert Museum (V&A) attempting to interpret the collections through their music.

"Music is an accessible form of culture," she says. "It provides a stepping stone into the world of museums, helps people understand the collections, and brings historical objects into contemporary culture."

It is also, says Mark Miller, the curator of Loud Tate, a great way to diversify the younger visitors to your venue. Tate runs a young persons' forum, made up of a group of 15- to 25-year-olds that the museum has come into contact with through outreach projects and open events.

Guided by the forum - which Miller describes as a "good mix of young people from different social and economic backgrounds" - he booked dubstep musician Benga and electro-poppers Metronomy to play at Tate Britain last month.

Benga's MySpace page, with its tagline, "sex, drugs and dubstep", doesn't immediately draw associations with Gainsborough and Hogarth, but that's the point, says Miller.

"This is a way of getting young people in, and also relates to what we are doing with the displays and collections. We have had everything from grime to indie, and the idea is to merge those people, so that you don't just have an indie crowd, but you mix the music and the people."

But loud music and collections don't always mix. Miller recalls the time he booked Asian Dub Foundation during a Holbein exhibition only to receive worried notes from the conservators that the decibel levels may have caused the drawings to vibrate. The drawings were fine, but now he scrupulously checks decibels for every act that he books and is extra careful about the positioning of the speakers.

Caroline Jones, who runs Miss Jones & Co, a company specialising in organising events, agrees with Miller that vibrations in this context are not necessarily good. She organised a gig for the Strokes in the great hall at the NHM in London, and remembers looking up at the dinosaur at one point to see its tail moving in time to the music.

Being mindful of the exhibits is an issue when organising events in museums, she says, because there is heavy PA equipment involved, while the most valuable museum pieces need to be removed or roped off.

Laura Harmour, events coordinator at the NHM, agrees: "For every event like this we do a risk assessment into exhibits in nearby areas that might be vulnerable to vibrations and, where we find that they are, we move them. For the British Sea Power gig, for instance, we removed a case of eggs from the bird gallery."

But decibels are not the only hazard at a museum gig. Julia Brown, membership manager at the Guggenheim in New York, has put on a number of acts, from French band Nouvelle Vague to local rockers Ratatat, as part of the Guggenheim's evening opening programme, and says that drunken people can sometimes be a problem.

"We have had incidences of people getting too close to the art, but nothing too serious. People that have had a little too much to drink are identified by security personnel and gently escorted off the premises. We don't want people to feel like we are treating them like animals, but we have to protect the art."

Security is paramount to the smooth running of these events. On top of existing safety measures, says Brown, security personnel is more than doubled and the museum rents around 200 stanchions to keep people back from the art. But security isn't cheap.

The American Museum of Natural History (AMNH) nearly pulled a live show by psychedelic dance music act Simian Mobile Disco (SMD) after seeing a YouTube video of one of their gigs in which the crowd were going wild.

Initially the museum suggested perhaps the act would just do a DJ set instead, but they were placated when the band's management paid for extra security at the show because they wanted to do the gig.

Bands, it seems, are as keen to play at museums as museums are to have them. Oli Isaacs, SMD's manager, says: "It was nice to have a break from the norm, and it was much more of an event [than playing a traditional venue].

There were over 2,000 people. The band has never played to that many people in a club before. It was a very different atmosphere and demographic. There was not that many people on drugs in the museum crowd."

But do those people that go to the museum for the music return for the exhibits? Tom Coupe at Somerset House thinks so. Priority booking for music events is given to anyone signing up to the venue's mailing list, allowing it to market other non-music events to the same people.

The AMNH took another approach: anyone with a ticket for the SMD gig could reuse it to visit the museum. And Tate, after finding that a number of people attended last year's Loud Tate event just for the music, introduced a scheme whereby only those people who had taken part in an art workshop would receive a stamp allowing them into the gig.

It remains to be seen whether these people will become repeat visitors or art enthusiasts, but, as Oli Isaacs says: "There's no reason why museum-going and underground music should be mutually exclusive."

What the bands say

"I really enjoyed it. The only downside was that we couldn't play in amongst the bears and whales though. We were provided with some archive Natural History Museum footage, which was great. There was a horror B-movie-esque giant squid autopsy, which was fairly gruesome. The fans loved [the show]. I'm sure people will revisit. I certainly will."

Martin Noble, British Sea Power, Natural History Museum, London

"I found it really boring when I was a kid going to museums, but more recently me and my girl Jess took her little cousin to the Natural History Museum. The main part was good, but the really good bit was the kids' area. It was amazing. They just give you loads of fossils and stuff to play with."

Jas Shaw, Simian Mobile Disco, American Museum of Natural History, New York

"I hope we put a smile on the Mona Lisa's face."

Simon Le Bon, Duran Duran, The Louvre, Paris


What the fans say

"They didn't take advantage of the sweet light show capabilities of the planetarium. Simian Mobile Disco brought their own light show, which was really awesome (but would have been so much more awesome if I was on drugs). As for the planetarium itself, however, there was nothing in terms of lights during the set. I feel like the space could have totally been utilised better."

Katherine Hulit - Simian Mobile Disco, American Museum of Natural History, New York

"Great night in a great venue. How do you top that as a place to play?"

Bancroftboy - British Sea Power, Natural History Museum, London

"Not loud enough to drown out the Somerset House bells every quarter-hour. Nor the seagulls, nor the jet that flew over, nor the billowing wind. In short, it was harp loud, but the crowd was rapt."

Joanna Newsom - TheNo, Somerset House, London