Hi Jean,
Thanks for your reply. Regarding scheme code: it seems to me that the simplest 
solution would be to modify event-listener.ly so that instead of storing 
point-and-click data (row and column within the lily file), it instead stores 
the pixel coordinate X, Y of the note’s (or rest’s) glyph within the output PNG 
image. I have tried that, but so far my efforts are not successful, due to my 
weak understanding of the language and LilyPond’s data architecture.
I would happily accept a “cookbook” solution for the above, as this would spare 
me countless hours of possibly futile effort.
Re MusicXML, can you recommend a FOSS MIDI to MusicXML converter that runs on 
Windows? I looked around, but didn’t find one. I tried one that was available 
on GitHub, and it generated Neutrino output, which musicxml2ly did not like.
Converting MIDI to Lily is a messy process at best, and the best argument for 
using my homegrown code is that I understand it, and it gives me maximum 
control over the conversion.
    On Wednesday, December 6, 2023 at 11:31:54 PM GMT+1, Jean Abou Samra 
<j...@abou-samra.fr> wrote:  
 
 
Hi,


I spent much of the last week converting my compositions from MIDI files to 
Lily format. I tried midi2ly first, but found it lacking, and decided to roll 
my own in C++. I gather there are other converters around, as I saw at least 
one on GitHub. I may put mine on GitHub too, after its code settles down a bit. 
It assumes the MIDI file is already quantized, but it handles triplets, and 
works well enough for me. If you're curious, some of the scores I created with 
it are here: https://www.chriskorda.com/misc/scores.html


Just out of curiosity: have you tried first converting the MIDI to MusicXML 
(using one of the various available tools), then converting that MusicXML to 
LilyPond using either musicxml2ly or xml2ly? I'd expect this to produce much 
better results than midi2ly.


Presumably I could then scroll the resulting PNG file to generate video frames. 
But would I know the pixel offsets of notes/rests within each measure?


You need some Scheme code for that. See here for what ly2video uses.
  

Reply via email to