There is nothing that can cause quite such a ruckus as a popular tune. The potential danger of music – its power to incite, upset and insult – covers the political spectrum. It worries, in about equal measure, the sensitive liberal, anxious not to offend vulnerable listeners, and the censorious moral fundamentalist wishing to protect society from being corrupted.

From the moment it could be recorded and distributed to the masses, the pernicious influence of popular music has been seen as a problem by those who run things. "No one is more alive than I to the need to buttress the forces of virtue against the unprincipled elements of the jungle," the BBC's controller of sound broadcasting wrote during the 1950s.

When I embarked upon a two-part documentary for Radio 4 called Taboo Be Doo, the first of which will be broadcast this Saturday morning, I knew that following the progress of controversial popular songs over the past 100 years would be tricky. I ended up concluding that, while the clunking machinery of censorship may no longer be in place and references to the forces of virtue and the jungle are something of a rarity, we are in as much of a muddle about what should or should not be heard as our forebears.

How those things are decided these days is, on the face of it, more democratic. There are no committees of unnamed men at Broadcasting House deciding what we should be allowed to listen to. Instead, the key element in what is permissible is the complaint. The BBC used to be bold in this area – when a few listeners complained about Tom Lehrer's "We Will All Go Together" being played on the Light Programme's Housewives' Choice, the view was that the non-objecting majority should be allowed to hear the song. Today, as I was to discover in the making of Taboo Be Doo, the corporation has to be much more careful. The problem is no longer morality, but offensiveness. Someone somewhere is going to get hurt and his or her pain is a matter of great concern.

It was about five years ago when I first became intrigued by the way ideas of what is acceptable in music change over time. I had recently experienced, rather to my surprise, a seismic shift in my musical taste. I had begun listening to – and playing on my guitar – songs from the pre-rock years of the first part of the 20th century.

With a fellow guitarist, Derek Hewitson, I devised a show based on politically incorrect songs of the past century, including a few of my own, and took it to the King's Head Theatre in London, the Hay and Aldeburgh literary festivals, and the more broad-minded village halls.

What I found most interesting about the songs that were once innocent and are now shocking, or the other way around, is the way they unerringly reveal what was going on within a society at a particular time. There is no medium quite as spontaneous and intuitive as songwriting; by its nature, it is more direct, less self-conscious and controlled than fiction, film or journalism. It reveals a culture in an unguarded state – relaxing at the end of the day, its top button undone, perhaps having had a drink or two.

In our show, we visit hits from the 1920s that suggest the growing fascination people had towards distant, exotic countries – songs which, while humourous, have a slightly erotic undertow: "Sing Song Girl", "The Sheikh of Araby", an utterly bizarre tale about the isle of Pingo Pongo ("Never mind their morals/ What have they to hide?/ The women dress in corals/ And the men seem satisfied").

The novelist Edmund White once said that "good writing is about bearing witness to uncomfortable facts". Musical lyrics can do the same thing, often unwittingly. The years after the Second World War, which had given women a new and dangerous sense of independence, a significant number of brutally sexist songs were released across the genres from Western swing to rhythm and blues.

Hank Penny had a hit with a song called "Catch 'em Young, Treat 'em Rough, Never Tell 'em Nothing" while another popular novelty song with the same theme was "Slap Her Down Again, Paw".

Even songs taking a more morally commendable line had a nasty undertow. Louis Jordan's 1946 hit "That Chick's Too Young to Fry" warned against chasing inappropriately young girls, but the moral message was slightly spoilt by its sustained poultry metaphor: "Take her back to the barnyard/ Set her down and let her loose/ Way back there in the barnyard/ She'll grow up for better use."

When I appeared on Radio 4's Loose Ends last weekend to discuss Taboo Be Doo, Clive Anderson asked me, with more than a hint of disapproval: "What's your object with these shows? Is it just to get some laughs?" I had to admit that many of yesterday's prejudices can be funny as well as shocking. One would have to be very prim to be entirely straight-faced listening to a song as blatantly incorrect as Eddie Cantor's song from the 1920s, which goes: "The dumber they come/ The better I like 'em/ 'Cause the dumb one know how to make love."

Those on the other side of the fence can be funny, too. It is hilarious that Randy Newman's "Short People", a 1977 parody of intolerance was the subject of such disapproval that the state of Maryland tried to pass a law banning the public playing of it.

Or that, in the 1950s, the BBC's head of religious broadcasting (who had a big say in what could be broadcast) decreed that Petula Clark's "The Sky", an English version of the French hit "Le Ciel", should be banned because "to use the word 'sky' as a veiled reference to God or Heaven is offensive to religious feeling".

