This year's news about what artificial intelligence (AI) can do in the arts has been both exciting and scary. Neural networks have learnt to paint like masters and compose sophisticated music.
Those of us in creative endeavours might be as endangered by technological advances as blue-collar workers are often said to be - though we are protected by certain limitations that technology is never likely to overcome.
Last summer, a team of Russian developers released Prisma, a mobile app based on the work of some German AI researchers. The neural network behind it could redraw an image using techniques it had learnt from studying the oeuvre of a number of painters, including Vincent Van Gogh and Edvard Munch. The end product was impressive: Prisma could reproduce brushstrokes and palettes, using only a photo for guidance, almost the way a human painter could have.
This month, Gaetan Hadjeres and Francois Pachet from the Sony Computer Science Laboratories in Paris published a paper about an AI model called DeepBach, which can compose polyphonic chorales even professional musicians can mistake for the work of Johann Sebastian Bach.
The chorale is a rather formulaic piece of Lutheran church music that usually reharmonises a well-known melody. Bach composed hundreds, so there's plenty of material for a neural network to learn from. Musicians who listened to Bach and DeepBach music were more likely to correctly attribute the great composer's work than the machine's, but about 40 per cent of them misidentified DeepBach chorales as works composed in 18th century Leipzig - even though the machine didn't plagiarise Bach but produced genuinely new work.
The researchers wrote: Despite some compositional errors like parallel octaves, the musical analysis reveals that the DeepBach compositions reproduce typical Bach-like patterns, from characteristic cadences to the expressive use of non-chord tones.
The success of DeepBach follows work by the same team that produced a surprisingly hummable pop song in the style of The Beatles, and a separate effort by a team at Google in which an AI network composed jingle-like piano pieces.
Computers have generated music before, but these recent experiments are different because the machines aren't programmed to perform specific tasks - they learn from big datasets to create music without further human input. Models like DeepBach also allow human intervention or, rather, collaboration.
Machines also have been getting better at producing literary work. This year, an AI-written novel passed the first round of a Japanese fiction competition. These creative efforts are, at this point, somewhat short of stunning - but only if one considers their origin.
Unlike most overhyped human creations, these only represent the first steps for a technology that most of us only know for its frustrating and often hilarious implementations in the digital assistants on our mobile phones: Siri, Google Assistant and Cortana.
Researchers are working to overcome a number of practical problems: the need for huge amounts of data to train the algorithms, the narrow specialisation of the neural networks (a chess-playing one can't write music, for example), the logical errors the networks make when discerning and interpreting patterns. Given more time and effort, these will probably be solved, at least to a degree that makes consumer applications of the algorithms widespread.
There is, however, one boundary that no research team has approached and that, I suspect, will forever protect creative professions from displacement.
It's a problem described in David Hume's A Treatise Of Human Nature, published when Bach was still alive: "Even after the observation of the frequent or constant conjunction of objects, we have no reason to draw any inference concerning any object beyond those of which we have had experience."
It's possible to teach a machine Van Gogh's painting technique, but only if it already exists. An algorithm can write chorales like Bach because it can "study" Bach. Even when the work produced by AI is less specifically derivative than it is today - say, when the algorithms learn to combine various techniques they learn in an intelligent manner - they will never rise above previous work because the way they work is based on experience. They are constrained by Hume's piece of wisdom.
The one way in which we're radically different from machines is in our ability to step into the unknown, to do things that have never been done before with paint, form, sound and the written word. Most of the rewards to creative professionals today accrue to that ability, not to skill or the extensive knowledge of predecessors' work. Even a derivative work of art needs to be derivative in groundbreaking ways to be appreciated.
It works this way because that's how the infrastructure - critics, publishers, curators, performers - is set up. One could imagine work produced by machines getting some appreciation, but, ultimately, we appreciate art through extremely human social mechanisms. Humans will take care of their own, and they'll continue to prize originality.
Human creators will probably use AI for narrow tasks, training it on specific datasets to write dialogue, orchestrate music or produce variations to make a print more unique. But they won't be displaced as long as they have the courage to do new things.