Machines learn to play Tabla, Part – 2

This is a followup on my earlier post on Machines Learn to play Tabla. You may wish it check it out first reading this one…

Three years ago, I published a post on using recurrent neural networks to generate tabla rhythms. Sampling music from machine learned models was not in vogue then. My post received a lot of attention on the web and became very popular. The project had been a proof-of-concept and I have wanted build on it for a long time now.

This weekend, I worked on making it more interactive and I am excited to share these updates with you. Previously, I was using a proprietary software to convert tabla notation to sound. That made it hard to experiment with sampled rhythms and I could share only a handful sounds. Taking inspiration from our friends at Vishwamohini, I am now able to convert bols into rhythm on the fly using MIDI.js.

Let me show off the new javascript synthesizer using a popular Delhi kaida. Hit the ‘play’ button to listen:

Now that you’ve heard the computer play, here’s an example of it being played by a tabla maestro:

Of course, the synthesized outcome is not much of a comparison to the performance by the maestro, but it is not too bad either…

Now to the more exciting part- Since our browsers have learned to play the tabla, we can throw in the char-rnn model that I built in the earlier post.  To do this, I used the RecurrentJS library and combined it with my javascript tabla player:

Feel free to play around with tempo and maximum character-limit for sampling. When you click on ‘generate’,  it will play a new rhythm every time. Hope you’ll enjoy playing with it as much as I did!

The player has a few kinks at this point I am working towards fixing them. You too can contribute to my repository on GitHub.

There are two areas that need major work:

Data: The models that I trained for my earlier post was done using a small amount of training data. I have been on a lookout for better dataset since then. I wrote a few emails, but without much success till now. I am interested in knowing about more datasets I could train my models on.

Modeling: Our model did a very good job of understanding the structure of TaalMala notations. Although character level recurrent neural networks work well, it is still based on very shallow understanding of the rhythmic structures. I have not come across any good approaches for generating true rhythms yet:

I think more data samples covering a range of rhythmic structures would only partially address this problem. Simple rule based approaches seem to outperform machine learned models with very little effort. has some very good rule-based variation generators that you could check out.  They sound better than the ones created by our AI. After all the word for compositions- bandish, literally derived from ‘rules’ in Hindi. But on the other hand, there are only so many handcrafted rules that you can come up with which may lead to generating repetitive sounds.

Contact me if you have some ideas and if you’d like to help out! Hope that I am able to post an update on this sooner than three years this time 😀

6 thoughts on “Machines learn to play Tabla, Part – 2”

  1. Thank you Gaurav for this. Tabla is the music I love. After my retirement I started learning to play on my own with on line materails like this and could not go far. So I stopped Tabla playing and started learning my next best – keyboard. Today I thought I will search to find anything like what you have done and found your work. I love it.
    I generated some notes from the player above and then copied the notes to It sounds different to the original (generate).

    1. Thank you for your interest in my blog. I am happy to know that you appreciate tabla as well. I agree, the synthesized music will always sound different from what a human would play. However, it can still serve as a learning tool for new players. Additionally, have you tried changing the pauses between the bols? Also, some of the bols may be spelled differently than what you may be used to. Please refer to link in the blog for detailed notation. Hope this helps!

  2. Hi Gaurav,

    Your work is the best simulation(if I can call it like that) of Tabla via a web browser – You have used to convert bols into rhythm .

    I am wondering if we could find a way to simulate Tabla in abcnotation via midi on a web browser.
    If you are not fmiliar with abcnotation, this gives a good introduction to abcnotation. is an Online editor and a player for abcnotation.

    To see abcnotation in action, just copy the notation given below into the editor in the left panel and you will see the music sheet on the right panel of the editor. Right click anywhere (not on the notes itself) on the music sheet and select play to play.

    I am wondering if we could use MIDI.js with abcnotation.

    Would you be able to provide some advice.

    Thank you
    T:Paddy O’Rafferty
    dff cee|def gfe|dff cee|dfe dBA|dff cee|def gfe|faf gfe|1 dfe dBA:|2 dfe dcB|]
    ~A3 B3|gfe fdB|AFA B2c|dfe dcB|~A3 ~B3|efe efg|faf gfe|1 dfe dcB:|2 dfe dBA|]
    fAA eAA|def gfe|fAA eAA|dfe dBA|fAA eAA|def gfe|faf gfe|dfe dBA:|

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.