lilypond-user
[Top][All Lists]
Advanced

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

Re: ?ly2video - create videos from your LilyPond projects


From: Peter Chubb
Subject: Re: ?ly2video - create videos from your LilyPond projects
Date: Thu, 07 Jun 2012 20:15:14 +1000
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 Emacs/23.4 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

>>>>> "FireTight" == FireTight  <address@hidden> writes:

FireTight> Hello, my name is Jiri "FireTight" Szabo and I would like
FireTight> to introduce program ly2video to you. This program can
FireTight> generate videos from your LilyPond projects that contains
FireTight> moving music staff, which is synchronized to music (
FireTight> 
http://www.youtube.com/playlist?list=PL444F0513202699C4&feature=view_all
FireTight> examples ). If you are interested, you can download it
FireTight> 
http://code.google.com/p/ly2video/downloads/detail?name=ly2video_v1.0.zip
FireTight> here . I hope you will enjoy it! :)

Thanks --- this is pretty awesome.

I had to change it a bit to get it to work on linux (patch appended).

It'd be neat if this could work with articulate a bit better --- to
expand trills and turns for example, and better handle appogiaturas.

I found that music with many acciaccaturas caused the timing to get a
bit out --- the video started to lag further and further behind, until
it caught up at the end.

BTW these changes are just a hack, except for the call to
subprocess.check_call, which is needed --- the real fix would be
to build the filenames using the system path separator.

Also it'd be nice if the downloadable zip file unpacked into its own
directory so it created a single directory full of stuff rather than
several and a file or two.

--- ly2video/ly2video.py        2012-05-21 09:29:36.000000000 +1000
+++ ly2video-new/ly2video.py    2012-06-07 19:53:42.082361794 +1000
@@ -501,7 +501,7 @@
                         frame.putpixel(((resolution[0] / 2) + 1, pixel), color)
 
                     # save that frame
-                    frame.save(".\\notes\\frame" + str(frameNum) + ".png")
+                    frame.save("./notes/frame" + str(frameNum) + ".png")
                     frameNum += 1
 
         sys.stderr.write("SYNC: Generating frames for page "
@@ -932,8 +932,7 @@
 
     # call TiMidity++ to convert MIDI (ly2videoConvert.wav)
     try:
-        subprocess.call(winTimidity + "timidity ly2videoConvert.midi -Ow",
-                        stderr=subprocess.STDOUT) 
+        subprocess.check_call([winTimidity + "timidity", 
"ly2videoConvert.midi", "-Ow"])
     except subprocess.CalledProcessError as err:
         sys.stderr.write("ERROR:\n")
         sys.stderr.write("> TiMidity++: There has been some error.\n")
@@ -956,7 +955,7 @@
     # call FFmpeg (without title)
     if not useTitle:
         if os.system(winFfmpeg + "ffmpeg -f image2 -r " + str(fps)
-                     + " -i .\\notes\\frame%d.png -i ly2videoConvert.wav "
+                     + " -i ./notes/frame%d.png -i ly2videoConvert.wav "
                      + output) != 0:
             sys.stderr.write("ERROR: Calling FFmpeg has failed.\n")
             return 13
@@ -965,13 +964,13 @@
         # create video with title
         silentAudio = generateSilence(titleLength)
         if os.system(winFfmpeg + "ffmpeg -f image2 -r " + str(fps)
-                     + " -i .\\title\\frame%d.png -i "
+                     + " -i ./title/frame%d.png -i "
                      + silentAudio + " -same_quant title.mpg") != 0:
             sys.stderr.write("ERROR: Calling FFmpeg has failed.\n")
             return 14
         # generate video with notes
         if os.system(winFfmpeg + "ffmpeg -f image2 -r " + str(fps)
-                     + " -i .\\notes\\frame%d.png -i ly2videoConvert.wav "
+                     + " -i ./notes/frame%d.png -i ly2videoConvert.wav "
                      + "-same_quant notes.mpg") != 0:
             sys.stderr.write("ERROR: Calling FFmpeg has failed.\n")



reply via email to

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