A series of 0s, Is and IIs appear on the Stirling Head, which would have graced the ceiling of the Royal Palace
Markings on a 16th Century carving from Stirling Castle could be the oldest surviving piece of written Scottish instrumental music, historians believe.
A sequence of 0s, Is and IIs have been found on one of the Stirling Heads - wooden medallions which would have decorated the castle's royal palace.
It is believed the music could have been played on instruments such as harps, viols, fiddles and lutes.
An experienced harpist has been trying to play the tune.
Huw Williams BBC News
Everyone wants to say that researchers have recreated actual music from 1540.
That, for the first time in nearly 500 years, we're listening to a tune that echoed round Stirling Castle when Mary, Queen of Scots lived there.
The trouble is, that isn't really true.
What they've found is a structure, the architecture for a piece of music.
It dates from an era before celebrity composers. A time when a group of musicians was expected to compose as they played. All improvising together, busking round the same sequence of chords.
And it's that sequence that's been found carved in wood, set out in binary code as a series of ones and zeros.
So what we're actually hearing is a combination of sound musical scholarship and educated guess-work.
But the result certainly sounded fantastic, as it echoed round the Chapel Royal at the castle.
The markings would not have been an exact musical score, but would have given guidance to players who then improvised.
There are earlier examples of written music in Scotland, but they were composed for choirs rather than an instrumental band.
Barnaby Brown, a lecturer at the Royal Scottish Academy of Music and Drama (RSAMD) who specialises in early Scottish music, said the find could be very enlightening.
"This discovery is potentially of great significance to our understanding of medieval and Renaissance instrumental music - the normally 'unwritten' practice of the elite court professional," he said.
"Very little notation survives from these dynasties of players because complex instrumental music was transmitted orally."
Mr Brown added that the tune could have been specially composed for King James V.
"The harp was an aristocratic instrument, often played by the nobility and associated with King David of the Old Testament," he said.
"These numerals provide an exciting opportunity to explore what instrumental music may have sounded like at Scotland's royal palace around 1540."
The notations were discovered by master craftsman John Donaldson, who was creating replicas of the large medallions.
Mr Donaldson said: "Recreating the heads gave me an intimate knowledge of all the carvings and the way the craftsmen decorated the edges.
"This one really stuck out as being different from the rest, as if the pattern actually meant something and wasn't just there to look attractive.
"To find out that it might be early harp music was very exciting indeed, and having the chance to hear it being played really helps draw back the veil on what life at the royal court would have been like."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.