music21

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

music21

Jean ABOU SAMRA
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.


test-abc2ly.ly (690 bytes) Download Attachment
test-music21.ly (1K) Download Attachment
test-music21-musicxml2ly.ly (1K) Download Attachment
test-music21-xml2ly.ly (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: music21

Jonas Hahnfeld
Am Sonntag, den 13.09.2020, 22:57 +0200 schrieb Jean Abou Samra:

> 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.
>
> [...]
>
> 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.
Do we need this branch in the upstream repository?

Jonas

signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: music21

Jean ABOU SAMRA
Le 13/10/2020 à 16:40, Jonas Hahnfeld a écrit :

> Am Sonntag, den 13.09.2020, 22:57 +0200 schrieb Jean Abou Samra:
>> 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.
> Do we need this branch in the upstream repository?
>
> Jonas

No we don't; thanks, deleted from the main repository.

Best,
Jean


Reply | Threaded
Open this post in threaded view
|

Re: music21

Jan-Peter Voigt
In reply to this post by Jean ABOU SAMRA


Am 13.09.20 um 22:57 schrieb Jean Abou Samra:

> 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.
>
Music21 is a great tool I had to use recently. MusicXML im- and export
is very good. The Lilypond-export should be improved and Lily-import
would need some preprocessing, but I am going to look at it.

Jan-Peter