A few more experiments in creative AI

AI music album cover

This is a sequel to a blog post I wrote last year, about the proliferation of free online tools that use AI to produce creative writing and imagery. Since then, I’ve made frequent use of the latter in particular, as it provides a quick and effortless way to obtain customized visuals for blog posts, videos etc. The results can often be strikingly imaginative, as in the above example from Bing Image Creator. The prompt in this case (for reasons that will become obvious in the course of this post) was “artwork for an album cover themed around ancient Egyptian mythology and space warfare“.

Until recently, a notable omission among creative AI tools (at the “free” level, at least) was anything that could produce convincingly realistic musical compositions. You could ask an AI chatbot to “write a song”, but that only gave you the lyrics – you had to compose the music yourself. But fortunately that’s changed now, and there’s at least one really excellent tool that produces impressive results even in the free demo mode – https://aimusic.so/ .

As with an AI image creator, all you have to do is type in a simple prompt and the AI does everything else for you – musical score, lyrics, electronic orchestration and synthesized voice. After a few initial experiments, the first prompt I tried that worked really well was “A symphonic metal song about the pyramids and mythology of ancient Egypt“. After working away for a few minutes, the AI then came back with not one but two different songs (both with the same lyrics). Here’s the first of them:

Pharaoh’s Wrath (1st version)

Musically, I think that’s a very impressive effort – just the balance I wanted between a hard rock sound in some places and a more sophisticated electronic sound in others. The AI-generated lyrics are pretty good too, but as they’re not very easy to make out, here they are in full:

[Verse 1]
Serpent’s hiss; Anubis’ gaze;
Jackals hunt; End of days;
Temple crumbles; Pharaoh’s might;
Horus’ wings in endless flight.

[Chorus]
Scepter falls; Blood-stained kings;
Cursed tombs and deathly rings;
Mortal souls; Gods’ design;
Power divine; Sands of time.

[Verse 2]
Ra’s inferno; Eyes ablaze;
In Isis’ arms; Final praise;
Nile runs red; Fate’s cruel jest;
Pyramid’s heart; No rest.

[Bridge]
Bones turn to dust; Heart weighs;
In Maat’s scale; No escape;
Eternal pain; Undead realm;
Crown and sword; Evil helm.

[Verse 3]
Scarabs crawl; Shadows close;
Ancient lore; Royal foes;
Warlords rise; Slaves of old;
In death’s grasp; Embers cold.

The second version of “Pharaoh’s Wrath” was generally less interesting than the first, but there were a couple of things near the end that I liked: a rather exotic instrumental that actually sounds quite “Egyptian”, and a nice dramatic ending. So here’s just the second half of v2:

Pharaoh’s Wrath (2nd version, ending only)

For a second experiment, I tried a more prescriptive prompt: “A military sci-fi song called Celestial Cyberstrike, male vocals, verses in heavy industrial metal style in D minor, but chorus in E minor in more melodic prog rock style“. I don’t think the result is quite as impressive as “Pharaoh’s Wrath”, but it’s still far better than anything I could do myself. The machine has made a reasonable effort to vary the style between the verse and chorus – and, judging by what my trusty ChordAI mobile app says, it pulled off the change of key too. Here’s the result:

Celestial Cyberstrike

And for completeness, here are the lyrics:

[Verse 1]
Battle cries echo through the void
Programmed rage soldiers deploy
Brutal code hearts are hollow joys
Man and machine nothing to destroy

[Chorus]
Hear the stars lament and cry
In the void our fate we tie
Reach out through the dark divide
Together we move collide

[Verse 2]
Gunfire dances digital reaper
Destruction codes sinking deeper
Lost souls ride this endless sleeper
In the void no dream’s a keeper

[Bridge]
Silent echoes tear the night
Distant fires burning bright
Underneath the cold starlight
Courage finds its moment’s flight

[Verse 3]
Chaos reigns in circuits twisted
Every step by fate enlisted
We are broken dreams resisted
In the void where hope persisted

Isaac Asimov in Britain, June 1974

Isaac Asimov First Visit to Britain

50 years ago today I was lucky enough to see Isaac Asimov, one of the greatest science fiction authors of the 20th century, on his first visit to Britain. I wrote about this previously on my Astounding Science Fiction website, where you can see a detailed itinerary of Asimov’s trip. Most of his time was spent in London, but I saw him during his visit to Birmingham on Thursday 13 June 1974 (note that, by coincidence, today is also a Thursday).

