Related features
Cite this article
Sumarno, A. (2026, October 8). Prototyping Lyrical Torus Knots. Liner Notes. https://literarydj.com/writing/liner-notes/lyrical-torus-knots/Sumarno, Arshad. "Prototyping Lyrical Torus Knots." Liner Notes, LiteraryDJ, 8 Oct. 2026, literarydj.com/writing/liner-notes/lyrical-torus-knots/.Arshad Sumarno, "Prototyping Lyrical Torus Knots," Liner Notes, LiteraryDJ, October 8, 2026, https://literarydj.com/writing/liner-notes/lyrical-torus-knots/.@misc{sumarno2026prototyping,
title = {{Prototyping Lyrical Torus Knots}},
author = {Sumarno, Arshad},
year = {2026},
month = {10},
day = {8},
howpublished = {{Liner Notes, LiteraryDJ}},
url = {https://literarydj.com/writing/liner-notes/lyrical-torus-knots/},
urldate = {2026-10-08}
}TY - ELEC
TI - Prototyping Lyrical Torus Knots
AU - Sumarno, Arshad
PY - 2026
DA - 2026/10/08
T2 - Liner Notes
PB - LiteraryDJ
UR - https://literarydj.com/writing/liner-notes/lyrical-torus-knots/
ER - Reading the Knot#
At first glance, it may seem difficult to see what is going on here. What is a torus knot? How is this related to music? What do these different knots represent? Here is a guide on how to read the knot.
Drawing on the definition provided by Wolfram MathWorld: “A (p,q)-torus knot is obtained by looping a string through the hole of a torus p times with q revolutions before joining its ends, where p and q are relatively prime.”1 In other words, they look cool. But, in order to walk you through my thought process and decision-making, I should first contextualize this project with its central question: how can we communicate an artist’s lyrics in a visual way?
With an understanding of the question at hand, I can now walk you through my process and how I am formulating the argument. Since my goal is to communicate an artist’s lyrics visually, the first step is to build the corpora. I used LiteraryDJ’s existing process which leverages BeautifulSoup, the Genius and Spotify APIs, and custom Python scripts to retrieve, organize, and clean the lyrics and relevant metadata. Once I was able to build the corpora of artists I was interested in, the focus shifted from gathering lyrics to measuring them. Essentially, how can I develop an argument that a set of numbers represents an artist? In order to tackle this, I broke this process down into 2 distinct layers:
Lexical Layer#
The lexical layer focuses on patterns in the words and structures of the corpus. The goal here is to have standardized NLP measurements of how we can represent an artist. Metrics like bi-grams, tri-grams, most common words, and mean word length were all measured in this layer.
Semantic Layer#
The semantic layer focuses on the meaning of words and how ideas are expressed. This is the more subjective layer, but semantic analysis is a well-researched academic space. The semantic layer looks for metrics like how much an artist shifts topic or how concrete vs. abstract their vocabulary is. In order to measure this, I experimented with various combinations of GloVe, spaCy, Gensim’s Word2Vec, and WordNet.
Now that we are able to measure the corpora of each artist, how do we transform this into something visual? This is where data curation comes in, and why it is important to lay out the process when making these curatorial decisions. For instance, the torus knot visualization requires some precision. Its implementation in three.js takes six parameters:
- Radius
- Tube
- Tubular Segments
- Radial Segments
- p
- q
The first 4 are quite straightforward. They change the way the “string” of the torus knot looks. The values for p and q are a bit more complex. Going back to the definition, the shape is obtained by looping a string through a hole p times with q revolutions. This essentially means that we are interested not only in the individual values of p and q, but in how they work together to determine the resulting knot. In order to account for this, I grouped p and q pairs into four shape families (donut, trefoil, flower, and spiral), each with four levels of complexity. An artist’s structural and rhythmic score chooses the level, and the balance between structure and rhythm chooses the family.. I would also like to note that I made the decision to keep radial segments constant, as I felt variations in radial segments did not yield visually interesting results.
So, here is my argument: We can visualize an artist’s lyrics by taking these parameters, mapping them onto groups of measurable metrics from the lexical and semantic layers, and create a unique torus knot for every artist.
To accomplish this, we need to normalize the data in order to understand how our data about each artist compares to lexical and semantic patterns across a broader reference sample of song lyrics. Is a value of 0.35 high for lexical density? What percentile is 0.79 for agent-patient ratio? In order to calculate this, I ran the lexical/semantic pipeline on a database of 110,000 songs randomly sampled from genius-song-lyrics, a Hugging Face dataset published by sebastiandizon. Using this data, I was able to establish the distribution of each metric and calculate percentile ranks. Finally, I created groupings to map onto each parameter. These represent my interpretation of how particular lexical and semantic characteristics might be represented visually:
Semantic Breadth → radius
How varied the fields are. A narrow artist may return to the same semantic fields while a broad artist moves across ideas
semantic_dispersion
semantic_field_entropy
entity_type_entropy
mtld_approximation (measure of textual lexical diversity)
wordnet_concreteness_proxy_spread
unique_line_rate_percent
Linguistic Density / Force → tube
How packed, heavy, direct, or forceful the lyrics feel
lexical_density
content_word_rate
noun_phrase_complexity
action_density
wordnet_concreteness_proxy_mean
compression_score
uppercase_word_rate_percent
punctuation_per_100_tokens
Smoothness vs. Punchiness → tubularSegments
Describes whether the artist’s language feels flowing and melodic or sharp and percussive
smoothness_score
punchiness_score
monosyllabic_punch
line_choppiness
hook_recurrence
rhyme_ending_concentration
Structural Complexity and Rhythmic Intricacy → p and q
Represents the artist’s structural and rhythmic complexity
structural_complexity_score
rhythmic_intricacy_score
tree_depth_average
clause_density
rhyme_entropy
line_choppiness
patterned_hook_use
From these mappings, you can see how they relate visually to the knot. For example, metrics like semantic dispersion, entity type entropy, and the measure of textual lexical diversity are grouped into “semantic breadth” – how varied an artist’s semantic fields are – and this visually manifests as the knot’s radius, or the space between the loops of the string. Similar logic for groupings and mappings is used for the rest of the parameters.
What is seen here is the result of natural language processing and feature engineering techniques that map an artist’s lyric data to the parameters of a torus knot. This complex computational process is designed to produce a distinct torus knot based on each artist’s lyrical characteristics, creating a visualization that is unique to one artist and one artist alone.
Future Steps#
In the future, uniqueness can be further explored by adding another emotional layer on top of the lexical and semantic layers. This additional layer could be used to visually represent how an artist emotes through their lyrics. Another potential addition is to create more intricate pairings of p and q that can map onto different musical parameters such as genre or generation.
Acknowledgements#
I would like to thank the University of Maryland’s Maryland Institute for Technology in the Humanities as well as Professor Andrew W. Smith for the support and guidance throughout the development of this project.
