This project explores the intersection of music archaeology and computational sound engineering by digitalizing the Seikilos Epitaph, the oldest complete musical composition. The initial goal was to build an automated pipeline using OCR to scan the artefact’s unique notation symbols and translate them into audio. While image processing failed due to overlapping text layouts and software glitches, a successful pivot was made to other extensions. By manually hard-coding the custom mathematical frequency ratios of the ancient scale and applying modelled instrument timbres, the Seikilos melody played successfully and allowed for potential to be transposed. Ultimately, this system is able to deliver a functional proof-of-concept, helping us hear this music exactly how it was in ancient Greece.
Introduction
Introduction
When Greek merchant Seikilos inscribed a melody into a stele in the first century AD, I doubt he could have known it would survive two thousand years to become the oldest complete musical composition ever. However, using the sheet music available to play his melody on a piano today will never recreate his intentions in full. Not because the notation was misinterpreted, but because the tuning system he wrote it in does not exist in modern music software. Today, most music uses the 12-tone equal temperament (12-TET), in which the octave is divided into 12 equally spaced semitones. The spacing is not based on pure mathematical ratios but is instead a deliberate compromise: by making each semitone exactly the twelfth root of 2, every key sounds equally in tune, allowing musicians to modulate freely between them. Wolfram Language’s built-in SoundNote function reflects this standard, and can only produce pitches from this 12-TET grid.
Ancient Greek music was quite different in its principles. The Greek theorists built their scales by stacking perfect fifths. This ratio of 3:2 gives intervals of great mathematical purity, but with a consequence: twelve perfect fifths do not add up to a perfect octave. The small remaining “gap” (about .235 cents) is known as the Pythagorean comma. Rather than attempt to hide this gap by distributing it over all intervals as in 12-TET , Greek musicians accepted the comma as a natural part of the system and retuned their instruments when a change of key was required. This means that Ancient Greek pitches are, at the production level, not only different from any note in 12-TET by convention, but mathematically.
Ancient Greek music was quite different in its principles. The Greek theorists built their scales by stacking perfect fifths. This ratio of 3:2 gives intervals of great mathematical purity, but with a consequence: twelve perfect fifths do not add up to a perfect octave. The small remaining “gap” (about .235 cents) is known as the Pythagorean comma. Rather than attempt to hide this gap by distributing it over all intervals as in 12-TET , Greek musicians accepted the comma as a natural part of the system and retuned their instruments when a change of key was required. This means that Ancient Greek pitches are, at the production level, not only different from any note in 12-TET by convention, but mathematically.
The built-in SoundNote function automatically plays the corresponding standard pitch to a note input rather than calculating the frequency from Pythagorean ratios, providing a useful baseline for comparison.
Sound[SoundNote["C"]]
Out[]=
This project aims to recreate the Seikilos Epitaph in Wolfram Language by defining custom frequencies derived directly from Pythagorean ratios, bypassing Wolfram Language’s built-in 12-TET note system entirely. Rather than approximating ancient pitches with modern equivalents, we synthesize sound from the exact rational frequency ratios that Greek theorists prescribed. The ancient Greek vocal notation system was developed around 450 BC, using letters of the Ionian alphabet to represent exact musical pitches. These alphabetic symbols were placed directly above the vowels of the sung text, functioning as a precise record of melody.
Creating ‘Pure’ Notes
Creating ‘Pure’ Notes
To create notes that have not been previously adjusted to account for the Pythagorean comma, each pitch must be assigned its own integer ratio rather than being derived from a fixed chromatic scale. The function below generates a sine wave for a given note by multiplying the base frequency of A (440 Hz) by its corresponding ratio. These ratios are stored in an association, where each note name is mapped to its Pythagorean frequency ratio relative to A. During playback, the appropriate ratio is retrieved and used to calculate the note’s frequency, while an exponential decay is applied to give each note a more natural fade-out.
This function generates a decaying sine wave tone by multiplying the note’s frequency by an exponential envelope to create a natural fade-out.
In[]:=
freq[note_,dur_]:=Play[Sin[2 Pi*440*ratios[note]*t]*Exp[-3 t/dur],{t,0,dur}]
The ratios lookup table must be defined separately to provide the frequency multipliers for each note, giving the multipliers for the ancient pure notes instead of the 12-TET ones in SoundNote.
ratios=<|"A"->1,"As"->2187/2048,"B"->9/8,"C"->19683/16384,"Cs"->81/64,"D"->4/3,"Ds"->729/512,"E"->3/2,"F"->6561/4096,"Fslow"->369.994/440,"Alow"-> 1/2,"G"->59049/65536,"Gs"->243/128,"Elow"-> 3/4|>
Out[]=
A1,As,B,C,Cs,D,Ds,E,F,Fslow0.840895,Alow,G,Gs,Elow
2187
2048
9
8
19683
16384
81
64
4
3
729
512
3
2
6561
4096
1
2
59049
65536
243
128
3
4
To test if the ‘freq’ function works, I tried inputting the note ‘A’ into it to play for one second. An ideal output would play 440Hz for one second with a gradual fadeout.
freq["A",1]
Out[]=
Since the function does work, I used MapApply to play each individual note of the Seikilos Epitaph melody for the intended song to play as a sequence of each note (to understand the musical notation, see ‘Training Recognition of Greek Musical Notation’ section). In succession, it should sound like an exact replica, sonically, of the melody as played in ancient Greek times.
This code creates an audio playback by passing a sequence of note-duration pairs to the freq function. The notes are looked up in the ratios dictionary and the Sound function chains them together into a complete sequence.
seikilosmelody=Sound[freq@@@{{"A",1},{"E",1},{"E",2},{"Cs",0.5},{"D",0.5},{"E",0.5},{"D",1.5},{"Cs",0.5},{"D",0.5},{"E",0.5},{"D",0.5},{"Cs",0.5},{"B",0.5},{"A",1},{"B",0.5},{"G",1.5},{"A",0.5},{"Cs",0.5},{"E",0.5},{"D",0.5},{"Cs",0.5},{"D",0.5},{"Cs",0.5},{"A",1},{"B",0.5},{"G",1.5},{"A",0.5},{"Cs",0.5},{"B",0.5},{"D",0.5},{"E",0.5},{"Cs",0.5},{"A",0.5},{"A",1},{"A",0.25},{"Fslow",0.25},{"Elow",1}}]
Out[]=
Training Recognition of Greek Musical Notation
Training Recognition of Greek Musical Notation
Unlike modern staff notation, Ancient Greek vocal music was written using alphabetic symbols, with each symbol representing a specific pitch relative to the others. However, these symbols do not have an immediately obvious equivalent in modern notation, and there is no universal “key” that can simply be applied. To determine which pitches the symbols in the Seikilos Epitaph represented, I consulted a range of academic publications on Ancient Greek musical notation. While different sources explained the notation system, the crucial breakthrough was locating a scholarly translation chart that explicitly mapped each vocal notation symbol to its corresponding note in modern notation. This provided the basis for converting the original melody into a format that could be interpreted computationally.
I created an association that maps each of the seven vocal notation symbols used in the Seikilos Epitaph to the corresponding relative pitch identified during the notation analysis. This provides a simple lookup table, allowing each Greek symbol to be translated into its equivalent note name before being converted into a frequency for playback.
symbolToNote=<|"Z"->"E","I"->"D","K"->"Cs","C"->"A","O"->"B","Φ"->"G","X"->"Fslow","┐"-> "Elow"|>
Out[]=
ZE,ID,KCs,CA,OB,ΦG,XFslow,┐Elow
With this lookup table, the previously defined note frequencies can now be accessed directly from the Ancient Greek notation. By passing a Greek symbol through symbolToNote, the symbol is first translated into its corresponding note name before being processed by the freq function. This makes it possible to play notes directly from the original notation without manually converting each symbol.
The following example demonstrates this by passing the Greek symbol C into symbolToNote, which returns its equivalent note (A) before the freq function generates the corresponding sound.
freq[symbolToNote["C"],1]
Out[]=
Having verified that individual symbols can be translated successfully, the same approach can be extended to an entire piece of music. Instead of supplying modern note names to the playback function, the melody of the epitaph is now written entirely using the original Ancient Greek vocal notation symbols alongside their durations. As each symbol is processed, it is translated into its corresponding note name by symbolToNote before the freq function converts it into the appropriate frequency.
I used Map to translate each Greek notation symbol into a note, passed the result to freq to generate the correct sound, and combined the notes into a single Sound object for the whole playback.
SoundFlattenMapFunction[pair,freq[symbolToNote[pair[[1]]],pair[[2]]]],{"C",1},{"Z",1},{"Z",1.5},{"K",0.5},{"I",0.5},{"Z",0.5},{"I",1.5},{"K",0.5},{"I",0.5},{"Z",0.5},{"I",0.5},{"K",0.5},{"O",0.5},{"C",1},{"O",0.5},{"Φ",1.5},{"C",0.5},{"K",0.5},{"Z",0.5},{"I",0.5},{"K",0.5},{"I",0.5},{"K",0.5},{"C",1},{"O",0.5},{"Φ",1.5},{"C",0.5},{"K",0.5},{"O",0.5},{"I",0.5},{"Z",0.5},{"K",0.5},{"C",0.5},{"C",1},{"C",0.25},{"X",0.25},"┐",1
Out[]=
Making a new instrument: The Lyre
Making a new instrument: The Lyre
Although the ratio of pitches is calculated correctly by the program and the tune is played in the right pitch ratios, the unprocessed output sounds very machine-like. The reason for this is that the initial code produces simple sine wave tones without any acoustic data from real sound. For a realistic tone to emerge, the model instrument tones have to be added to the tones. This can be done through modelling the harmonics and envelope structures of the old instruments like the lyre.
As opposed to producing sound at just one frequency, the actual string of the instrument vibrates at a multitude of integer multiples of the frequency of the base note, called overtones or harmonics. In this particular algorithm, the fundamental frequency (f) is supplemented with three layers of frequencies that are higher harmonics (2f,3f, and 4f). In addition, the code imitates the amplitude envelope of a natural plucked instrument (i.e., volume dynamics of a played note). In the case of the lyre, there is an acute attack after releasing the string or picking it with the finger, and then there is gradual decay. Using increasingly severe dampening multipliers for the higher harmonics (-3, -6, -10, and -15), the code successfully imitates the physical phenomenon whereby high frequencies are attenuated much faster than the fundamental frequency in an acoustically wooden enclosure.
As opposed to producing sound at just one frequency, the actual string of the instrument vibrates at a multitude of integer multiples of the frequency of the base note, called overtones or harmonics. In this particular algorithm, the fundamental frequency (f) is supplemented with three layers of frequencies that are higher harmonics (2f,3f, and 4f). In addition, the code imitates the amplitude envelope of a natural plucked instrument (i.e., volume dynamics of a played note). In the case of the lyre, there is an acute attack after releasing the string or picking it with the finger, and then there is gradual decay. Using increasingly severe dampening multipliers for the higher harmonics (-3, -6, -10, and -15), the code successfully imitates the physical phenomenon whereby high frequencies are attenuated much faster than the fundamental frequency in an acoustically wooden enclosure.
This code defines a function that uses additive synthesis to build a custom string instrument timbre from scratch, simulating the sound of an ancient lyre. Instead of a lone sine wave, this function mathematically layers multiple frequencies together to emulate how a physical string vibrates.
In[]:=
freqWithLyre[note_,dur_]:=With[{f=440*ratios[note]},Play[(Sin[2Pi*f*t]*Exp[-3t/dur]+0.5*Sin[4Pi*f*t]*Exp[-6t/dur]+0.25*Sin[6Pi*f*t]*Exp[-10t/dur]+0.1*Sin[8Pi*f*t]*Exp[-15t/dur]),{t,0,dur}]]
The code below is the same as when the symbol association was made, just with the ‘freq’ function replaced with ‘freqWithLyre’ to model the additional code.
Extension: Image Processing
Extension: Image Processing
With this extension, I wanted to develop an automated way to recognise the ancient Greek musical notation from an image of the artefact and translate it into playable audio notes. To this end, I tried several computational approaches, beginning with the automatic text recognition to extract the symbols, and then switching to accurate, manual pixel-cropping techniques. However, the end-to-end automated pipeline was naturally not fully achievable within the scope of this project as standard OCR tools are not designed to handle historic music symbols and the layout needed tedious manual intervention.
I located an image of the musical notation and lyrics of the Seikilos Epitaph and defined a variable with it to use in my code going further.
I used Wolfram Language’s built-in OCR tool (TextRecognize) to try to extract all the text in the image, with the intention of removing Greek Alphabet from the output extracted.
As shown by the output, running TextRecognize directly on the image yielded completely garbled results. Because standard OCR tools are not built to interpret ancient notation symbols or archaic Greek diacritics, the software misread the characters entirely, turning the lyrics into gibberish and translating the musical symbols into a chaotic mix of random letters, numbers, and symbols like ‘c@ğ’ and ‘cčc#’. This made it completely impossible to use the automated output for any meaningful translation or playback mapping.
automatically detect and highlight the different lines of text in the image. The goal was to see if the software could recognize the layout and separate the rows of musical symbols from the lyrical text below them.
The initial attempt relied on the built-in TextRecognize tool to find text boundaries automatically, but this produced highly inconsistent results due to several structural factors. Standard OCR algorithms are fundamentally designed to scan for clear, horizontal white space between uniform lines of text. Furthermore, because OCR is trained on modern alphanumeric fonts, it struggled with the unusual ancient notation marks, such as bars over letters or inverted characters (otherwise known as diacritics). Instead of isolating them, the software awkwardly sliced the text into irregular bounding boxes that either grouped lines together or split them down the middle, making automated extraction impossible.
Because of this, I tried to create a manual approach to salvage the data. By utilizing Wolfram Language’s interactive Coordinate Tool, it was possible to manually hover over each individual musical symbol to pinpoint and record its exact pixel boundaries across the X and Y axes. These recorded pixel ranges were then fed into the ImageTake function to perform targeted extractions, extracting the exact rectangle of pixels containing a specific character, such as isolating the letter “C”. While this manual cropping method was far more tedious than an automated scan, it bypassed the limitations of the OCR algorithm entirely, guaranteeing that each symbol was cleanly cut and completely free from any interfering background noise or lyric text.
Because of this, I tried to create a manual approach to salvage the data. By utilizing Wolfram Language’s interactive Coordinate Tool, it was possible to manually hover over each individual musical symbol to pinpoint and record its exact pixel boundaries across the X and Y axes. These recorded pixel ranges were then fed into the ImageTake function to perform targeted extractions, extracting the exact rectangle of pixels containing a specific character, such as isolating the letter “C”. While this manual cropping method was far more tedious than an automated scan, it bypassed the limitations of the OCR algorithm entirely, guaranteeing that each symbol was cleanly cut and completely free from any interfering background noise or lyric text.
By utilizing Wolfram Language’s interactive Coordinate Tool, it was possible to manually hover over each individual musical symbol to pinpoint and record its exact pixel boundaries across the X and Y axes.
To create a clean output without taking up a lot of space in the notebook, I used the Row function to see if the coordinates I defined in the earlier variable gave me the desired symbols as outputs.
Since the Row function output was able to generate a clean, verified line-up of the isolated characters, I attempted to take the automation a step further by using TrainImageContentDetector. The goal was to feed these cropped samples into the machine learning function to train a custom model that could automatically recognize and hard-code these specific ancient notations across the entire artefact image. However, even with the clean inputs, the training process was plagued by bugs and glitches, which were likely caused by the small sample size and the highly nuanced differences between the ancient characters. Because the model couldn’t reliably detect the symbols without errors, I was forced to abandon the image processing route altogether.
Extension: Transposition
Extension: Transposition
Ancient Greek musical notation was entirely relative, meaning it didn’t dictate a rigid, absolute frequency (like a modern A = 440 Hz). Instead, it focused on the intervals, which acted as the specific mathematical relationships and gaps between the notes. Because the music was defined by these proportional distance ratios rather than a fixed pitch, the melody could theoretically be anchored to any starting note and successfully transposed.
This code demonstrates that exact concept by programmatically building a Pythagorean scale using pure tuning ratios (powers of 3/2). By passing a starting note like “B” into the function, the script calculates the exact fractional frequency multipliers needed to construct the rest of the scale relative to that base.
This code demonstrates that exact concept by programmatically building a Pythagorean scale using pure tuning ratios (powers of 3/2). By passing a starting note like “B” into the function, the script calculates the exact fractional frequency multipliers needed to construct the rest of the scale relative to that base.
This code defines a custom function that automates transposition by shifting the twelve semitones to start on any chosen base note. It calculates the pure tuning ratios by continuously stacking perfect fifths, which are mathematically multiplying the frequency by 3/2 for each step.
Conclusion
Conclusion
In conclusion, I believe I was able to connect ancient musical archaeology and modern computerization by creating an interactive program that reconstructs, processes, and plays music from the Seikilos Epitaph. This project originated from the frequency ratio equations found in the ancient scale, which was then enhanced through the creation of the historical instrument modeled after the Koto.But attempts to automate the data entry with computer vision ran into roadblocks. The built-in OCR tools and machine learning models were unfortunately not compatible with this specialised layout with due to the overlapping lyrics and unfamiliar notation, and the issue persisted through multiple attempted pathways.
The main programming logic was very successful since the Seikilos melody was playing perfectly in pitch and rhythm. The script was able to bypass the broken note pipeline to generate the exact acoustic intervals used almost two millennia ago, by manually hard-coding the custom frequencies directly into the program. This also helped in demonstrating that these historic melodies can be programmatically transposed and computed into any musical key. And so, this project, through the use of modelled instrumentation to bring these custom frequencies to life, allows us to hear music almost exactly as it was heard in ancient Greece, providing a powerful, functional proof-of-concept for the digital preservation and synthesis of antiquity.
The main programming logic was very successful since the Seikilos melody was playing perfectly in pitch and rhythm. The script was able to bypass the broken note pipeline to generate the exact acoustic intervals used almost two millennia ago, by manually hard-coding the custom frequencies directly into the program. This also helped in demonstrating that these historic melodies can be programmatically transposed and computed into any musical key. And so, this project, through the use of modelled instrumentation to bring these custom frequencies to life, allows us to hear music almost exactly as it was heard in ancient Greece, providing a powerful, functional proof-of-concept for the digital preservation and synthesis of antiquity.
Future Directions
Future Directions
While this project used manual cropping because standard text recognition doesn’t work on ancient symbols, a great next step would be to fully automate the process. Future work could use image processing to automatically separate the row of musical symbols from the text below it.
Another natural extension could delve into further training Wolfram Language to recognise ancient Greek vocal notation systems. With a pre would be to expand the translation table to include the complete Ancient Greek vocal notation system, rather than only the symbols that appear in the Seikilos Epitaph. This would enable the program to interpret and play a much wider range of surviving Ancient Greek musical works.
One major drawback of the current implementation is that the musical scale was defined only in a single octave, which limits the melodic range available for composition and performance. To address this, a future enhancement would be to build a flexible function to create scales that automatically calculate and map notes over many octaves from a single scale definition, based on the principle that notes in higher octaves are exact doublings in frequency (or 12 semitones higher). By implementing this, the project could more accurately reconstruct the full range of ancient Greek melodies and provide a more versatile tool for musical experimentation.
Building on the code I developed, a natural future direction would be to expand this into a fully functional transposition tool. While I managed to get the foundational mathematical logic working, I wasn’t able to finish integrating it into a system that handles full pieces of music. In the future, this program could be completed so that entire ancient melodies can be shifted and played back automatically in any musical key.
Another natural extension could delve into further training Wolfram Language to recognise ancient Greek vocal notation systems. With a pre would be to expand the translation table to include the complete Ancient Greek vocal notation system, rather than only the symbols that appear in the Seikilos Epitaph. This would enable the program to interpret and play a much wider range of surviving Ancient Greek musical works.
One major drawback of the current implementation is that the musical scale was defined only in a single octave, which limits the melodic range available for composition and performance. To address this, a future enhancement would be to build a flexible function to create scales that automatically calculate and map notes over many octaves from a single scale definition, based on the principle that notes in higher octaves are exact doublings in frequency (or 12 semitones higher). By implementing this, the project could more accurately reconstruct the full range of ancient Greek melodies and provide a more versatile tool for musical experimentation.
Building on the code I developed, a natural future direction would be to expand this into a fully functional transposition tool. While I managed to get the foundational mathematical logic working, I wasn’t able to finish integrating it into a system that handles full pieces of music. In the future, this program could be completed so that entire ancient melodies can be shifted and played back automatically in any musical key.
References
References
1
.Ancient Greek Music System - Greek Music Information Center. (n.d.-a). Www.Musicportal.Gr. https://www.musicportal.gr/ancient_greek_music_system/?lang=enFarya
2
.Faraji & World Musicians. (2022, December 9). Ancient Greek and Roman Music - A Beginner’s Introduction. YouTube. https://www.youtube.com/watch?v=18Lk_xLNdx4
3
.Musmerized. (2021, February 26). Music of the Ancient Greeks. YouTube. https://www.youtube.com/watch?v=wRO43tigSh0SEIKILO
4
.Ancient World Music. (2021, February 6). Ancient Music Genres Explained | by Lina Palera and LyreAcademy.com. YouTube. https://www.youtube.com/watch?v=JJ9KPHLrR_g
5
.6
.What are the greek modes, and how do they differ from modern modes? (n.d.-b). Music: Practice & Theory Stack Exchange. https://music.stackexchange.com/questions/11274/what-are-the-greek-modes-and-how-do-they-differ-from-modern-modes
7
.YK band. (2019, April 3). Seikilos Epitaph with lyrics, ancient greek music, lyre & frame drum ( Acoustic Live ) |YK band. YouTube. https://www.youtube.com/watch?v=qdlFLw5Asc8&list=RDqdlFLw5Asc8
Acknowledgements
Acknowledgements
I would like to thank my mentor, Carolyn Applebaum, for her guidance and unconditional support throughout this project. This research would not have been possible without her patience and support—even through my late-night questions, moments of doubt, and the large variety of image processing roadblocks. I am also grateful to the YK band for beautifully bringing the melody of the Seikilos Epitaph to life through their vocals and mastery over ancient instruments. It came in handy many times as a direct reference for what I wanted my own output to sound like. I am also thankful to the program directors, Eryn Gillam, Rory Foulger, and Megan Davis, for ensuring that my research journey was both smooth and enjoyable, and also Stephen Wolfram. Lastly, I am grateful to the other mentors I consulted throughout this project and to those who offered their moral support along the way.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Implementing ancient musical systems
by Aahana Gupta
Wolfram Community, STAFF PICKS, July 9, 2026
https://community.wolfram.com/groups/-/m/t/3751389
by Aahana Gupta
Wolfram Community, STAFF PICKS, July 9, 2026
https://community.wolfram.com/groups/-/m/t/3751389