lilypond-user
[Top][All Lists]
Advanced

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

Re: midi note durations


From: David Kastrup
Subject: Re: midi note durations
Date: Thu, 29 May 2014 08:13:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

address@hidden writes:

> Derek:
>> I used music21 to measure note lengths, and was able to convert midi (and a
>> variety of other formats). See: http://web.mit.edu/music21/
>
> Looks useful, tough it is big:
>
> $ git clone https://github.com/cuthbertLab/music21.git
> ...
> $ du -s music21/
> 393864  music21/

Well, it is checkout _and_ repository.

> Think I got it working...
>
> $ python
> Python 2.7.3 (default, Jan  2 2013, 16:53:07) 
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> from music21 import *
> music21: Certain music21 functions might need these optional packages:
> matplotlib, scipy; if you run into errors, install it by following the
> instructions at
> http://mit.edu/music21/doc/installing/installAdditional.html
>>>> s = converter.parse("/home/karl/most/music/noter/manskor/Slovenec_sem.mid")
>>>> print lily.translate.LilypondConverter().textFromMusic21Object(s)
> \version "2.19" 

Huh.  2.19 without further qualification does not make all that much
sense as the development releases are where all the changes happen.  But
then I'm happy that we are not talking about, say, 2.10.2 here.

> \score  {
>       << \new Staff  = xbdycdydc { \key c \major 
>              \time 1/4
>              g 8..  
>              r 32  
>              \time 3/4
>              < e'  c'  > 4   
>              r 32  
>              < c'  g  > 16   
>              g 8..  
>              r 32  
>              < e'  c'  > 8..   
>              r 32  
>              < f'  d'  > 4   
>              r 32  
>              < d'  b  > 16   
>              < b  g  > 8..   
>              r 32  
>              < f'  b  > 8..

This looks fairly usable.

> Output looks better than midi2ly, but it is missing the upbeat and it
> has thoose strange rests between the notes. So, as is it didn't solve
> the issue.
>
> The durations are handled in music21/duration.py, maybe I can get some
> ideas from it.

Maybe some options can be tweaked, yes.  Also chances are that the
author(s) will actively respond to questions given that the project
makes a "currently active" impression.

-- 
David Kastrup



reply via email to

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