— As much as pop stars delight designers by attending their fashion shows, a last-minute drop-in can wreak havoc for the show’s DJ. When Beyonce turned up at J. Crew’s spring 2012 presentation Tuesday, Kris Bones had to think fast in the sound booth — and mix faster.

“They didn’t tell me till literally she was just coming in,” said Bones, 40, a London-based DJ whose clients this week have included DKNY, Prabal Gurung and Loden Dager. “It was a last-minute thing, so I just pulled up bits and pieces, some instrumental stuff” from her songs. He kept the tribute subtle; even under time pressure, there’s a fine line between welcoming a star with a nod to her music and flat-out pandering by playing her latest hit.

Of course, matching a singer’s front-row presence to the beat that rocks the runway is easier with advance warning. Since he knew hip hop’s Nicki Minaj would be at the Betsey Johnson show, Bones created what he called “a real one-off original.” Call it a couture mix: He overlaid Jimi Hendrix’s “Foxy Lady” with Minaj’s a cappella vocals. This way, said Bones, celebrities “feel special, but you’re not just putting on a track.”

Fashion shows are all about emotion, and the music plays a big part in drumming up feeling. Behind some of the best shows at Fashion Week, which ended Thursday, were imaginative DJs, though they will tell you that crafting the right musical mix for harried creative types is no easy task. It takes a little mind reading — and a large CD collection.

Decoding a vision

Typically, top designers meet with their DJs a month or more ahead of time to convey the collection’s theme. Then it’s up to the DJ to translate into music the inspiration behind, say, a silk chiffon maxi skirt in charcoal.

To go with his James Dean theme — red canvas windbreakers, polo sweaters, high-waisted pants — designer Michael Bastian, known for classic updated sportswear, wanted songs that evoked “that emotional meatiness of James Dean, the whole fragileness of him.” He chose a song by Boy George and a slow, sultry cover of the Beatles’ “I Want to Hold Your Hand.”

But not all designers know what they want. Worst-case scenario: The designer who once told Bones, “This is our theory: It’s Japanese American, and here’s a picture of a mountain.” Bones was exasperated. “What can I do with this picture of a mountain?”

Best case: a time, a place and a persona. When Mark Badgley and James Mischka met with DJ Javier Peral, they told him they had in mind an eccentric woman from the 1960s, like a starlet in one of jet-set photographer Slim Aarons’s books. “Palm Springs, beachy glamour, pools,” Peral said. That gave him a starting point.

But Peral, 47, also knows that designers “don’t want to take it too literal. Everyone wants to go on the modern side and make the clothes look young and appealing.” So at the Badgley Mischka show Tuesday, he led off with “Add Ends,” a dreamy song with a sparkling pulse by the Danish pop band When Saints Go Machine.

“I liked the sound,” said Peral, who studied law in his native Spain before moving to New York, where he’s been mixing for fashion shows for 15 years. “There’s a quirkiness, it’s a little odd — their voices are choirlike without being too churchy. It’s something eccentric, but at the same time very lyrical and beautiful.”

At 9 a.m., about an hour before the show starts at Lincoln Center, Peral, a bald man with a beard and merry eyes, in a navy blazer with a polka-dot pocket square, is in the booth to rehearse the first model’s entrance. He stands in front of a huge soundboard, flanked by a couple of other guys in headsets calling lighting cues with the urgency of air traffic controllers.

“Go,” Peral says. A soft rhythm bubbles up, then wistful falsetto vocals. A blond model emerges onto the catwalk wearing a bathrobe, her hair piled up in clips, and takes a few steps. She repeats the entrance a few times, then ducks backstage to finish dressing.

Badgley and Mischka pop up to check the timing. In dark suits, collars unbuttoned, they look surprisingly mellow, even cheerful, as they prepare to watch six months’ worth of work flash by in a nine-minute parade of gowns and daywear. (Most shows are under 10 minutes to conform to YouTube’s time limit.)

“I like morning shows,” says Badgley. “They feel calmer. It’s nuttier later in the day when everyone’s running an hour behind.”

