lilypond-user
[Top][All Lists]
Advanced

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

midi2ly (continued)


From: Martin Tarenskeen
Subject: midi2ly (continued)
Date: Fri, 18 Sep 2009 10:57:28 +0200
User-agent: Mutt/1.5.19 (2009-01-05)

Hi,

I posted earlier my problems with midi2ly.
"midi2ly is no longer supported, sorry" was the reaction I got.

So I decided to try to fix the problems I was having, while at 
the same time learning to program some Python.

The main problem I wanted to fix first:
Midifile format-1 files often (always ?) have the time signature (and 
tempo) information in the very first track, but without any notes.
midi2ly reads this track, but does not print it because it contains no 
notes. Result: a tune in 3/4 time will still be printed in 4/4 time.

I worked out 2 different workarounds:

1. midi2ly will print the first track even if it contains no notes, to 
make sure the other tracks are printed in the correct time signature.
Looks ugly, but is working.

2. I have added a new command line option --time (or -T) that allows the 
user to override the timesignature in track 1 with a global time 
signature for all tracks. ( Problem: time-changes ) This will give a 
prettier looking score, because the empty track 1 will not be printed in 
this case.

While working on it I did some more work on the command line options:

-P --partial=DUR        let's you specify an upbeat value. 
                        Does fix some problems with some midifiles
--skip                  If selected use 's' for rests, 
                        default is 'r' (was 's')
-w --warranty           Was not working. fixed easily           
-s, -d                  I have added a default value for
                        note-on and duration quantization. I have 
                        choosen a value of '16'

Other things I changed:

- I re-used the variable program_version in more places in the script
- I use the input file name as title in a header block
- I use the comment tag also as tagline in a header block

TODO: lot's of things like polyphony in one staff (buggy), barchecks 
and barscounts when time signature changes, and probably more. 

I believe, while it is still far from perfect, my version is better that 
what we currently have. But because this is my very first work 
using Python and still feel insecure with this friendly language, I 
think other people should first give it a try, and - if they have the 
expertise - take a look at the Python code.

After that the good things can go to the GIT. ( I'm not very good with 
that git stuff either ) 

attached: my version of midi2ly. Please try and enjoy (or not ... don't 
overwrite your current version of midi2ly just yet ;-)

-- 

Martin Tarenskeen

Attachment: midi2ly
Description: Text document


reply via email to

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