When Jack Kerouac first coined the term 'the Beats' for his loose-knit group of world-weary bohemians, he meant it in the sense that they were outsiders - a dangerous, free-thinking underclass. But the Beats' empathy for jazz and, in particular, the free-form bebop of Charlie Parker and Thelonious Monk, brought with it a glamorised fancy for heroin. As with so many working musicians, the pioneers of bebop eased their pressures with the needle. And just as the misadventures of Pete Doherty would be news today, Charlie Parker made the front pages in 1946 after a Sunset Strip binge led to his being committed for electro-shock treatment.

The kids loved him for it. Assuming a direct correlation between their jazz heroes' habits and their inspired musical improvisations, the Beats began experimenting, too. In an era where teenagers were carving their own niche and so to be 'hip' was everything, a fledgling youth movement was, for the first time, fuelled by narcotics. As Miles Davis noted in his autobiography: 'People were considered hip if they shot smack.'

With their subterranean fusion of radical jazz, their stream-of-consciousness compositions and their acquiescence to the languorous medications of smack, Kerouac redefined Beat's meaning to embrace the 'beat'-ific vibe of the time, and the drowsy ambivalence of heroin's afterburn. 'I'm beat' in Fifties New York would equate to 'I'm done in' today. But the laid-back, live-and-let-live philosophy the term espouses sowed the seeds of Flower Power when the Beats went West.

But before Beat turned to free love, there was an equal and opposite reaction to the Beatniks' pretensions across the Atlantic in London's Soho. Annexing their moniker from the modernists first described in Colin MacInnes' 1959 novel Absolute Beginners, London's original mods started to congregate among the coffee bars and clubs of Wardour Street in 1960. Eschewing the threadbare, wayfaring look of the beatniks, the mods favoured neat, tailored clothing and a correspondingly upbeat philosophy for life. They bucked the trend for binge-drinking and generally getting 'out of it', preferring a music, lifestyle and drug choice based on mental and sartorial acuity. Where the beatniks preferred barbiturates or downers, the mods were all about uppers.

Up until 1964, amphetamines with street names like Bennies and Dexies were both legal and commonplace, often prescribed for fatigue, weight loss, and respiratory and heart complaints. Universally known as Purple Hearts, Dinaml was the most popular high street pep pill of its time. Its side-effects, as described in moralistic detail in the accompanying use and dosage leaflet of the day, might just as well have been broadcast as a come-hither to the mod community: 'Do not exceed the stated dose. Can cause incidence of euphoria, enhanced wakefulness, increased physical activity, decreased appetite, increased respiration and feelings of power, strength, self-assertion and enhanced motivation.'

All around the country, women were popping a couple with their elevenses to help chase away the cobwebs, the blues and those pesky extra pounds around their hips. All over London, their sons and daughters raided their medicine cabinets for night fuel.

Above all, mods were night crawlers. They flocked to coffee bars instead of pubs, not just because they sneered at drunks but because most of these newfangled cappuccino bars boasted 2am licences (pubs shut at 10.30). They also had jukeboxes long before the boozers, allowing the young ones to wash down their Bennies with a frothy coffee and dance to the Who, Small Faces, the Kinks or the Pretty Things, whose 'Midnight to Six' is perhaps the quintessential mod track.

