Tabalchi: Parser and Generator for Indian Classical Music
Project description
Tabalchi
A parser for Indian classical music, specifically tabla, that does not require any knowledge of MIDI, music sampling, or battery kits.
Note that this is a brand-new library that is not necessarily stable. Feel free to provide feedback to the author
To get started, write a .tabla file with the bol (composition). The syntax of a .tabla file is identical to that of a .json file.
Example:
{
"composition": "Kayda",
"name": "My Composition",
"components":
{"mainTheme":
{"bhari": "dha ti ge ne | dha ti dha ge | dhin na ge na | tete ge ne | dha ti dha ge | dhin na ge na | tete tete | ge na tete | ge na dha ti | dha tete dha | ge ne dha ge | tin na ke na",
"khali": "Infer"
},
"paltas": {
"palta1": {
"bhari": "dha ti ge ne | dha ti dha ge | dhin na ge na | tete ge ne | dha ti dha ge | dhin na ge na | dha ti ge ne | dha ti dha ge | dhin na ge na | tete ge ne | dha ti dha ge | dhin na ge na | dha ti ge ne | dha ti dha ge | dhin na ge na | tete ge ne | dha ti dha ge | dhin na ge na | tete tete | ge na tete | ge na dha ti | dha tete dha | ge ne dha ge | tin na ke na",
"khali": "Infer"
}
},
"tihai": "dha ti ge ne | dha ti dha ge | dhin na ge na | dha S S S | dhin na ge na | dha S S S | dhin na ge na | dha S S S | dha ti ge ne | dha ti dha ge | dhin na ge na | dha S S S | dhin na ge na | dha S S S | dhin na ge na | dha S S S | dha ti ge ne | dha ti dha ge | dhin na ge na | dha S S S | dhin na ge na | dha S S S | dhin na ge na | dha S S S"
},
"taal": "Ektaal",
"speed": "60bpm",
"jati": "Chatusra",
"playingStyle": "Lucknow",
"display": "Bhatkande"
}
To play a given .tabla file, simply write the following Python code. You will need to first install the Tabla
library through pip install Tabla
from Tabla import *
parser = BolParser()
parser.parse("yourBol.tabla").play()
To view the entire composition with the notation of your choice (specified in the .tabla file itself), simply write:
from Tabla import *
parser = BolParser()
parser.parse("yourBol.tabla").write("yourOutputFile.txt/pdf", Bhatkande)
The parser above is the standard BolParser provided by the library. You can create your own parser by doing something like:
from Tabla import*
class MyParser(BolParser):
#override functionality
parser = MyParser()
parser.load("yourBol.tabla")
The standard parser uses a set of predefined configurations available through the appropriate get
methods. It also uses some standard symbols given below:
Symbol | Description | Example + Walkthrough |
---|---|---|
| |
This differentiates 2 beats. | dha S S | ge na ge |
- |
indicates a sequential phrase needs to be split differently when conforming to a particular jati | dha tere-kite | dhe tete
While normally terekite would be automatically parsed as 4 syllables (as in terekite | dha ti ge ne) or 1 syllable (as in terekite dha ti dha | S ki te ta), here we need to specify it is 2 syllables to maintain Tisia Jati. This is necessary when there is no clear way to uphold the jati for the particular beat. Notice that we do not need to write tete in the second beat as te-te because it is by default 2 syllables, which along with the dhe, makes 3 syllables per beat. |
[] |
This is to group two phrases as 1 "syllable", so to speak, without creating a new sequential phrase. | dha ti ge | [dha ge] tere-kite
This indicates that dha & ge occupy the space normally taken by one syllable, again ensuring 3 syllables per beat - the 3 syllables in the second beat are [dha ge], tere, and kite, with the latter two part of the same sequential phrase (see - symbol definition above). Technically, this is equivalent to increasing the speed for a fraction of the beat, but the speed parameter in .tabla files is only for whole number of beats. |
~ |
This is to indicate a specific phrase for further checks. | dha ~ti ge | dha dha ti
This singles out the first ti for further checks, such as those passed into the CompositionType for ensuring validity of a composition. An example of such a function would be to return True if the specified ti is the second syllable of its beat, and False otherwise. |
This symbol specification is given by BolParser
's getSymbols()
, which should be overridden to return appropriate markdown text if your parser uses different/additional symbols.
We now give brief descriptions of the main classes you may find yourself using in addition to BolParser. See the docs for more detailed descriptions.
- BeatRange: Represents an interval of beats with methods for checking sequences and subsequences.
- CompositionType: Defines a composition type with a schema, validity check, and registration for future use.
- Numeric: An abstract base class representing entities with an associated number, utilized for Taal, Jati, and Speed classes.
- Taal: Represents a rhythmic cycle or meter in Indian classical music, storing beats, clap positions, and additional information.
- Jati: Represents a rhythmic grouping or subdivision, defined by the number of syllables.
- SpeedClasses: Categorizes speed into classes based on beats per minute with methods for checking and generating random speeds.
- Speed: Represents a specific tempo, either by beats per minute or by a named speed class.
- Notation: An abstract base class for converting a Bol into a string format, with a method for displaying the notation.
- Bhatkande: Intended to handle Bhatkande notation (without current implementation).
- Paluskar: Intended to handle Paluskar notation (without current implementation).
- Bol: Represents a collection of beats with methods for playback and writing to a file using a specified notation.
- Beat: Represents a collection of phrases within a beat, managing playback and phrase duration calculations.
- Fetcher: Provides static methods for fetching sound data associated with phrases or adding new audio recordings.
- Sound: Represents the soundbite associated with a phrase, with methods for playing and merging or joining sounds.
- Phrase: Represents a tabla phrase including its properties, soundbite, and functionality for playing and creating composite or sequential phrases.
- CompositionGenerator: Offers a static method for generating a composition of a specified type using a machine learning model.
- AudioToBolConvertor: Provides a static method to transcribe a Bol from an audio recording based on speed and jati.
About the Author
Shreyan has been learning the tabla for 12+ years at the Akhil Bharatiya Gandharva Mahavidyalaya Mandal. He is currently pursuing a Visharad (equivalent to a Bachelor's) certification.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tabalchi-0.0.6.tar.gz
.
File metadata
- Download URL: tabalchi-0.0.6.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1da20dca5c342f689712b6928a6bbffcd642ce10ac2c0b83e5794809701554b7 |
|
MD5 | eecbcb504e170271f56dad1b39346e2a |
|
BLAKE2b-256 | 712d4e900f54fb914e410f54295fec4ce944815451cf044f7cb871f44d6c9192 |
File details
Details for the file Tabalchi-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: Tabalchi-0.0.6-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a584504b54b5177fdf79232864e4051a4a0517356815daffbbc3d1aaae805381 |
|
MD5 | 817801dd36201e4aaa371dd4697a6b22 |
|
BLAKE2b-256 | 1df48ec7e6ea41bc7f446f590030cef33f07362493657d91bd9a2b985a8eb401 |