lilypond-user
[Top][All Lists]
Advanced

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

Re: midi note durations


From: karl
Subject: Re: midi note durations
Date: Thu, 29 May 2014 09:54:57 +0200 (CEST)

David Kastrup:
> 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.

http://code.google.com/p/music21/downloads/detail?name=music21-1.7.1.tar.gz&can=2&q=

is 44.7 MB, a little to big for a dependancy.

> > 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.

midi2ly gives you

 \version "2.14.0"

does that make better sense, or what version to aim at that gives you 
a sufficiently modern thing without beeing to much bleeding edge,
what's the best balance ?

> > \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.

Yes, it is. Is it time to replace midi2ly, or just point to music21 for
midi->lilypond conversions ?

> > 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.

Good tip, I'll see if I can get any response.

Regards,
/Karl Hammar

-----------------------------------------------------------------------
Aspö Data
Lilla Aspö 148
S-742 94 Östhammar
Sweden
+46 173 140 57





reply via email to

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