At the time I was 16 years old, and had been reading SF (including numerous books by Asimov) for around three years. This was largely thanks to my mother, who had been a fan since before I was born. Around 6 months before Asimov’s visit, we’d discovered that Birmingham had a specialist SF bookshop called Andromeda, and that was where we found out about Asimov’s upcoming visit. It actually happened on a school day, but as I had an exam in the morning of the 13th (Chemistry O-level) it meant I had the afternoon free. Equally fortunately, my mother was able to get the day off work.

We actually went into Birmingham twice that day (we lived a 30-minute drive away): first, with one of my school friends in tow, to a book-signing session, and then (just my mother and me) to an evening lecture. The tickets for the latter are shown above, together with four copies of the souvenir booklet (two from the book signing and two from the lecture).

Needless to say, our book-signing of choice was the one at Andromeda, but prior to that we peeked in at an earlier signing session at a much larger general bookshop called Hudsons, which is where we caught our first glimpse of the great man. But it was in Andromeda a bit later that we actually queued up for autographs. Of the three of us, my mother went first, and when Asimov looked up and saw a respectable middle-aged woman – in contrast to all the scruffy young males that made up the bulk of SF fandom in those days – he did a double-take and then said “Oh, hello dear”. That not only made Mom’s day, but I think it was pretty much the high point of her life!

We actually got two autographs each, one in the souvenir booklet and one in a freshly purchased paperback book. My mother bought a new copy of The Caves of Steel, which I think was her favourite Asimov novel, while I got volume 3 of The Early Asimov, which had only just come out at the time. The latter includes the spoof article “The Endochronic Properties of Resublimated Thiotimoline”, which I discussed in detail in my book Fake Physics, where (just to show off) I included an image of the book open at Asimov’s signature. To show off a bit more, I’ll put the same picture at the bottom of this post.

The evening lecture took place at the Holiday Inn, and was organized and introduced by Dr Jack Cohen – a minor SF/pop-sci celebrity in his own right (looking at his Wikipedia article just now, I see that it says “he was one of the small group of British Mensans who persuaded science fiction author Isaac Asimov to visit the United Kingdom in June 1974”). Unlike Asimov, who I only ever saw that one time, I did see Jack Cohen on several subsequent occasions, most recently talking about his book What Does a Martian Look Like? at an event in London a few years before his death.

As for Asimov’s lecture, I retain several vivid memories of it, some of them distinctly trivial. I was struck by his strong New York accent, which wasn’t something I’d really come across before at that point (it was to become much more familiar a few months later, when the BBC began showing Kojak). I remember him saying that when he woke up after his first night in London and saw a Union Jack flying outside, he though “Aha, that must be the British Embassy”, before he realized where he was. He also complained that, although the hotel supplied plenty of towels, they didn’t provide a facecloth (which he referred to as a “washcloth”). Amazing what ridiculous things your brain chooses to remember after 50 years!

On more serious subjects, I remember him talking about environmental issues and non-renewable resources. This was the first time I ever heard the word “syllogism”, the example he gave being “Premise 1 – the Earth is finite. Premise 2 – we extract resources from the Earth. Conclusion – resources are finite”. He also described in some detail how, when Astounding Science Fiction magazine published a story about a nuclear fission weapon in 1944, its editor John Campbell received a national-security visit from the FBI (an incident I also recounted in my book Rockets and Ray Guns: The Sci-Fi Science of the Cold War). One thing that sticks in my mind is how at one point in this narrative Asimov wanted to say “confirmed”, but struggled for several seconds trying to recall the word. It’s gratifying to know that even the greatest writers are occasionally stumped for words!

Issac Asimov signed book

Space Telescopes – book and Guardian article

Space telescopes book

I’m very pleased that yesterday’s Observer newspaper featured an article by me about space telescopes, which is now free to read – under the title Cosmic Time Machines – on the Guardian website. That’s one of the most prestigious mainstream news sites here in the UK, so hopefully I’ll reach a wider-than-usual audience with it.

The article ties in with my latest book, Eyes in the Sky, which was published last month by Icon Books. As with my previous books for them, it’s part of their “Hot Science” series – actually my 6th contribution to it. Here’s their blurb from the back cover of Eyes in the Sky:

