Sunday, September 22, 2013

Sargam JFugue update

The HindustaniSubParser is updated with new features. Here is a quick change list:

  1. Bug Fixed: The "Teevra Ma" was not recognized .
  2. "Ati" (Extra) higher or lower octaves can be defined using qualifiers "<<", "<<<", ">>" and so on.
  3. It is possible to set the "Base Sa" specifying the note name. Ex. "sa=C#"
  4. Possible to define the note duration. Ex. "saw reh gaq...." following the usual JFugue convention on duration. The default duration is "q".
  5. Recursive and mixed duration allowed. Ex. "saqq, reqi...." and so on. Duration should be the last qualifier.
  6. An implicit divider is allowed, to ease manual duration setting. Ex. "sa,re" will split to "sai" and "rei". Since "q" is the default duration, the two "swars" are split to two notes of 1/8th duration. Still need to sort out duration for multiple splits (Ex. "sa,re,ga").
The code is now moved to github under stdcode/HindustaniSubParser. Once JFugue arrives on github, I will fork it and maintain Sargam JFugue there. This repo as of now contains the standalone file changes I am making till then. Of course to use it, one will need to use the JFugue 5 source code and comment out the NoteSubParser and the MicrotonePreProcessor in the Staccato parser. Also one will need to instantiate and "load" the DisjoinSwarsPreProcessor in the Staccato parser.

As an example, with the new changes one can have a pattern like:
T100 ni< re ga,re ni< re sah ni< re matw ni< dh pa ma,ga re ni
T180 ni< re ga,re ni< re sah ni< re matw ni< dh pa ma,ga re niThe output of both the patterns separated by a Rest note of half duration in midi is here.

I hope to add many more soon!

Sunday, September 15, 2013

An old notebook

We had our room re-painted last weekend. As it happens on such occasions, many old stuffs were uncovered from beneath our bed-boxes, almirahs and wardrobes. Out of that heap, my wife pulled out an old notebook, from my school days.

Showcasing my school's emblem it has the stamp of the book seller from whom we had to purchase our books each year, "Chawla Book Depot". The outer cover is almost gone now, but the cardboard binding is still intact. I used to use this notebook for penning my poetic stuff.

On flipping over pages, I recall how I would pick up my pen for almost any thought or aspect that would impact me and inspire me to write a poem. I glance over the many drafts that I would write and cut-off since they did not meet my expectations. I also see some poems that made it through our school magazine for the last two years of my schooling. I recall the system that I had developed to number my poems, as I have never titled my poems, except one.

Then there is a vast amount of "ghazals" that I had penned in Hindi. The double-quotes is because technically they are not ghazals. Back then though I was aware of the Kafiya, Radif theory, I had no knowledge of the beher (the meter structure) in Urdu poetry. Reading some of them are well... hilarious. And some of them are good though immature in their presentation.

I have a habit of using the rear pages of a notebook simultaneously. Usually it allows me to divide the content into logical sections. This notebook has many ghazals that I used to "copy-down" while listening to them over the radio. I almost remember all of them by heart even today!

My wife urges me to "correct" these ghazals and re-pen them. Let us see...

Sunday, September 8, 2013

Sargam JFugue v0.001

JFugue. I had been searching for such an API for sometime. The API allows one to "program" music in Java. The project allows for programming vast varieties of characteristics found in Western music. The best part is one can export the program output to MIDI files for play back and analysis later. Version 5 is round the corner with the beta already out.

Naturally for me, the urge is to allow for expanding the scope of JFugue to Hindustani classical music. As it stands, our system is a bit complex and also my knowledge about it is limited. Lately I have been reading a lot of theory about Hindustani classical and I am trying to put the concepts into some sort of a programming pattern.

