The trumpet solo is mellifluous, the horns rich and full. The rhythm section swings with the aristocratic confidence of Ellington in his pomp. It’s only when the lead singer comes in that things go a little strange. “Another war,” he croons, “another profit. Another Jewish business trick./ Another season, another reason/ For makin’ whoopee …”

If you hadn’t realised Eddie Cantor’s 1928 toe-tapper Makin’ Whoopee was quite so politically incorrect, fear not. These aren’t the original lyrics. They were recorded by a German singer during the second world war, rewritten for propaganda purposes and designed to instil fear into the hearts of the enemy. It is one of the strangest stories in musical history: the time Hitler had his own hot-jazz band.

Officially, the Nazis detested jazz. The Führer thought it primitive and depraved. For Goebbels it was Entartetemusik – “degenerate music”. From 1933, radio stations were forbidden to play anything that resembled it; musicians were issued strict instructions on how to hold their instruments so as not to resemble black performers. In conquered Czechoslovakia, an order reportedly forbade “hysterical rhythmic reverses characteristic of the barbarian races” (improvisational riffs). Swing – a music rooted in African-American culture, popularised by Jewish musicians – was doubly verboten.

But that reckoned without its potential as a weapon of war. In 1939, Goebbels’s propaganda ministry decided on a drastic new move – taking swing to the enemy. They would recruit their very own band from the best Germany could muster, their salaries paid by the government. Fronted by an Anglophile crooner-cum-civil servant called Karl Schwedler, led by a jazz-obsessive saxophonist called Lutz Templin, their mission was to record American-style dance music, change the lyrics, and broadcast it to the Allies. If bombing raids and u-boats failed, perhaps the Nazis’ stealth weapon could be syncopated antisemitism. They were christened Charlie and his Orchestra.

The story of Karl/Charlie and bandmates arrives in Britain this week, courtesy of a new show at Coventry’s Belgrade theatre. Entitled Propaganda Swing, it’s written by the Scottish playwright Peter Arnott, and describes the band’s journey from inception and fame to dissolution in the chaos of the crumbling Nazi regime. Arnott happened upon the tale two decades ago, when he dug out a book from the back of a filing cabinet at the offices of the Glasgow-based Herald newspaper. “It was about the history of German radio during the war, a fairly dull, technical book, but at the back there was this CD. I put it on and there were Charlie and his Orchestra, all these astonishing songs. My jaw just hit the floor.”

Templin and his bandmates were given permission to buy contraband 78s and tune into foreign broadcasts for Hollywood and Broadway hits, transcribing what they heard and rearranging it to suit Nazi dogma. Originally, the music was never intended for domestic release, but as the war wore on and German morale began to dive, Goebbels gave permission for it to be played at home. Altogether they recorded around 270 songs, and became some of the biggest stars of the war.

Historians have long recognised that the Nazis had – to put it mildly – a conflicted attitude to the arts. In public, the regime sought to forge a Völkisch nationalist culture, dismissing “degenerate” or avant-garde work and elevating German artists such as Wagner and Beethoven, Goethe and Schiller. In private, many high-ranking Nazis adored forbidden music and art. Goebbels himself – a failed playwright who had once written an experimental novel – had an embarrassing soft spot for expressionist painting. Goering once admitted that it was “easier to make an artist into a National Socialist than the other way around”.

If things were complicated in policy terms, they were even more so for Templin and his bandmates. Many of their fellow musicians had been forced to flee or were in concentration camps. But playing along – quite literally – with the regime not only gave them political protection and financial security; it allowed them to keep performing the music they adored.

“It’s not just money,” says Arnott. “They really love this music. They make a pact with the devil, in this case a devil wearing a swastika. But you’re in Berlin in 1939, you’re a musician, the alternatives are pretty horrible – what are you going to do?”

It’s clearly been a labour of love for Arnott, who has spent two years refining the script and, together with arranger Hilary Brooks, has kept an obsessive eye on its musical contents. The song list for the show segues gracefully from early standards such as WC Handy’s St Louis Blues to Cab Calloway’s rawly sexy Minnie the Moocher, plus a scattering of Charlie’s own surreal songs – You’re Driving Me Crazy redone as anti-Churchill satire (“The Germans are driving me crazy, / I thought I had brains, but they’ve shattered my planes”), Thanks for the Memory reworked to critique the Treaty of Versailles.

The music will be played live on stage by eight actor-cum-musicians, supplemented by three jazz professionals; tighter forces than Templin had access to, but, from the burst I hear during rehearsals, they’ve learned to swing with the best of them.

While he hopes the show will be enjoyable to watch – and shine a spotlight on an under-explored area of jazz history – there is a serious purpose here too, argues Arnott: the issue of whether art can ever truly be free of politics. “Music is a redeeming thing in our lives,” he says. “But if it’s compromised, does it still redeem us?”

• Propaganda Swing is at Nottingham Playhouse until 18 October. Box office: 0115-941 9419.

• Propaganda Swing review – the Nazis’ jazz band struggle to find their swing