Geek
bullet

Delta Fingerprinting of Ragas using Finite Differences (August, 2006)

bullet

Introduction

Fingerprinting (or Hashing) is a concept in computer science. A fingerprint or "hash" is a small signature of some given data, and hashing is the process of computing it. Typically, the ratio of the size of the fingerprint to the size of the data is small. Fingerprinting allows us to identify a particular data element quickly, within small error bounds by comparing the hash to previously computed hashes. When two or more data elements map to the same fingerprint, it is called as a "collision". A good hashing process minimizes probability of collisions.

Deltas are differences between two quantities. In computing delta hashes for raga, we take the sorted set of unique notes belonging to that raga, assign absolute, monotonically increasing values to these notes and then create a set of the Finite Differences between adjacent notes. This set of differences is called the Delta Hash.

Hashing, when applied to Ragas, manifests as a technique of generating a compact signature of a Raga, with a small collision probability. Observe that the sorted set of unique notes in a raga has good collision characteristics. We use this property to compute the delta hashes.

This whitepaper discusses the delta hash function that takes a Set representation of a Raga as input and computes it's Hash as output. We also apply this concept at a higher granularity than a Raga. We conclude with a few interesting results on the semantic value inherent in phrases and ragas and propose some open questions for research.

bullet

Applications

1. Fingerprints are a convenient format for analysis of musical phrases in Indian classical music, as it encodes distances between notes as opposed to absolute notes.

2. Fingerprints of phrases allow us to answer questions around semantics of a phrase, like "is mood independent of the notes of a given Raga?", etc.

3. Distance encoding in the fingerprints of Ragas capture the idea of 'Moorchana" as a simple string operation.

bullet

Formalization

Indian classical music is unique in the way it treats Swars. The fundamental difference between a Western Note and an Indian classical "Swar" is that the former is Absolute while the later is Relative. For instance, the Western note A corresponds to the absolute frequency of 440 Hz. In contrast, the frequency of the Swar Ga frequency depends on that of the base note, Sa.

If we consider the different Swars to be placed on an axis, a 'swar-line' (analogous to the number-line) is formed. As the Swars are relative points on the swar-line, we can place them at regular intervals without loss of generality. We use the swar-line as a foundation for calculating the Deltas.

The swar line extends infinitely in both directions. However, for purposes of Delta Fingerprinting of Ragas, we will only be needing the Madhya Saptak from 0 to 12.

swar line

We can now formalize the Delta Fingerprint of a raga as follows:

Let delta(R) be the delta fingerprint of the raga R.

Let Raga R be represented by its sorted set of unique notes N={N1, N2 ... Nm},

where m is the total number of notes in the raga.

Let small delta_i_ be the forward difference between the (i)th and the (i+1)th notes in set N,

Let P-i_ be the position of the (i)th Swar on the Swar-Line (only considering Madhya Saptak, 0 through 12)

Then, Delta fingerprint of raga definition

(1)

The English form of this definition states "The fingerprint of raga R is defined to be a set of deltas, such that each (i)th delta is the difference of the positions of the (i)th and (i+1)th swars on the swar line".

bullet

Examples of Delta Fingerprints of Ragas

Let us look at some examples of Delta Fingerprinting for some well-known Ragas.

N(Malkaus) = { Sa, Ga, Ma, Dha, Ni, Sa }

Malkaun's swars plotted on the Swar-line will look like this:

malkauns plotted on swar line

We can then calculate the Delta fingerprint of Malkauns.

delta(Malkaus) = { 3, 2, 3, 2, 2 }

Note that a more compact representation can be achieved if we observe that a reasonable maximum delta for any raga is 4 and that there can be a total of 12 swars. We can then use (log2 4 * 12) bits, or 3 bytes to represent a Raga's fingerprint. However, we will follow the set representation in this paper for sake of readability.

Delta Fingerprint examples for some other Ragas:

delta(bhoop)

= { Sa, Re, Ga, Pa, Dha, Sa }

= { 2, 2, 3, 2, 3 }

delta(bhairav)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 1, 3, 1, 2, 1, 3, 1 }

delta(bhairavi)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 1, 2, 2, 2, 1, 2, 2 }

delta(yaman)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 2, 2, 2, 1, 2, 2, 1 }

delta(puriya dhanashree)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 1, 3, 2, 1, 1, 3, 1 }

delta(bageshree)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 2, 1, 2, 2, 2, 1, 2 }

delta(hansadhwani)

= { Sa, Re, Ga, Pa, Ni, Sa }

= { 2, 2, 3, 4, 1 }

delta(jog)

= { Sa, Ga, Ga, Ma, Pa, Ni, Sa }

