Tabalchi


NameTabalchi JSON
Version 0.0.9 PyPI version JSON
download
home_pagehttps://github.com/shreyanmitra/Tabalchi
SummaryTabalchi: Parser and Generator for Indian Classical Music
upload_time2024-10-26 12:45:44
maintainerNone
docs_urlNone
authorShreyan Mitra
requires_pythonNone
licenseNone
keywords music midi indian-music audio-transcription
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Tabalchi <img src="https://github.com/user-attachments/assets/0d47f705-74d9-43e4-91b0-a6c8806965ba" width=100/>


A parser for Indian classical music, specifically tabla, that **does not** require any knowledge of MIDI, music sampling, or battery kits.

<blockquote>
Note that this is a brand-new library that is not necessarily stable. Feel free to provide feedback to the author
</blockquote>

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:

```javascript
{
"type": "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": [
    {
      "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": 60,
"jati": "Chatusra",
"playingStyle": "Lucknow",
"display": "Bhatkande"
}
```
First, make sure required dependencies are in your system as follows:

```bash
sudo apt install ffmpeg acoustid-fingerprinter
```

To play a given .tabla file, simply write the following Python code. You will need to install the ``Tabla`` library through ``pip install Tabla``

```python
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:

```python
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:

```python
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:

<table>
  <tr>
    <th>Symbol</th>
    <th>Description</th>
    <th>Example + Walkthrough</th>
  </tr>
  <tr>
    <td><code>|</code></td>
    <td>This differentiates 2 beats.</td>
    <td><code>dha S S | ge na ge</code></td>
  </tr>
  <tr>
    <td><code>-</code></td>
    <td>indicates a sequential phrase needs to be split differently when conforming to a particular jati</td>
    <td><code>dha tere-kite | dhe tete</code>
    <br>
    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.</td>
  </tr>
  <tr>
    <td><code>[]</code></td>
    <td>This is to group two phrases as 1 "syllable", so to speak, without creating a new sequential phrase.</td>
    <td><code>dha ti ge | [dha ge] tere-kite</code>
    <br>
    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.</td>
  </tr>
  <tr>
    <td><code>~</code></td>
    <td>This is to indicate a specific phrase for further checks.</td>
    <td><code>dha ~ti ge | dha dha ti</code>
    <br>
    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 <code>True</code> if the specified ti is the second syllable of its beat, and <code>False</code> otherwise.</td>
  </tr>
</table>

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](https://shreyanmitra.github.io/Tabalchi/) for more detailed descriptions.

1. **BeatRange**: Represents an interval of beats with methods for checking sequences and subsequences.
2. **CompositionType**: Defines a composition type with a schema, validity check, and registration for future use.
3. **Numeric**: An abstract base class representing entities with an associated number, utilized for Taal, Jati, and Speed classes.
4. **Taal**: Represents a rhythmic cycle or meter in Indian classical music, storing beats, clap positions, and additional information.
5. **Jati**: Represents a rhythmic grouping or subdivision, defined by the number of syllables.
6. **SpeedClasses**: Categorizes speed into classes based on beats per minute with methods for checking and generating random speeds.
7. **Speed**: Represents a specific tempo, either by beats per minute or by a named speed class.
8. **Notation**: An abstract base class for converting a Bol into a string format, with a method for displaying the notation.
9. **Bhatkande**: Intended to handle Bhatkande notation (without current implementation).
10. **Paluskar**: Intended to handle Paluskar notation (without current implementation).
11. **Bol**: Represents a collection of beats with methods for playback and writing to a file using a specified notation.
12. **Beat**: Represents a collection of phrases within a beat, managing playback and phrase duration calculations.
13. **Fetcher**: Provides static methods for fetching sound data associated with phrases or adding new audio recordings.
14. **Sound**: Represents the soundbite associated with a phrase, with methods for playing and merging or joining sounds.
15. **Phrase**: Represents a tabla phrase including its properties, soundbite, and functionality for playing and creating composite or sequential phrases.
16. **CompositionGenerator**: Offers a static method for generating a composition of a specified type using a machine learning model.
17. **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](https://en.wikipedia.org/wiki/Akhil_Bharatiya_Gandharva_Mahavidyalaya_Mandal). He is currently pursuing a Visharad (equivalent to a Bachelor's) certification.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shreyanmitra/Tabalchi",
    "name": "Tabalchi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "music midi indian-music, audio-transcription",
    "author": "Shreyan Mitra",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/d9/ff/6a6a40ae116c209dc6dbc362ee88422aaa9e5ca0b1ef7f81571816deda93/tabalchi-0.0.9.tar.gz",
    "platform": null,
    "description": "# Tabalchi <img src=\"https://github.com/user-attachments/assets/0d47f705-74d9-43e4-91b0-a6c8806965ba\" width=100/>\n\n\nA parser for Indian classical music, specifically tabla, that **does not** require any knowledge of MIDI, music sampling, or battery kits.\n\n<blockquote>\nNote that this is a brand-new library that is not necessarily stable. Feel free to provide feedback to the author\n</blockquote>\n\nTo get started, write a .tabla file with the *bol* (composition). The syntax of a .tabla file is identical to that of a .json file.\n\nExample:\n\n```javascript\n{\n\"type\": \"Kayda\",\n\"name\": \"My Composition\",\n\"components\":\n  {\"mainTheme\":\n   {\"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\",\n   \"khali\": \"Infer\"\n   },\n \"paltas\": [\n    {\n      \"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\",\n      \"khali\": \"Infer\"\n    }\n ],\n \"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\"\n },\n\"taal\": \"Ektaal\",\n\"speed\": 60,\n\"jati\": \"Chatusra\",\n\"playingStyle\": \"Lucknow\",\n\"display\": \"Bhatkande\"\n}\n```\nFirst, make sure required dependencies are in your system as follows:\n\n```bash\nsudo apt install ffmpeg acoustid-fingerprinter\n```\n\nTo play a given .tabla file, simply write the following Python code. You will need to install the ``Tabla`` library through ``pip install Tabla``\n\n```python\nfrom Tabla import *\nparser = BolParser()\nparser.parse(\"yourBol.tabla\").play()\n```\n\nTo view the entire composition with the notation of your choice (specified in the .tabla file itself), simply write:\n\n```python\nfrom Tabla import *\nparser = BolParser()\nparser.parse(\"yourBol.tabla\").write(\"yourOutputFile.txt/pdf\", Bhatkande)\n```\nThe parser above is the standard BolParser provided by the library. You can create your own parser by doing something like:\n\n```python\nfrom Tabla import*\nclass MyParser(BolParser):\n  #override functionality\nparser = MyParser()\nparser.load(\"yourBol.tabla\")\n```\n\nThe standard parser uses a set of predefined configurations available through the appropriate ``get`` methods. It also uses some standard symbols given below:\n\n<table>\n  <tr>\n    <th>Symbol</th>\n    <th>Description</th>\n    <th>Example + Walkthrough</th>\n  </tr>\n  <tr>\n    <td><code>|</code></td>\n    <td>This differentiates 2 beats.</td>\n    <td><code>dha S S | ge na ge</code></td>\n  </tr>\n  <tr>\n    <td><code>-</code></td>\n    <td>indicates a sequential phrase needs to be split differently when conforming to a particular jati</td>\n    <td><code>dha tere-kite | dhe tete</code>\n    <br>\n    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.</td>\n  </tr>\n  <tr>\n    <td><code>[]</code></td>\n    <td>This is to group two phrases as 1 \"syllable\", so to speak, without creating a new sequential phrase.</td>\n    <td><code>dha ti ge | [dha ge] tere-kite</code>\n    <br>\n    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.</td>\n  </tr>\n  <tr>\n    <td><code>~</code></td>\n    <td>This is to indicate a specific phrase for further checks.</td>\n    <td><code>dha ~ti ge | dha dha ti</code>\n    <br>\n    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 <code>True</code> if the specified ti is the second syllable of its beat, and <code>False</code> otherwise.</td>\n  </tr>\n</table>\n\nThis symbol specification is given by ``BolParser``'s ``getSymbols()``, which should be overridden to return appropriate markdown text if your parser uses different/additional symbols.\n\nWe now give brief descriptions of the main classes you may find yourself using in addition to BolParser. See the [docs](https://shreyanmitra.github.io/Tabalchi/) for more detailed descriptions.\n\n1. **BeatRange**: Represents an interval of beats with methods for checking sequences and subsequences.\n2. **CompositionType**: Defines a composition type with a schema, validity check, and registration for future use.\n3. **Numeric**: An abstract base class representing entities with an associated number, utilized for Taal, Jati, and Speed classes.\n4. **Taal**: Represents a rhythmic cycle or meter in Indian classical music, storing beats, clap positions, and additional information.\n5. **Jati**: Represents a rhythmic grouping or subdivision, defined by the number of syllables.\n6. **SpeedClasses**: Categorizes speed into classes based on beats per minute with methods for checking and generating random speeds.\n7. **Speed**: Represents a specific tempo, either by beats per minute or by a named speed class.\n8. **Notation**: An abstract base class for converting a Bol into a string format, with a method for displaying the notation.\n9. **Bhatkande**: Intended to handle Bhatkande notation (without current implementation).\n10. **Paluskar**: Intended to handle Paluskar notation (without current implementation).\n11. **Bol**: Represents a collection of beats with methods for playback and writing to a file using a specified notation.\n12. **Beat**: Represents a collection of phrases within a beat, managing playback and phrase duration calculations.\n13. **Fetcher**: Provides static methods for fetching sound data associated with phrases or adding new audio recordings.\n14. **Sound**: Represents the soundbite associated with a phrase, with methods for playing and merging or joining sounds.\n15. **Phrase**: Represents a tabla phrase including its properties, soundbite, and functionality for playing and creating composite or sequential phrases.\n16. **CompositionGenerator**: Offers a static method for generating a composition of a specified type using a machine learning model.\n17. **AudioToBolConvertor**: Provides a static method to transcribe a Bol from an audio recording based on speed and jati.\n\n## About the Author\nShreyan has been learning the tabla for 12+ years at the [Akhil Bharatiya Gandharva Mahavidyalaya Mandal](https://en.wikipedia.org/wiki/Akhil_Bharatiya_Gandharva_Mahavidyalaya_Mandal). He is currently pursuing a Visharad (equivalent to a Bachelor's) certification.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Tabalchi: Parser and Generator for Indian Classical Music",
    "version": "0.0.9",
    "project_urls": {
        "Homepage": "https://github.com/shreyanmitra/Tabalchi"
    },
    "split_keywords": [
        "music midi indian-music",
        " audio-transcription"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c38967ff9d06ffb746d61a71270ca2ee13950a8b85cc856a1483dec5a3394c2a",
                "md5": "79b9db05bda66368fd139abdb6c27b46",
                "sha256": "07dbd2b6b3dfaa2c859557ab8d73cf807ef37df48edc2bb4d2a8355d61d89525"
            },
            "downloads": -1,
            "filename": "Tabalchi-0.0.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "79b9db05bda66368fd139abdb6c27b46",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20868,
            "upload_time": "2024-10-26T12:45:42",
            "upload_time_iso_8601": "2024-10-26T12:45:42.971340Z",
            "url": "https://files.pythonhosted.org/packages/c3/89/67ff9d06ffb746d61a71270ca2ee13950a8b85cc856a1483dec5a3394c2a/Tabalchi-0.0.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9ff6a6a40ae116c209dc6dbc362ee88422aaa9e5ca0b1ef7f81571816deda93",
                "md5": "599dbdaf27171474a786c858c5061d7c",
                "sha256": "3383975cc20f6d6b6e956cbdd8254b9c34c76e220d30822cfba1bd24e9c6ac78"
            },
            "downloads": -1,
            "filename": "tabalchi-0.0.9.tar.gz",
            "has_sig": false,
            "md5_digest": "599dbdaf27171474a786c858c5061d7c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23483,
            "upload_time": "2024-10-26T12:45:44",
            "upload_time_iso_8601": "2024-10-26T12:45:44.572436Z",
            "url": "https://files.pythonhosted.org/packages/d9/ff/6a6a40ae116c209dc6dbc362ee88422aaa9e5ca0b1ef7f81571816deda93/tabalchi-0.0.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-26 12:45:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shreyanmitra",
    "github_project": "Tabalchi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tabalchi"
}
        
Elapsed time: 0.38486s