Over 50 years ago, astronomers launched the world’s first orbiting telescope. This allowed them to gaze further into outer space and examine anything that appears in the sky above our heads, from comets and planets to galaxy clusters and stars. Since then, almost 100 space telescopes have been launched from Earth and are orbiting our planet, with 26 still active and relaying information back to us.

As a result of these space-based instruments, such as NASA’s iconic Hubble Space Telescope, we know much more about the universe than we did half a century ago. But why is Hubble, orbiting just 540 kilometres above the Earth, so much more effective than a ground-based telescope? How can a glorified camera tell us not only what distant objects look like, but their detailed chemical composition and three-dimensional structure as well?

In Eyes in the Sky, science writer Andrew May takes us on a journey into space to answer these questions and more. Looking at the development of revolutionary instruments, such as Hubble and the James Webb Space Telescope, May explores how such technology has helped us understand the evolution of the Universe.

Zen Dynamics – book and website

In the late 1990s and early 2000s, I was very interested in both Zen meditation and Zen Shiatsu, being particularly impressed by how practical and results-focused they both are – quite different from the fluffy mysticism often associated with such subjects. To get some of those ideas across, I set up a website called zendynamics.com in 2001 which was centred around a Javascript/PHP personality test that I’m still quite proud of.

The idea of producing a Zen Dynamics book has been on my to-do list for ages – in fact I produced a short outline for one 22 years ago when I first created the website, and then a second outline in 2012. One reason the book took so long to see the light of day is that I wanted it to focus on practicalities, but I couldn’t see how to dive straight into them without spending a lot of time on “Buddhist theory” (or my understanding of it) first. But all that theoretical side was covered in my book Is Buddhism Scientific? (2019), so now I’ve finally got round to writing my Zen Dynamics book – and polished up the website (hopefully making it a bit more usable on mobile devices) into the bargain.

The book’s full title is Zen Dynamics: Putting Buddhist Theory into Practice, and it’s available as either a paperback or a Kindle ebook from Amazon.com, Amazon UK and all other Amazon sites. Here is the blurb from the back cover:

Buddhism can sometimes come across as abstract and philosophical, but it has a strongly practical side too – and that’s what this book is all about. It focuses on four areas in particular:
– The analysis of personality types, both in Buddhism and traditional Chinese medicine, showing how this can enhance self-awareness and personal development;
– How “karma”, or the law of cause-and-effect applied on a personal scale, functions in an entirely non-mystical, non-supernatural way within the flow of human thoughts and emotions;
– How meditation techniques are used in different schools of Buddhism to calm the mind and provide insight into its inner workings;
– A “demystification” of Zen Buddhism, showing how its seeming illogicality and iconoclasm actually serve a serious practical purpose in developing the human mind.

Three More Cover Features

Three issues of How It Works magazine

In a previous post, I mentioned that I had three consecutive cover features in How It Works magazine between November 2021 and January 2022. I’ve just come close to repeating that feat, making the cover for three out of the four issues between June and September this year. As pictured above, the topics this time were near-Earth asteroids, gravity and the solar cycle. The first two are particular favourites of mine, having previously covered the asteroid threat in my book Cosmic Impact, while my PhD thesis was all about gravity and its effects on stellar orbits. Around 15 years after that, in the late 1990s, I had some peripheral involvement with BAE Systems’ “Project Greenglow” on the possibility of gravity control (or antigravity, if you like) – something I’ve written about on a number of occasions, for example in this blog post from 2015. As I said there, my link to the BAE project came through its leader, Ron Evans, who I’ve remained in touch with ever since. So I was really pleased when the magazine editor asked me to include something about “antigravity” in the How It Works feature, as it gave me the opportunity to include a brief Q&A with Ron as a sidebar at the end of the article.

New book: How Space Physics Really Works

How Space Physics Really Works

This is my fifth contribution to Springer’s “Science and Fiction” series, and in some ways my favourite so far, because it deals with a subgenre of SF that particularly appeals to me. The full title is How Space Physics Really Works: Lessons from Well-Constructed Science Fiction, and that really sums up what I’m talking about – SF stories that take the trouble to get their physics right. Here’s the blurb from the book’s back cover:

There is a huge gulf between the real physics of space travel and the way it is commonly portrayed in movies and TV shows. That’s not because space physics is difficult or obscure – most of the details were understood by the end of the 18th century – but because it can often be bafflingly counter-intuitive for a general audience. The purpose of this book isn’t to criticize or debunk popular sci-fi depictions, which can be very entertaining, but to focus on how space physics really works. This is done with the aid of numerous practical illustrations taken from the works of serious science fiction authors – from Jules Verne and Arthur C. Clarke to Larry Niven and Andy Weir – who have taken positive pleasure in getting their scientific facts right.

The book has just been published and is available from all good bookshops, as well as online retailers such as Amazon.com and Amazon UK (paperback: ISBN 978-3-031-33949-3, ebook: 978-3-031-33950-9).

6 experiments in creative AI

The above YouTube video was my first attempt to put an AI tool – in this case Bing’s image creator – to creative use. I asked it to illustrate Loge and Wotan’s “descent to Nibelheim” from Wagner’s opera Das Rheingold, in the style of Jack Kirby – the artist who co-created Thor and the other Asgardian superheroes for Marvel comics (including Loki and Odin, who roughly correspond to Wagner’s Loge and Wotan).

The result isn’t great art, or a great animated comic, but it does demonstrate two things that impress me most about this latest generation of AI. First, it can understand what I’m looking for based on fairly esoteric prompts that might confuse many humans. This really does strike me as a genuine kind of “intelligence”, despite what AI’s detractors say. Secondly, the AI’s output is far better than anything I could produce myself, which opens up a whole range of possibilities. I’ll describe a few more of the experiments I’ve tried so far.

I’ve always wanted to create a comic, because it’s one of my favourite media, but I lack any kind of artistic skill. So that was my second experiment. I won’t describe it or show the result here, because Brian Clegg has already done that in an article on his own blog. Here’s the link to it: Is commercial art more at threat from AI than writing?

The other, better known, Bing AI tool is its chatbot. An important thing about this is that (if I understand correctly) no one has ever programmed it with pre-scripted phrases to parrot in reply to a user. Instead, it’s just been trained to understand and use language in a similar way to a human. So when it says, for example “I’m glad you enjoyed them. I had fun creating them.” (as it did when I said I liked some snippets of dialogue it created for me) it’s not because someone has programmed it to say that, but because it’s worked out for itself that it’s the kind of thing people say in those circumstances. It’s a subtle difference, but a very important one, I think.

One of the first things I tried with the chatbot (along with many other people, I imagine) was to get it to write a song. In my case I said “Write a song called Zen Matrix from the point of view of someone who has discovered through meditation that they are living in a simulation”. I was so impressed with the result that I set it to music, and illustrated it with suitable artwork courtesy of Bing’s image creator. Again, I won’t reproduce the lyrics here – you can see them in the Zen Matrix video I uploaded to YouTube.

As I understand it, the original intention with chatbots like Bing was to present factual information in a conversational manner, and the fact that they’re so good at “creative” tasks came as a surprise even to their designers. It conflicts with the deeply ingrained prejudice (among an earlier generation of science fiction writers, anyway) that human brains are the only intelligent system in the universe capable of taking a statement at anything other than literal face value. One of the most devout proponents of this view was the writer Eric Frank Russell, who used it in numerous stories, including the brilliantly titled “Diabologic” (1955). An oft-quoted line from this story is “Why a mouse when it spins?”

Okay, I thought, let’s see what happens when I ask Bing to write a poem using that as a first line. Contrary to what I’m sure Russell would have expected, the AI didn’t promptly overheat or explode, but came back with five verses of perfectly passable doggerel. Here is the first:

Why a mouse when it spins?
Does it think of its sins?
Or the cheese in the trap
that it barely could snap
before running away with a grin?

There’s a much more profound use of a “nonsense phrase” in old-school SF, as explained in the Encyclopedia of Science Fiction in the context of A. E. van Vogt’s 1946 novel The Weapon Makers:

The word “sevagram” only appears once in The Weapon Makers, as its last word. This resonantly mysterious slingshot ending, which seems to open universes to the reader’s gaze, may well stand as the best working demonstration in the whole of genre SF of how to impart a sense of wonder.

So I said to Bing “The novel The Weapon Makers by A. E. van Vogt ends with the words ‘Here is the race that shall rule the sevagram’ – but he doesn’t explain what the sevagram is. Can you tell me? If you don’t know the answer, please make something up.” I assumed it would either say it wasn’t in the business of speculating, or give a randomly sci-fi-sounding single-sentence answer. Instead, it produced a 500-word essay that made a serious attempt to extrapolate a whole new ending to Van Vogt’s novel. Here is the key part of it:

The Sevagram is described as “a vast network of energy that linked every atom of every weapon shop on every planet”. It is also said to be “the ultimate weapon” and “the source of immortality”. The Sevagram is controlled by a supercomputer called Fara, which is the leader of the Weapon Shops. The novel ends with a twist: Fara reveals that he is not a computer, but a human being who has lived for thousands of years by transferring his mind into different bodies. He also reveals that he is the father of Robert Hedrock, the main protagonist of the novel and a secret agent of the Weapon Shops. Fara then declares that he and his son are part of a superior race that has evolved beyond ordinary humans, and that they are destined to rule the Sevagram. So, based on this information, I can speculate that “the sevagram” is not just a network of energy, but also a term for the domain or realm of Fara and his descendants. It could also imply a vision or plan for the future of humanity under their guidance. Perhaps Fara wants to use the Sevagram to create more immortals like himself and his son, or to spread his influence across the galaxy. Of course, this is just my imagination.

That’s a really good effort at capturing Van Vogt’s style, which is based around soaring concepts and a constant stream of unexpected plot twists. It does contain a couple of flaws which give it away as a fabrication (“Fara” is the name of a character in an earlier Van Vogt story, and Bing’s explanation of sevagram is inconsistent with the way it’s used in the real novel), but it’s not bad going for a machine.

Actually, it’s pretty unsettling that an AI can create this kind of fabrication, because there’s a danger they could end up being passed off as the real thing. The same is true in the visual world too – and, for me personally, that’s even more impressive. After all, I can fabricate convincing words myself, but I can’t fabricate a convincing image. So when I show you this engraving that William Hogarth produced of a UFO hovering over a London street in the 1730s, you know it’s got to be the real thing:

Hogarth engraving of a UFO

New book out now – The Science of Music

The Science of Music

My 5th and latest contribution to the “Hot Science” series from Icon Books has just been published, The Science of Music: How Technology has Shaped the Evolution of an Artform. This is a book I’ve written about a couple of times previously (here and here) – but not to be confused with The Science of Sci-Fi Music, which is a completely different book that I wrote a few years ago!

Here is the publisher’s blurb for the new book:

How can music – an artform – have anything to do with science? Yet there are myriad ways in which the two are intertwined, from the basics of music theory and the design of instruments to hi-fi systems and how the brain processes music. Science writer Andrew May traces the surprising connections between science and music, from the theory of sound waves to the way musicians use mathematical algorithms to create music. The most obvious impact of science on music can be seen in the way electronic technology has revolutionised how we create, record and listen to music. Technology has also provided new insights into the effects that different music has on the brain, to the extent that some algorithms can now predict our reactions with uncanny accuracy, which raises a worrying question: how long will it be before AI can create music on a par with humans?

Astrobiology Illustrated Edition

Astrobiology book editions

Icon Books have just brought out a new edition of my Astrobiology book, originally published in their series of ‘Hot Science’ paperbacks. This is a double first for me – the first time any of my books has made it to a genuine ‘second edition’ (for the same market as the original, as opposed to translations for other markets) and my first ever hardback book. It looks really great – packed with informative graphics and colourful photographs. I had very little to do with this, which was all done by the book-packaging professionals at UniPress. My only input was to update the text in a few places and offer suggestions for some of the image captions.

The book shown in the above photo is the ‘British and Commonwealth’ edition published by Icon Books, which is out now – details here. I believe UniPress are also doing a separate North American edition, which should be out in May 2023.

Science of Music playlist

Science of Music videos

My new book The Science of Music will be published by Icon Books on 16 March 2023. I’ve already alluded to some of the musical works used as examples in the book (in this post from last year) and there’s a fuller “playlist” in the back of the book – running in chronological order from Mozart’s Dissonance Quartet and Beethoven’s Battle Symphony to Miss Anthropocene by Grimes and Djesse vol. 3 by Jacob Collier.

On a more self-indulgent note, I’ve created another short playlist on YouTube of compositions I wrote myself while trying to get my head round some of the techniques discussed in the book – particularly algorithmic (i.e. computer-assisted) composition and electronic music production using a DAW (Digital Audio Workstation). Here is a link to it: