lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

music21


From: Jean Abou Samra
Subject: music21
Date: Sun, 13 Sep 2020 22:57:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

The Net is a surprisingly vast place. Did you ever hit this link?

http://web.mit.edu/music21/

It's a Python library that, among musicological tasks, features
import from a dozen of different file formats, including MusicXML,
MIDI and ABC, as well as export to LilyPond.

Performing the conversion seems to be as simple as

from music21 import *
converter.parse('/path/to/input.[ext]').write('lilypond', '/path/to/output.ly')

I have been unsuccessfully trying to show `make check` output when
using this converter…  See the dev/jas/test-music21-2 branch in case
you're interested. Anyway, here is a simple ABC file:

X:1
T:Notes
M:C
L:1/4
K:C
C, D, E, F,|G, A, B, C|D E F G|A B c d|e f g a|b c' d' e'|f' g' a' b'|]

Attached are four LilyPond files. Two of them are produced using abc2ly
and music21. The remaining two are the result of processing music21
MusicXML output via musicxml2ly and xml2ly.

Neither option is perfect; the xml2ly route seems to do the best job though.

I'm running out of time for LilyPond right now, but I wanted to mention this
thing. Maybe we can make a good anything2ly converter out of it, possibly
pairing its MusicXML support with xml2ly. Being a Python library makes it
easy to include in Frescobaldi.

Cheers,
Jean -- in a puzzled state of mind.

Attachment: test-abc2ly.ly
Description: Text Data

Attachment: test-music21.ly
Description: Text Data

Attachment: test-music21-musicxml2ly.ly
Description: Text Data

Attachment: test-music21-xml2ly.ly
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]