The mods' soul brothers were the rude boys from Ladbroke Grove, Brixton and Harlesden. Nattily dressed in tonic suits and pork pie hats, the rude boys were the sons of the sticksmen - the Windrush generation, brought up on the ska and bluebeat of their parents' birthplace. But in 1968, back in Jamaica, the scene was changing. Artistes like Toots Hibbert of the Maytals were slowing the backbeat right down. Reggae was lilting and gently mesmeric, as though crafted for the weed that inspired its form and theology. Reggae quickly became the soundtrack to an increasingly politicised young Jamaica. With the arrival of bands such as the Pioneers and the Wailers (featuring Peter Tosh and Bob Marley), the nascent reggae scene began to embrace sociopolitical and religious themes and, particularly, the growing influence of Rastafarianism on Jamaican youth. The smoking of cannabis in its purest form (grass, or ganja, as opposed to pot) became as intrinsic a part of the Rasta's holy trinity as the Ethiopian flag and the choppy skank of reggae's rhythm guitar. For Rastas, the smoking of herb or ganja is a spiritual act, often an accompaniment to bible-reading, with reggae the musical backbeat to both the religion and the way of life. And while the music made occasional reference to the darker practices of freebase and 'icing' (most notably Dillinger's 1978 anthem 'Cocaine'), reggae's constant referencing of kaya (cannabis leaf), collie men (weed dealers) and Mary Jane (marijuana) celebrates it as a spliff culture.

Cannabis was helping shape the development of the North Beach hipsters in San Francisco, too. When Kerouac, Allen Ginsberg, Neal Cassady and the rest of the NY alternative community upped from Greenwich Village to San Francisco in 1962, they found a melange of counter-cultural ideas, individuals and music. A whole new scene was springing up around the ornate but dilapidated Haight-Ashbury area: clubs, 'happenings' and young bands with grandiose names like the Grateful Dead, Jefferson Airplane and the Quicksilver Messenger Service. Something was afoot.

There was also a folk scene based around The Cabale Creamery in Berkeley that began to fuse the anti-war philosophies of its regulars with a general drift towards Native American spiritualism and the kind of back-to-nature frugality espoused in Henry Thoreau's utopian classic Walden. The Creamery's co-founder, Chandler Laughlin, favoured free-flowing garments and headbands in the Native American tradition, and the younger followers of the folk scene began dressing similarly. One of their number was Owsley Stanley, a studious young man who spent his time manufacturing a drug whose complex name - lysergic acid diethylamide -was quickly abbreviated to three initials: LSD. And while pot served its purpose, often hallucinogenic, LSD was the drug the foundling hippy communities had been waiting for.

Laughlin discovered The Red Dog Saloon, an isolated club in the desert, and brought his followers out for what would turn out to be the world's first hippy 'happening'. Projecting Bill Ham's surreal oil and colour lightshow against the walls, and encouraging the notion that no boundary should exist between performers and crowd, Laughlin mixed together the best of the alt-folk scene with the emerging Haight-Ashbury bands and a load of LSD. By dawn, psychedelia was born.

The scene and its acolytes moved from the desert back to San Francisco and, on 16 October 1965, the first self-billed psychedelic rock show took place at the Longshoreman's Hall. Advertised as 'A Tribute to Doctor Strange' and attended by 1,000 devotees, the gig featured the Marbles and Jefferson Airplane, who invited their followers on stage to sip acid-spiked punch from a gigantic chalice. By January 1966 such gigs, hosted by Ken Kesey under his banner the Trips, were bringing in 10,000 hippies a night, with thousands more turned away. Kids were descending on San Francisco expressly to join the commune of peace, love and experimentation as it moved onwards to bigger and bigger homes, such as The Fillmore and The Avalon Ballroom.

The tentacles and tenets of hippydom reverberated all around the world, but as with every bolshy new scene that drags itself kicking and screaming into the world with all the brio, vim and attitude of the here and now, hippies and their music inevitably became a sad parody of themselves. Instead of the vibrant terrorism of Jimi Hendrix or the astral psychedelia of Sergeant Pepper, we had soppy long-hair bands who happened to smoke pot and down mushrooms, culling the sixth-form imagery and iconography of Tolkien and Dungeons and Dragons. We had Yes. We had Gong. But, as Jean-Jacques Burnel warned, 'Something better change.' The punks were coming.

From the first three-chord blasts of the Ramones, Sex Pistols and the Clash, punk was shock-treatment for the disaffected teens. It was fast, furious, short and bittersweet. Songs were the antithesis of those 20-minute aural symphonies the likes of ELP and Rick Wakeman had been getting away with in the early to mid-Seventies. Most proto-punk anthems were two-minute garage thrash-bangs and the drugs of choice, too, were fast, cheap and often DIY. Amphetamine sulphate, speed, was everywhere, its crushed-tight powder geometrically folded into Stanley blade-sized wraps. Amyl nitrate, too (called rush before the gay community coined poppers, after its pupil-dilating effects), sniffed straight from the 10-bob bottle. Anything that would induce an immediate energetic charge to complement the adrenalised urgency of the music would fit the bill. Anything sluggish or introspective was condemned as hippy shit.

Yet, for all the similarities in the two scenes' backgrounds and fanbases, punk's drugging was quite unlike the pill-popping hedonism of the mod world. Mod was, generally, an aspirational and forward-looking code, whereas punk was rebellious and nihilistic, kicking against the system with youthful fury. Punk's narcotic sideshow was scuzzy, cheap and often home-made. Prior to a Psychedelic Furs gig at Eric's Club, Liverpool, a young man dumped a plastic bag on to a table top, with thick, crystalline powder spilling out. After the slightest hesitation, a dozen eager fingers began dabbing, licking, slurping, dabbing again. That man, now one of the foremost backline technicians on the live-band circuit, laughed: 'Go easy, will you. That's only just out the oven!'

The club was raided by the drugs squad later that night and was closed down, never to re-open. The fast times were, for the time being at least, brought to a halt.

Just as particular sociopolitical climates stimulated the special musical/narcotic relationships that led to the growth of reggae culture, for example, or punk, so too can economic conditions depress a generation's creative output. A direct product of the youth unemployment that accompanied Margaret Thatcher's first term in office was a country-wide heroin epidemic among the young. Heroin is an opiate, a soporific and it's no co-incidence that much of what passed for youth culture in the early to mid-Eighties was retrospective and nostalgic. Yet one of the Eighties' more idiosyncratic underground scenes grew exponentially from the inertia of dole-life. Bored and listless, eking their giro out over its fortnightly dawdle, teenagers fell back on the consolations of smack and pot. This was a life spent lying down, waiting for a better day and its curious soundtrack was a pick-and-mix culled from the catalogues of Frank Zappa, Pink Floyd, Simon & Garfunkel, Soft Machine, Peter Gabriel's Genesis and, curiously, Chris de Burgh. The progeny of the former working classes were now hitting the bong.

But while this was, in the main, a passive and slow-travelling phenomenon, mainly confined to the northwest, at weekends it grew wings. In the form of jobbing cabaret bands such as Groundpig, the Munchies and Drama, the first of our tribute super-groups were starting to find a huge and grateful constituency among a young, under-waged crowd who simply wanted to let off steam among themselves. At its primal core, this was the tribal precursor to acid house.

For a scene to be genuinely innovative, it needs its own high-octane fuel. It needs that all-too-rare synthesis of right time, right place, right crowd, right music. And above all, it needs the right drug. So when ecstasy filtered its sinuous way through basement clubs of London in 1986, it lit the well-laid gunpowder trail to one of the UK's great cultural explosions. So many diverse yet empathetic little subcultures were waiting to be dragged in under that one great star-spangled panoply as 1986 became 1987. Warehouse parties, house music, rock bands such as New Order using DJs and samplers, the disco revival, the Wag-club-led return of working-class football dandies to the dance floor - and not just here but in Amsterdam, in Chicago and in Ibiza, of course. All these crazy little strands, waiting to explode, and ecstasy threw the switch.

From its earliest incarnations with Daryll Pandy, Baby Ford, S-Express and Bomb The Bass, right through to the golden age of Madchester, it was the acid in acid house that made the genre sparkle. Ecstasy, or MDMA, was unusual in that the drug had been developed by Merck not to cure anything specific, but to make people talk to one another. In its earliest trials, MDMA was intended to help revive marriages that had hit a stale patch. But ecstasy's ability to induce communal euphoria allied to coruscating light shows, and a new tribe of DJs who came from the dance floor themselves and knew how to build a crowd's delirium, meant acid house was an overnight phenomenon. And where punk grew roots at its own pace, developing its notoriety through fanzines, word of mouth and specialist night-time radio, gradually spreading nationwide, acid was the stuff of tabloid furore.

But this time the copycat rave syndrome didn't kill the genre dead. As quickly as the tabloid version of acid house filtered down to youth clubs and high-street pulling palaces, the sheer invention fostered by the drug itself and the communities it inspired led to side movements, subtle shifts in the tempo and the nuances of dance music from Balearic to New Beat. And it all led inexorably to indie dance. Of all the great pop repercussions to result from the marriage of MDMA and disco music, the gurning faces of Happy Mondays' Bez, stage left and Barry Mooncult of Flowered Up, stage right, best crystallise its inspired lunacy. Here were bands who took the purest ethic of punk - get guitar, make stuff up, play - mashed it all up with seductive drum loops, throbbing bass samples and irresistible dance-floor 'riddims', then asked their mates to dance on stage. It was back to the days of Aquarius, where nothing could ever be deemed excessive, no contribution lesser in value than another. So when Bez began regularly to lope onstage with the Ryder brothers, bug-eyed and slack-jawed, shaking his maracas like an electrocuted grasshopper, it was going to take something magnificent, and some industrial dosage of drugs, to trump his act. Barry Mooncult, who donned an all-in-one planet suit and proceeded to walk up and down in front of the band, smiling, was that ace. One of the century's last great 'happenings', set to a repetitive four-four beat as Shoreditch Town Hall rioted, felt like a moment that might never be bettered.

And it still feels that way. Maybe grime and dubstep wouldn't sound as alien and paranoid as it does without the stupefying effects of powerful hydroponic skunk. New rave seemed briefly to get its kicks out of ketamine. Rod Stanley, editor of Dazed & Confused magazine, has a thought: 'No one has really "invented" or discovered a new drug for a while. Every time one has been found over the decades, young people swiftly work out the best music experience to go with it,' he says. 'If a new drug were discovered today, a new music scene would spring up overnight.'

But with scenes like techtonik making a virtue of being wholly drug- and alcohol-free, one has to wonder whether the links between music and drugs are finally breaking down.