My first attempt in making JFugue to understand Hindustani sargam is described below.

  1. There are 12 notes (swars) Sa, Rek, Re, Gak, Ga, Ma, Mat, Pa, Dhk, Dh, Nik, Ni. 
  2. From a JFugue pattern perspective the above are case insensitive. 
  3. The "k" denotes the "Komal" (flat) notes. The "T" (sharp) denotes the "Teevr" note for Ma. By default, "Shudh" (plain) note is implied.
  4. Hindustani classical does not have a fixed "Sa". A notation such as "Sa=61" establishes it to the 5th Octave C# in the JFugue scale. Of course future versions will allow one to specify the note in a much user friendly manner, such as "Sa=C#5".
  5. The rest of the "swars" will automatically adjust as per this base. C# of the 5th octave is also the default "Sa" if none is specified.
  6. A rest note is defined by "Kh" (Khali). This is case insensitive too.
  7. After the base note, there are qualifiers that will be used to alter and fine tune the note for play.
  8. Only one qualifier is defined and implemented for now. It is the one to change the "Saptak" or the Octave.
  9. The "madhya saptak" (middle octave) is the implied by default. To specify "mandra saptak" (next lower) the "<" symbol is used. To specify "taar saptak" (next higher) the ">" symbol is used. So for example, "ni<", "ni" and "ni>" specify the lower octave "shudh Ni", the "madhya saptak Ni" and the "taar saptak Ni" respectively. It should be possible to specify "ati mandra" and "ati taar" octaves with the "<<" and the ">>" symbols in the future.
  10. Future versions will have many more qualifiers. Some will be ported "as is" from JFuge. For example, attack, decay, duration, tempo etc. Some will be left out ("chords", "melody" etc.) that have less significance in Hindustani classical music.
  11. One possible expansion of interest is to be able to map the "22 shruthis" of the Hindustani classical. This shall require the use of the Microtone pre-processor in JFugue or its modification. To be able to play 22 notes would bring in a lot of realistic sound production in JFugue for Hindustani classical.
The "problem" with Hindustani classical music is that there is not standard notation system. In itself, this is a big research area wanting to be explored. One such is the Bhatkhande system of notation. It has its share of shortcomings but it is one of the most popular in use today. Hence I will try to stick with it as close as possible. Obviously there are some notations that cannot be represented on a standard keyboard layout, so I will try to substitute them with alternate symbols. Like it is done for specifying the "Saptak" in this version.

I am including the source of HindustaniSubParser.java. This is just a very basic version of what is to come. Interested programmers will have to comment out the NoteSubParser and the MicrotonePreprocessor from the Staccato Parser. I have used JFugue 5 source code.

Below are some notations and resulting audio output.

First one is the Bollywood song "Tum Paas Aaye".

ga ma ga re sa ga kh ga ma ga re sa ga kh re ga re sa "ni<" re "pa<" kh re sa ga re sa sa kh sa sa re ga dh pa kh sa sa re ga dh pa kh re ga re sa "ni<" "dh<" "ni<" "pa<" kh re sa ga re sa sa sa kh

Here is the output: Tum Paas Aaye

Here is the original song: Tum Paas Aaye

Next up is one from the master, Live At Royal Albert Hall. "Has ke bola karo".

ga re ga ma ga kh sa "pa<" kh "pa<" re kh sa re sa sa kh sa re ga ga re re re kh re ga ma ga ga re sa sa kh

Here is the output: Has Ke Bola Karo

Here is the original song: Has Ke Bola Karo

Next is the start from "Ye  Inayaten Ghazab ki".

"ni<" re ga re "ni<" re sa kh "ni<" re mat kh "ni<" dh pa ma ga re "ni<" kh "ni<" re ma ga sa re "ni<" sa "dh<" "ni<" sa ga ma re sa kh

Here is the output: Ye Inayaten Ghazab

Here is the original song: Ye Inayatein Ghazab

I am all excited!




तुम आओ तो सही...

This blog of mine, would be saying to me the same thing... एक वादा करो अब हमसे ना बिछड़ोगे कभी, नाज़ हम सारे उठा लेंगे, तुम आओ तो सही। An...