“At this point it’s taken on a life of its own,” Mischka says with a shrug. “You just stay in your lane.”

When the show gets underway, the music feels just right — the beat is a sunny, magnetic undercurrent to frothy gowns, airy trousers and high-waisted shorts that could have stepped out of a Hollywood bungalow. The show ends with a flurry of underwater gurgles, which feels like a promise of ocean breezes and margaritas. You’ve been mentally transported into a Corvette with its top down, heading to the coast in a citron georgette crepe top and tangerine linen shorts.

It went off without a hitch. But Peral and Bones have seen — heard — their share of mishaps. To a DJ, peril is measured in mere seconds . . . of silence. Someone forgets to push a button. A CD player freezes.

Or there’s a brief power glitch, like at designer Doo-Ri Chung’s show a few years back when Bones had made a mix of David Bowie’s “Sound & Vision.” It didn’t start. For an eternity.

“Five seconds,” Bones said. “That, in a catwalk show, is a disaster.” Worse, the headlines the next day riffed on the song title: “Loads of Vision but No Sound,” etc.

Then there was the show on a concrete runway that was so rough that when the models started walking, their stiletto heels snagged and popped off their shoes.

“Luckily enough, they were really expensive models, so they could walk on their tiptoes,” Bones said. “But their heels were flying, springboarding off the concrete, hitting editors.” The shoe crisis caused a slight delay, and Bones had to loop some of the music over again.

At some shows, the music itself can spike blood pressure. Betsey Johnson told Bones that the theme for her collection of burlesque-inspired corsets and see-through dresses was, ahem, a salty term for the female chest and hindquarters. Her people thought a rap song by DJ Assault that echoed the term would be an excellent way to start the show.

“The lyrics were very 2 Live Crew, very explicit, ridiculously bad,” Bones said. “I had to cut out loads and loads. I was the one that was being prudish, ’cause I’ll get the blame.” Still, he said, Johnson’s is one of his favorite shows, “ ’cause they don’t take it seriously.”

The invisible element

Bless the DJs for their trouble. Forget the swag, the lip glosses and perfumes offered to attendees. The music is one of the best takeaways from Fashion Week. Thom Browne’s trippy neo-Gatsby designs — seersucker wide-leg pants, flapper dresses and pinstripe vests, all in super-long proportions — appeared in a retro setting at the New York Public Library amid the strains of Cole Porter’s “Let’s Do It, Let’s Fall in Love.” You could almost taste the gin.

The refined but relaxed East-meets-West-at-the-Plaza mood of Thakoon’s Indian cotton shirtdresses and kid leather peplum frocks was set by Ry Cooder and V.M. Bhatt’s “Ganges Delta Blues” and Hendrix’s “Cherokee Mist.” At Michael Kors, an irresistible tribal beat (some Charlotte Gainsbourg, popular this season, and Florence and the Machine) got feet tapping while feather-festooned kaftans, python-print bathing suits and silk jersey serape dresses strolled by. Even front-row regular Michael Douglas bopped his head for a few counts. Under perfect sunset lighting, accompanied by shivery reeds and mesmerizing drums, the stream of glowing, sandal-clad beauties began to feel like one’s own welcoming tribe.

At the Ralph Lauren show in SoHo on Thursday, retro tea-garden tunes (Irving Berlin’s “What’ll I Do?”) provided the aural backdrop for languid art deco looks — generous trousers, silk boatneck sweaters and ostrich feather capes over satin slip dresses. Models emerged precisely eight seconds apart, jeweled rope necklaces dancing against simply cut necklines. Throughout this handsome show, the music built to a contemporary mix of samba rhythms and cresting strings: The sound of aspirational yearning, always a Lauren hallmark, filled the room. By the end you felt these clothes surely Meant Something.

For dressmakers as for moviemakers, the right music can lodge a look or a scene in your memory — it can even do that for a room of outfits that are not all that different, when you come right down to it, from other rooms of outfits. Music, said Mischka, “is really the extra accessory you can’t see on the runway.”