But making the programmes reminded me that we have no reason to be smug. The balance between free speech and the right not to be offended is one of the great debates of the moment. Far from being grown up about the prejudices of the past, we are so nervous about them that we quite often prefer to pretend they did not exist. There is a danger here of what CS Lewis, in another context, described as "chronological snobbery", an easy assumption that our standards are superior to those of the past. When it comes to songs to which someone might object – even wrongly and stupidly – we now prefer not to risk it. I have heard a historian suggesting in a radio interview that the minstrel songs of the early 20th century are so disgraceful in their language and racism that they are too shameful to be studied.

The default position today is to play safe. In an interview, Jeff Smith, the head of music for Radio 2 and 6 Music, spoke revealingly about what is now acceptable on mainstream radio.

There had been considerable discussion around "Fairytale of New York" by the Pogues and Kirsty MacColl in which the word "faggot" fleetingly appears. Eventually it was decided that because it is part of our cultural past – "a classic track" – it was acceptable.

I wondered where that left new songwriters who happened to have written a song with lyrics (or a single word) that might cause objections. And the answer was pretty clear. They would be out in the cold. In the safety-first atmosphere of today, the instinct above all is to avoid those scandalised headlines on the front-page of the Daily Mail. If in doubt, producers are likely to self-censor. I genuinely wonder whether this is any kind of advance on the more overt censorship of the past.

One of the problems that seems to affect music more than any other area is that many modern listeners, weirdly, find it difficult to understand that the "I" of a song is not necessarily the singer or the writer.

When in 1985, Mark Knopfler wrote "Money for Nothing", his narrator was based on a redneck worker in a hardware store he had heard delivering a scathing running commentary while watching an MTV video. The lyrics go: "See the little faggot with the earring and the make-up/ Yeah, buddy, that's his own hair." And so on.

He overestimated the intelligence of his audience; 26 years on, the song is still said to be homophobic and offensive. Earlier this year, the Canadian Broadcast Standards Council pronounced the song "extremely offensive" and banned it.

Knopfler seems to have concluded that that telling a song in a voice that was not his – storytelling, in other words – was no longer worth the risk. "Maybe you can't let it have so many meanings – you have to be direct," he said gloomily in an interview with Rolling Stone magazine.

"In fact, I'm still in two minds as to whether it's a good idea to write songs that aren't in the first person, to take on other characters."

The songwriter Steve Knightley, of Show of Hands, was particularly interesting about the way people hear songs today when I interviewed him. So many singer-songwriters now chronicle their own landscape, he suggested, that people have come to assume that the singer and the song are the same.

How odd this is at a time when we pride ourselves on our sense of empathy towards others, yet seem to be losing this basic imaginative capacity. Even a narrative that is not in the first person risks offence if, to the ears of the half-attentive listener, it seems to be endorsing unacceptable views. One of my own songs tells the story of a respectable suburban dad who, after his family has gone to bed, has a secret life: it is called "Harry Loves Porn". It merely tells a story and is not graphic. So I never thought the song would pose any problem – it certainly wouldn't have been regarded as contentious had I written it as a short story. Yet, to my amazement, there is genuine discomfort – disapproval even – when I play it to some audiences.

Playing our show of politically incorrect music, we have discovered that, while people can be relaxed about racial stereotypes ("Chong, He Come from Hong Kong"), obesity ("Nobody Loves a Fat Girl"), sexism ("I Want a Bow-Legged Woman) and even disability ("I'm Not All There"), there is one area to which modern audiences are likely to object.

Last year, we performed a few shows with a brilliant young singer, Victoria Hart. It was when she sang extracts from three songs concerning dysfunctional, abusive relationships that we were widely deemed to have gone too far. The first, from the 1930s, was a blues song called "Let Him Beat Me"; the second was Gerry Goffin's and Carole King's 1961 pop tune "He Hit Me (It Felt Like a Kiss)"; the third was from five years ago, an extraordinary song by the Cardigans called "And Then You Kissed Me".

All were in the first person and conveyed an ambivalence towards abuse, which liberal audiences found worrying. They disapproved of someone singing: "If he didn't care for me/ I could have never made him mad/ But he hit me/ And I was glad." The problem, of course, was that Hart sang the songs straight, as if she meant it: there was no distancing irony or disapproval.

The songs disturbed as only music can, but all the same I was surprised. The same friends who quietly suggested that we might drop that part of the show would be outraged if someone suggested Belle de Jour should not be shown because it excuses female masochism or that Roddy Doyle's novel The Woman Who Walked into Doors should be a top-shelf read because it deals with domestic abuse.

Taboo Be Doo was not without these problems itself – there have been delicate negotiations around what is permissible to be broadcast in this age of empathy and sensitivity. I have been told to brace myself for objections from those who hear a word, phrase, joke or lyric, and, making no allowances for irony or context, eagerly report how upset they were, on behalf of themselves and others.

A programme which looks at the censoriousness of the past might end up revealing that today we are a lot less grown-up about such matters than we like to think.