= { 3, 1, 1, 2, 3, 2 }

delta(gujri-todi)

= { Sa, Re, Ga, Ma, Dha, Ni, Sa }

= { 1, 2, 3, 2, 3, 1 }

delta(basant bahar)

= { Sa, Re, Re, Ga, Ga, Ma, Ma, Pa, Dha, Dha, Ni, Ni, Sa }

= { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }

bullet

Properties of Delta Fingerprints of Ragas

1. sigma (delta i) = 12 for all Ragas

The summation of each delta in the Fingerprint will add up to 12 for all Ragas.

2. A Circular Left Shift (left rotate) operation on the Delta Fingerprint maps to Moorchana.

Moorchana is shift of origin from the Starting Swar of a raga (Sa) to an arbitrary note in that Raga. However, in contrast to transposition used in western music, this shift is relative and involves mapping the old notes relative to the new "origin".

Moorchana can be conveniently represented using Delta Fingerprints as a Circular Left-Shift operation on the fingerprint string, the shift length being the index of the swar chosen as the new origin.

For example, When Moorchana is performed on Bhoop with Ga as the new origin (or new Sa), we get the delta fingerprint corresponding to the Raga Malkauns.

This is evident from the Circular Left shifts on delta(bhoop)

= { Sa, Re, Ga, Pa, Dha, Sa }

= { 2, 2, 3, 2, 3 }

A circular left shift of length 1 gives { 2, 3, 2, 3, 2 } (deltas shifted and wrapped around are shown in red)

Another circular left shift of length 1 gives { 3, 2, 3, 2, 2}

= { Sa, Ga, Ma, Dha, Ni, Sa }

= Malkauns

Similarly, delta(bhoop)

= { Sa, Re, Ga, Pa, Dha, Sa }

= { 2, 2, 3, 2, 3 }

A circular left shift of length 3 gives { 2, 3, 2, 2, 3}

= { Sa, Re, Ma, Pa, Dha, Sa }

= Durga

We can also deduce the swar to shift origin to, by doing some pattern analysis on the delta fingerprints. For example:

We know delta(bhairavi)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 1, 2, 2, 2, 1, 2, 2 }

We also know delta(yaman)

= { Sa, Re, Ga, Ma, Pa, Dha, Ni, Sa }

= { 2, 2, 2, 1, 2, 2, 1 }

Observe that a circular left shift of length 1 on delta(bhairavi) gives us delta(yaman).

As a delta of 1 from Sa in Bhairavi is Komal Rishabh (Re), we can deduce that performing Moorchana in Bhairavi by considering the Re to be the new "Sa", we can create raga Yaman!

bullet

Delta Fingerprints of Phrases

Let us apply the delta fingerprint concept to a phrase instead of a Raga.

There are some key differences between delta fingerprints of Ragas and those of phrases.

1. A Raga's Notes will always start from Sa. A phrase is a sequence of notes, and can start from any arbitrary note.

2. There will also be a lower (5) and upper (12) bound on the number of notes (and hence size of the fingerprint) for a Raga, while a phrase can be arbitrarily long.

3. Each individual delta in the fingerprint of a raga will be a non-zero, positive number. Deltas for phrases can be negative, or even zero.

4. A raga's fingerprint provides enough information to re-construct the original set of notes. The fingerprint of a phrase is missing key information to reconstruct the original phrase. This missing piece of data is the distance of the first note of the phrase from Sa, or the origin.

We can now define the delta fingerprint of a phrase as follows:

Let delta(Ph) be the delta fingerprint of the phrase Ph.

Let Phrase delta(Malkaus) be represented by a sequence of notes N={N1, N2 ... Nm},

where m is the total number of notes in the phrase.

Let small delta_i_ be the forward difference between the (i)th and the (i+1)th notes in set N,

Let P-i_ be the position of the (i)th Swar on the Swar-Line,

Let I be the index of the first note of the phrase from Sa. Thus, I=P_N1_

Then, Delta fingerprint of phrases definition

(2)

bullet

Examples of Delta Fingerprints of Phrases

Let us look at examples of computing delta fingerprints of phrases in different ragas.

1. Raga Bhairav, the phrase is { Ga, Re, Ga, Ma, Re, Sa }.

The delta fingerprint of this phrase can be calculated thus:

delta { Ga, Re, Ga, Ma, Re, Sa } = { 4, { -3, 3, 1, -4, -1 } }

Note that here, the index of the starting note Ga is 4, its distance from Sa.

2. Raga Malkauns, the phrase is { Dha, Ni, Sa, Ma }

The delta fingerprint of this phrase can be calculated thus:

