Skip to content
/ pyTabs Public

A Domain-Specific Language (DSL) for simplified music notation.

License

Notifications You must be signed in to change notification settings

E2Music/pyTabs

Repository files navigation

# PyTabs

PyTabs is a DSL (Domain Specific Language) for simplified music notation and composition description. The projet includes an interpreter that creates an object model of a composition based on the provided description and a player that renders music based on that model, all of which is accessable through a simple GUI.

In PyTabs language you can describe a composition which is composed of several segments played sequentially. Each segment consists of one or more sequences that are played together. Each sequence is played by a specified instrument and described in one of supported notations. Currently PyTabs supports guitar and keyboard tablatures and guitar chords and it can easily be extended to support other notations.

An example of a composition in PyTabs language can be found in examples/songs/smoke_on_the_water.song . Here is the example with marked composition sections:

song example screenshot

Technical description

PyTabs is implemented in python programming language, it uses textX python library to define the language grammar and interpret compositions creating a python object model. The model obtained from textX is then interpreted for each notation and transformed into a composition model that uses mingus note container objects for note representation. This model can then be played using the FluidSynth library wrapper provided in mingus. FluidSynth uses SoundFont samples to play the music, so different soundfonts can be used to play different instrument in the same composition.

Installation

####Requirements:

  • python v2.7
  • textX v0.3.1
$ pip install textX
$ pip install mingus
$ pip install PySide

After installing all the requirements you can download or clone and start using the PyTabs project.

Getting started

To run the example song you can simply run the play_examples script in the root directory of the project. The first time you run it, it will tell you to download the necessary soundfont files and where to place them. After that you can run it again and you should be able to hear the music. The example can be found at examples/songs/smoke_on_the_water.song .

You can also start the GUI by running the start_gui script in the root directory. Enter a valid composition description in PyTabs language such as the one provided in the example (you can click the 'new' button and choose to open the example file) and click the 'play' button to play the composition.

gui screenshot

You can also check out the grammar definitions in pytabs/grammar. They are easy to understand and can help you write your own compositions.

In order to import your own soundfonts just place the .sf2 files into examples/songs/instruments and add an import statement in the import section of your composition. It should look like:

my_instrument_name "instruments/myInstrument.sf2"

License

PyTabs is a free and opensource project licensed under GPLv3.

About

A Domain-Specific Language (DSL) for simplified music notation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages