Coder Social home page Coder Social logo

hsercanatli / makam-musicxml2lilypond Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 1.52 MB

Python package that converts a makam-musicxml score to lilypond

License: GNU Affero General Public License v3.0

Python 29.91% Jupyter Notebook 24.95% LilyPond 45.14%
lilypond musicxml-format converter makam-score symbtr python musical-elements lilypond-format

makam-musicxml2lilypond's Introduction

musicxml2lilypond

Python package that converts a makam score in MusicXML format to LilyPond

Introduction

This repository provides a simple and reliable conversion of a makam music score from MusicXML format to LilyPond format.

You can obtain 2200 makam music scores in MusicXML format from SymbTr collection. Alternatively, you can use the SymbTr-txt files in the collection and generate the MusicXML files with limited modifications using the MusicXMLConverter package.

The LilyPond format and the LilyPond software itself are a powerful combination for music engraving, with vast use cases. Moreover, when the software convert the LilyPond format to svg, it embeds a precise mapping of the musical elements in the LilyPond file onto the generated vectors in the svg file. In turn, the musical elements in the svg files can be rendered synchronous to the music playback in relevant applications.

Usage

from musicxml2lilypond.scoreconverter import ScoreConverter

# input MusicXML file
xml_file = "samplescores/pesendide--sazsemaisi--aksaksemai----iii_selim.xml"

# output lilypond file
ly_file = "samplescores/pesendide--sazsemaisi--aksaksemai----iii_selim.ly"

# output json file storing the mappings beteen ly and musicxml files.
map_file = "samplescores/pesendide--sazsemaisi--aksaksemai----iii_selim.json"

# instantiate
converter = ScoreConverter()
ly_stream, mapping = converter.convert(xml_file, ly_out=ly_file, 
                                       render_metadata=False)

Installation

Note: This package is in active development. The capabilities and calls might change significantly until the first stable release. For this reason we suggest the users to stick to the released versions, for the most reliable performance.

If you want to install musicxml2lilypond, it is recommended to install the package and its dependencies into a virtualenv. In the terminal, do the following:

virtualenv env
source env/bin/activate
python setup.py install

If you want to be able to edit files and have the changes be reflected, then install the repository like this instead:

pip install -e .

Authors

Hasan Sercan Atlı hsercanatli AT gmail DOT com
Burak Uyar burakuyar AT gmail DOT com
Sertan Şentürk contact AT sertansenturk DOT com
Andrés Ferraro andres DOT ferraro AT upf DOT edu

Reference

Sercan's Thesis

makam-musicxml2lilypond's People

Contributors

hsercanatli avatar sertansenturk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

refaqtor

makam-musicxml2lilypond's Issues

Natural and accidental displayed together

When the accidental of a note symbol changes to another accidental, the natural is printed together with the natural "accidental". It only seems to happen from certain accidentals to another.

I suspect this is a lilypond bug, but I don't have the time to trace the real issue now. Below, I have made a basic example to some examples. @hsercanatli can you try to reproduce it for all note combinations and try to figure out the reason?

If it's related to our package or if we can introduce a temporary fix, we should correct it here. In addition, if it's a LilyPind related bug, we should report it: http://lilypond.org/bug-reports.html

\include "makam.ly"
{
\time4/4
\clef treble
{
d''4
dfc''4
dbm''4
dfc''4
dk''4
dfc''4
db''4
dfc''4
dc''4
dfc''4
dfb''4
dfc''4
dfk''4
dfc''4
dfbm''4
dfc''4
}
{
d''4
dk''4
dbm''4
dk''4
db''4
dk''4
dc''4
dk''4
dfc''4
dk''4
dfb''4
dk''4
dfk''4
dk''4
dfbm''4
dk''4
}
}

unused variables

Many of the variables in the musicxml2lilypond seems to be unsued. Some of them are directly related to notes, e.g. "dot"

Usul changes are not displayed properly.

If we typeset the example ly output in the sample data, the measures are divided correctly. However the usul change in the start of 4th Hane is not handled. For this reason when we typeset the lilypond file, the produced measure markings in the 4th hane are wrong. Consequently the last Teslim has its measure markings shifted.

I add the lilypond file and the tpesetted pdf below. The lilypond is saved as a txt file because github does not support uploading txt files.

pesendide--sazsemaisi--aksaksemai----iii_selim.txt
pesendide--sazsemaisi--aksaksemai----iii_selim.pdf

lilypond svg improvements

Using the svg's generated from lilypond is beneficial because 1) we can render the notes individually, 2) the beamings are correct.

  • Although the key signature is set, lilypond renders the accidentals in measures. During lilypond generation, the accidental of a note which is in the key signature should be hidden.
  • The arrangement of the key signatures (which key signature should be the first, the second, the third etc...)

Additional but not necessary to Dunya

  • The fonts of the sectoin names are inconsistent
  • Print title, composer, makam and usul information of related score

Below are the SymbTr pdf and the pdf rendered by Lilypond:
lilypond.pdf
evcara--sazsemaisi--aksaksemai----dilhayat_kalfa.pdf

(github doesn't allow svg, but pdf and svg looks identical)

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.