delta { Dha, Ni, Sa, Ma } = { -4, { 2, 2, 5 } }

Note that here, the index of the starting note (lower or mandra) Dha is -4, its distance from Sa.

3. Raga Yaman, the phrase is { Dha, Ni, Re, Ga }

The delta fingerprint of this phrase can be calculated thus:

delta { Dha, Ni, Re, Ga } = { -3, { 2, 3, 2 } }

Note that here, the index of the starting note (lower or mandra) Dha is -3, its distance from Sa.

bullet

Observations, Results and Open Questions

Q. Do delta fingerprints of a phrase encode all of musical semantics?

To help answer this question, let us first look at an analog in Language. A language defines a set of words (combinations of basic alphabets) and assigns semantics or meaning to it. A musical phrase can be thought of as a word, which may have meaning associated with it. Of course, many times, how a word is said, or the context in which it is used, greatly influences its intended meaning. (For the sake of simplicity, let us keep aside misinterpretations of meaning due to a protocol mismatch!)

To help isolate the semantic value in this musical language, we split a musical piece into 3 distinct components.

1. Vocabulary (the phrase)

2. The context (the environment and temporal position of the phrase)

3. The Inflection (how a phrase is being sung/played)

Let us begin with isolating the phrase from the context and inflection. Consider once more, the phrase { Ga, Re, Ga, Ma, Re, Sa } in Raga Bhairav. The delta fingerprint of this phrase was calculated to be { 4, { -3, 3, 1, -4, -1 } }. Imagine this phrase to be sung in an aalap form. Although not an objective result, many will agree that this phrase has the "feel" of serenity, of silent energy. We can say that the phrase had a particular semantic associated with it that evoked such an emotional response in the listener.

If we now consider the same phrase pattern with a different index, say 6, we get a new phrase { Ma, Ga, Ma, Pa, Ga, Re } which happens to be in Raga Madhuwanti. Once again, imagine this phrase to be sung in same aalap form as used before. This time, a majority of listeners will feel the mood to be more of an anxious soft-pathos.

The context adds its own semantics to a phrase, interacting with the phrase's original meaning in complex ways. The predecessive and successive phrases, interspersing of silence, accompanying vocal or instrumental (melodic and percussion) state, etc together form the context of a phrase.

Finally, the "feel" of a phrase can change wildly depending on the manner in which it is performed. We call this Inflection. Inflections can include variables like tonal quality, volume modulation, timing characteristics of subsets of the phrase, etc. This too has a big impact on the perceived semantics of a phrase. For example, if we take the phrase { Ga, Re, Ga, Ma, Re, Sa } and sing it using different combinations of the Inflection variables, the variability of the perceived effect is high.

Thus, all three components of a piece of music (Phrases, Context and Inflection) define semantics of that piece as a whole. The amount of contribution of each individual element towards the total semantic value is variable.

Q. Is mood independent of the Raga?

A Raga is a triple containing a set of Notes (or swar) N, a set of Transitions T and a set of Nuances (or Lagaav) L. The Swars and the transitions together define an "legal" set of phrases. The set of Nuances for a Raga can include elements like the relative proportions or importance of certain notes, a set of Inflections used to adorn certain key phrases, etc. Note that the intersection of the set of Nuances and the set of all Inflections is small.

The set of phrases are defined by a Raga. Sometimes, a small set of Inflections can also be a characteristic of the Raga. However, the remaining Inflective set and the Context is independent of the raga.

Thus we can say that mood is partially independent of the Raga.

Some ragas define phrase structures and Nuances that contain a lot of semantics. Hence, it may not easy to create a large variance in the mood of such Ragas. Of course, depending on the performer's prowess of the contextual and inflective semantics, he or she can influence the mood to a large extent, although for these ragas this can prove to be quite challenging indeed. Examples include Shree, Maarva, Lalit, Miyaa-ki-Malhaar (and variants), Darbari Kanada, Multani, etc.

Conversely, those ragas that have a very small (or non-existent) set of Nuances are quite versatile in displaying a wide spectrum of moods and emotions. Examples include Malkauns, Yaman, Bhairavi, etc.

Q. Does the brain interpret musical semantics, or are emotional responses to music purely a reflex?

The answer to this question is not known as of this writing. To answer this question, experiments will need to be designed that will map brain activity to either a cognitive (interpretive) pathway, or to a purely reflexive response.

Q. How do phrase structures, Inflections and Context map to semantics?

This too is an open question. The author is currently engaged in experimenting with various phrase structures, inflections, the context and the respective perceived semantics.

Through Ragamatics, open questions like these are being researched. If you are interested in this area of research, please contact the author.