On Thursday 15 September 2005 20.48, address@hidden wrote:
Hi all,
I am a new user of LilyPond and I am currently writing a program
that
transforms scores expressed in a piano-roll-like format into LilyPond
scores, for the purpose of typesetting/printing.
In the source format, music is expressed (like Midi, I suppose) as
strings of notes with absolute durations, without a notion of time
signatures, barlines, ties, etc. Is there a tried-and-true algorithm
for converting such "notes" into their proper equivalents in
LilyPond,
given a time signature?
I have 2 ideas:
- You could go through MIDI (i.e. let your program convert from
piano-roll-format to MIDI), and use lilypond's midi2ly program to
create
the .ly file
- If you are familiar with python, write a piano-roll-to-.ly
converter based
on midi2ly.py. In this case, you may only distribute the converter
under the
terms of the GNU GPL.
I'm especially thinking of how to resolve a note like "c3" (where 3
means 3 quarter note beats) into Lilypond's "c2." Any
suggestions? I
suppose this problem relates to "quantization" but in this case, the
input data is mostly "clean" and unambiguous. I don't think the
solution should be too compilcated.
This is done by midi2ly, so both the above solutions would fix this.
--
Erik