Researchers have developed a way of converting molecular structures into musical sequences, allowing them to be compared, contrasted and combined using a sense that isn’t a common part of chemistry. Their software, Samples, takes a molecule’s properties and its text representation and creates a unique tune – or vice versa.

To sonicate a molecule, first properties like its size and number of proton donors are condensed into a single value, which determines which key the software will use. It selects the key from a spectrum of the 12 most popular on Spotify, with smaller, simpler molecules falling on the popular end. Next, each symbol in the molecule’s Smiles string creates one note in a melody. The most popular symbol in the dataset, aliphatic carbon, becomes the tonic note of the key, and progressively less popular symbols, like those for an oxygen atom or a branch point, become higher notes on a major scale. To add texture, every fourth note is replaced with a major chord.

The researchers found that there were recognisable similarities and differences between the tunes for similar or contrasting molecules, or between those with different properties. Molecules that pass the Lipinski rules for drug design have a different sound to those that do not, for example. By using Smiles strings, the software can convert any piece of music into a drawable molecule. This link allows molecules to be created or edited directly in the musical domain; The team trained MusicVAE, a machine learning model that blends together musical scores, to interpolate molecular melodies together to produce novel tunes and chemical structures.