A lot of music has been composed under the influence of drugs, of course. The Beatles are a good example and the effect different drugs had on their music at different times is pretty evident, particularly in the songs of John Lennon, who was the biggest drug-user in the band.
In their early years they took amphetamines, which they were introduced to in Hamburg, Germany where they played long sets at seedy all-night clubs. I don’t think amphetamine is noted for being a particularly “creative” drug, but its use might be reflected in some of the fast high-energy songs of their earlier output, like “I Saw Her Standing There” and “She Loves You” or their performances in song covers like “Twist and Shout”, “Long Tall Sally” and “Rock and Roll Music”.
From around the time of Help! album they were using cannabis regularly and the effects can be seen on their songwriting on that album and probably more so on their next album, Rubber Soul. The songs became more mellow and introspective. The music also became more dronal, in the musical sense, by often sustaining on a single chord for longer and with more focus on giving the sound a richer, more textured tone. They also incorporated more exotic instruments, like the sitar. “Ticket to Ride”, “Norwegian Wood (This Bird Has Flown)”, “You’ve Got to Hide Your Love Away”, “In My Life”, “Paperback Writer”, “Rain” and “I’m Only Sleeping” would be a few examples from this period.
The Beatles’ use of LSD starts to make its influence felt on the Revolver album (“Tomorrow Never Knows”) and reaches it’s climax on the Sgt. Pepper’s Lonely Hearts Club Band album. The music of their LSD-influenced period is more psychedelic and kaleidoscopic, at times veering from cosmic connection with the infinite (“Across the Universe”) to childlike whimsy (“All Together Now”). Some other examples of songs from this period would be “Strawberry Fields Forever”, “Lucy in the Sky With Diamonds”, “A Day in the Life” and “I am the Walrus”.
After this point, the two main songwriters, Lennon and McCartney, appear to have gone down different roads, with McCartney leaning towards cocaine and Lennon towards heroin.
Cocaine is not spoken of much as a creative or a “mind-expanding” drug. One could even speculate that its euphoric and confidence-boosting effects might lead to a reduced capacity for deep critical artistic reflection, leading to lightweight (and sometimes derided) compositions like “Ob-La-Di, Ob-La-Da”, “Maxwell’s Silver Hammer” or the gonzo “Helter Skelter”.
As for Lennon’s heroin use, I suppose one might subscribe to it the more detached feeling of later songs like “Because”, “Come Together” or the march towards oblivion of “I Want You (She’s So Heavy)”'s fade-out. Lennon also recorded his “Cold Turkey” single when coming off heroin and it doesn’t sound like a barrel of laughs.
Personally, I like the music they made during their cannabis and LSD-influenced phases most of all.
There was a promotional film made for the song “A Day in the Life”, much of which features footage of the recording session (which looks as if it was quite a a “happening”, to use 60s parlance). It looks to have been made in the style of a psychedelic drug-style experience.