Code Monkey home page Code Monkey logo

txt2midi's Introduction

Indian Musical Notations to Music

Description

This tool converts Indian Musical Notations to MIDI music.

It takes a .json file as input as gives a .mid file as the output.


Installation

This tool depends on

  • pygame

    • Install it using

    pip3 install pygame

  • tkinter

    • On debain based systems, install it using

    apt-get install python3-tk

Install the tool using

python3 setup.py install

This will install the tool in /usr/local/bin and you can run it using

txt-midi

Input File Format

The .json file has 2 parameters:

  • tempo
  • tracks

tempo

It takes a positive Integer as the argument. Default Value is 240. This is an optional parameter.

tracks

It is an array. Structure of an element of the array is:

{
    "instrument": "Acoustic Grand Piano",
    "loop": 1,
    "volume": 127,
    "baseOffset": "S",
    "notes": "S R G M P D N S'"
}

instrument

instrument takes predefined value supported by MIDI. Take a look at the instruments. Default value is Acoustic Grand Piano. This is an optional parameter.

loop

loop is a positive integer. It defines the number of times the notes will be looped. Default is 1. This is an optional parameter.

volume

volume is a positive integer. Maximum allowed volume is 127. This is an optional parameter.

baseOffset

baseOffset is the Starting point of the first note. Default is S. This is an optional parameter.

notes

notes are in space separated musical notation which will be played. Look at the Syntax section. This is a required parameter.


Syntax

Natural notes supported are:

  • S: Sa
  • R: Re
  • G: Ga
  • M: Ma
  • P: Pa
  • D: Dha
  • N: Ni

Flat notes supported are:

  • r: Komal Re
  • g: Komal Ga
  • m: Komal Ma
  • d: Komal Dha
  • n: Komal Ni

To play a high note, append the note with ' and to play a low note, append it with .

For example:

To play S at one, two and three notes higher,

S' S'' S'''

To play S at one, two and three notes lower,

S. S.. S...

To elongate a note, append it with ~

For example:

To play S for two beats, S. for three beats and S'' for four beats,

S~ S.~~ S''~~~

To give a pause, use -

For example:

To give a pause between S and R

S - R

To group notes together, encapsulate them in parenthesis.

For example:

(S'NDP)

Sample input file

{
	"tempo": 240,
	"tracks": [
		{
			"loop": 3,
			"notes": "S R G M P D N S'"
		},
		{
			"instrument": "Sitar",
			"volume": 100,
			"loop": 2,
			"baseOffset": "D.",
			"notes": "S P D"
		}
	]
}

txt2midi's People

Contributors

anshulgupta0803 avatar seethec avatar

Stargazers

 avatar zjm avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

seethec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.