Re: [ANNOUNCE] ly2video 0.4.1

2013-03-08 Thread Knut Petersen




--- ly2video.py.orig2013-03-07 09:40:54.675565398 +0100
+++ ly2video.py2013-03-07 09:52:19.787389048 +0100
@@ -1723,7 +1723,7 @@
 fSanitisedLyFile.write(\\header {\n   tagline = ##f composer = 
##f\n}\n)
 headerPart = True

-if re.search(title\\s*=, line):
+if re.search( title\\s*=, line):
 titleText.name = line.split(=)[-1].strip()[1:-1]
 if re.search(composer\\s*=, line):
 titleText.author = line.split(=)[-1].strip()[1:-1]


As \b matches the empty string at the beginning of a word, a better solution is 
to use

 +if re.search(\\btitle\\s*=, line):

as \b matches the empty string at the beginning of a word.

Adam, that should fix issue 49.

cu,
 Knut

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-07 Thread Martin Tarenskeen



On Wed, 6 Mar 2013, Knut Petersen wrote:


A 2nd issue: title generation does work, but it is broken. Only the last
characters of the
subsubtitle string are used, title and subtitle strings are completely
ignored.

Are you referring to https://github.com/aspiers/ly2video/issues/49 ?


My subsubtitle is a youtube address:

title = This will be ignored
subtitle = This also will be ignored
subsubtitle = Quelle: http://www.youtube.com/watch?v=1q2r3s4t5u6;

First of all, title and subtitle are ignored, the subsubtitle string is used.
Probably the issue 49 problem.


I have found an easy workaround for this problem: In your lilypond file 
simply put the line with the title AFTER the subtitle and subsubtitle 
lines.


Another workaround is to make a small change in ly2video.py. This patch 
will only work if there is at least one space before title in your 
Lilypond file. For me this also works.
I am not very good at regular expressions, but I guess the real fix 
requires a better matching regular expression in that line in ly2video.py.

Until then, here is my easy hack:

--- ly2video.py.orig2013-03-07 09:40:54.675565398 +0100
+++ ly2video.py 2013-03-07 09:52:19.787389048 +0100
@@ -1723,7 +1723,7 @@
 fSanitisedLyFile.write(\\header {\n   tagline = ##f composer = 
##f\n}\n)
 headerPart = True

-if re.search(title\\s*=, line):
+if re.search( title\\s*=, line):
 titleText.name = line.split(=)[-1].strip()[1:-1]
 if re.search(composer\\s*=, line):
 titleText.author = line.split(=)[-1].strip()[1:-1]

--

MT


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Knut Petersen

On 08.02.2013 03:07, Adam Spiers wrote:

Hi all,

I'm happy to announce the release of ly2video 0.4.1.

ly2video is a Python script which converts music represented by a GNU
LilyPond file into a video containing a horizontally scrolling music
staff which is synchronized with a MIDI-generated audio rendering of
the music.

I tried it on an opensuse 12.1 system:

knut@golem:~ sources/ly2video-0.4.1/ly2video.py  -i parting.ly parting.avi
LilyPond was found.
FFmpeg was found.
TiMidity++ was found.

Version in parting.ly: 2.16.2

Generating PDF, PNG and MIDI files ...

GNU LilyPond 2.16.2
»/home/knut/ly2video.tmp/unconverted.ly« wird verarbeitet
Analysieren...
Interpretation der Musik...[8][16][24][32][40]
Vorverarbeitung der grafischen Elemente...
Interpretation der Musik...
MIDI-Ausgabe nach »unconverted.midi«...
Zeilenumbrüche werden berechnet...
Zeilenumbrüche werden berechnet...
Layout nach »unconverted.preview.eps« ausgeben...
Konvertierung nach »./unconverted.preview.pdf«...
Konvertierung nach PNG...
Kompilation erfolgreich beendet

Generated PDF, PNG and MIDI files
Looking for staff lines in unconverted.preview.png
First staff line found at (8, 11)
Found 16 staff lines
Margins in mm: left=46 top=46 right=46 bottom=46
Margins in px: left=200 top=200 right=200 bottom=200
Wrote sanitised version of /home/knut/ly2video.tmp/unconverted.ly into 
/home/knut/ly2video.tmp/sanitised.ly
Generating PDF, PNG and MIDI files ...

GNU LilyPond 2.16.2
»/home/knut/ly2video.tmp/sanitised.ly« wird verarbeitet
Analysieren...
Interpretation der Musik...[8][16][24][32][40]
Vorverarbeitung der grafischen Elemente...
Interpretation der Musik...
MIDI-Ausgabe nach »sanitised.midi«...
Layout nach »sanitised.ps« ausgeben...
Konvertierung nach »./sanitised.pdf«...
Konvertierung nach PNG...
Kompilation erfolgreich beendet

Generated PDF, PNG and MIDI files
Width of /home/knut/ly2video.tmp/sanitised.png is 6939 pixels

MIDI resolution (ticks per beat) is 384

MIDI: Parsing MIDI file has ended.

Traceback (most recent call last):
  File sources/ly2video-0.4.1/ly2video.py, line 1852, in module
status = main()
  File sources/ly2video-0.4.1/ly2video.py, line 1811, in main
pitchBends)
  File sources/ly2video-0.4.1/ly2video.py, line 683, in getNoteIndices
grobPitchValue, grobPitchToken = lySrcLocation.getAbsolutePitch()
  File sources/ly2video-0.4.1/ly2video.py, line 148, in getAbsolutePitch
return LySrc.get(self.filename).getAbsolutePitch(self)
  File sources/ly2video-0.4.1/ly2video.py, line 80, in get
cls.cache[filename] = LySrc(filename)
  File sources/ly2video-0.4.1/ly2video.py, line 87, in __init__
self.initParser(document)
  File sources/ly2video-0.4.1/ly2video.py, line 95, in initParser
language, keyPitch = ly.tools.languageAndKey(document)
  File /home/knut/sources/ly2video-0.4.1/ly/tools.py, line 322, in 
languageAndKey
for token in tokens:
  File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 693, in tokens
for token in super(LineColumnMixin, self).tokens(text, pos):
  File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 218, in tokens
yield self.Unparsed(text[pos:m.start()], pos)
  File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 296, in __new__
obj = unicode.__new__(cls, value)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal 
not in range(128)


Any idea what could be broken?

cu,
 Knut

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Adam Spiers
On Wed, Mar 6, 2013 at 8:05 AM, Knut Petersen knut_peter...@t-online.de wrote:
   File sources/ly2video-0.4.1/ly2video.py, line 148, in getAbsolutePitch
 return LySrc.get(self.filename).getAbsolutePitch(self)
   File sources/ly2video-0.4.1/ly2video.py, line 80, in get
 cls.cache[filename] = LySrc(filename)
   File sources/ly2video-0.4.1/ly2video.py, line 87, in __init__
 self.initParser(document)
   File sources/ly2video-0.4.1/ly2video.py, line 95, in initParser
 language, keyPitch = ly.tools.languageAndKey(document)
   File /home/knut/sources/ly2video-0.4.1/ly/tools.py, line 322, in
 languageAndKey
 for token in tokens:
   File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 693, in
 tokens
 for token in super(LineColumnMixin, self).tokens(text, pos):
   File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 218, in
 tokens
 yield self.Unparsed(text[pos:m.start()], pos)
   File /home/knut/sources/ly2video-0.4.1/ly/tokenize.py, line 296, in
 __new__
 obj = unicode.__new__(cls, value)
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0:
 ordinal not in range(128)

 Any idea what could be broken?

It sounds like your .ly input file is not 8-bit clean - is it
UTF-encoded?  And it seems that ly2video does not support that yet.
Probably you have an accent somewhere in the text; if you could remove
that it will probably work.  It's also worth trying with latest git
version which has many improvements.  If you find the same problem
there too, please file a new issue and I will try to fix.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Knut Petersen

On 06.03.2013 10:44, Adam Spiers wrote:

It sounds like your .ly input file is not 8-bit clean - is it
UTF-encoded?  And it seems that ly2video does not support that yet.
Probably you have an accent somewhere in the text; if you could remove
that it will probably work.  It's also worth trying with latest git
version which has many improvements.  If you find the same problem
there too, please file a new issue and I will try to fix.



Indeed, the problem is that ly2video does not understand utf8 encoded
text. A fresh clone of the code at https://github.com/aspiers/ly2video still has
that problem.

A 2nd issue: title generation does work, but it is broken. Only the last 
characters of the
subsubtitle string are used, title and subtitle strings are completely ignored.

cu,
 knut

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Adam Spiers
On Wed, Mar 6, 2013 at 2:46 PM, Knut Petersen knut_peter...@t-online.de wrote:
 On 06.03.2013 10:44, Adam Spiers wrote:

 It sounds like your .ly input file is not 8-bit clean - is it
 UTF-encoded?  And it seems that ly2video does not support that yet.
 Probably you have an accent somewhere in the text; if you could remove
 that it will probably work.  It's also worth trying with latest git
 version which has many improvements.  If you find the same problem
 there too, please file a new issue and I will try to fix.

 Indeed, the problem is that ly2video does not understand utf8 encoded
 text. A fresh clone of the code at https://github.com/aspiers/ly2video still
 has that problem.

OK, please file an issue (or even better, a pull request).

 A 2nd issue: title generation does work, but it is broken. Only the last
 characters of the
 subsubtitle string are used, title and subtitle strings are completely
 ignored.

Are you referring to https://github.com/aspiers/ly2video/issues/49 ?

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Knut Petersen

On 06.03.2013 15:53, Adam Spiers wrote:

On Wed, Mar 6, 2013 at 2:46 PM, Knut Petersen knut_peter...@t-online.de wrote:

On 06.03.2013 10:44, Adam Spiers wrote:

It sounds like your .ly input file is not 8-bit clean - is it
UTF-encoded?  And it seems that ly2video does not support that yet.
Probably you have an accent somewhere in the text; if you could remove
that it will probably work.  It's also worth trying with latest git
version which has many improvements.  If you find the same problem
there too, please file a new issue and I will try to fix.

Indeed, the problem is that ly2video does not understand utf8 encoded
text. A fresh clone of the code at https://github.com/aspiers/ly2video still
has that problem.

OK, please file an issue (or even better, a pull request).


I´ll have a close look at the code during the next days, then I´ll file an 
issue or send a patch.

A 2nd issue: title generation does work, but it is broken. Only the last
characters of the
subsubtitle string are used, title and subtitle strings are completely
ignored.

Are you referring to https://github.com/aspiers/ly2video/issues/49 ?


My subsubtitle is a youtube address:

 title = This will be ignored
 subtitle = This also will be ignored
 subsubtitle = Quelle: http://www.youtube.com/watch?v=1q2r3s4t5u6;

First of all, title and subtitle are ignored, the subsubtitle string is used.
Probably the issue 49 problem.

Worse: The string is not taken literally but interpreted, so the = has its
special meaning, and only the last part of subsubtitle string (q2r3...) is
used as title.

cu,
 Knut

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-03-06 Thread Adam Spiers
On Wed, Mar 6, 2013 at 6:34 PM, Knut Petersen knut_peter...@t-online.de wrote:
 On 06.03.2013 15:53, Adam Spiers wrote:

 On Wed, Mar 6, 2013 at 2:46 PM, Knut Petersen knut_peter...@t-online.de
 wrote:

 On 06.03.2013 10:44, Adam Spiers wrote:

 It sounds like your .ly input file is not 8-bit clean - is it
 UTF-encoded?  And it seems that ly2video does not support that yet.
 Probably you have an accent somewhere in the text; if you could remove
 that it will probably work.  It's also worth trying with latest git
 version which has many improvements.  If you find the same problem
 there too, please file a new issue and I will try to fix.

 Indeed, the problem is that ly2video does not understand utf8 encoded
 text. A fresh clone of the code at https://github.com/aspiers/ly2video
 still
 has that problem.

 OK, please file an issue (or even better, a pull request).

 I´ll have a close look at the code during the next days, then I´ll file an
 issue or send a patch.

Great, thanks!

 A 2nd issue: title generation does work, but it is broken. Only the last
 characters of the
 subsubtitle string are used, title and subtitle strings are completely
 ignored.

 Are you referring to https://github.com/aspiers/ly2video/issues/49 ?


 My subsubtitle is a youtube address:

  title = This will be ignored
  subtitle = This also will be ignored
  subsubtitle = Quelle: http://www.youtube.com/watch?v=1q2r3s4t5u6;

 First of all, title and subtitle are ignored, the subsubtitle string is
 used.
 Probably the issue 49 problem.

 Worse: The string is not taken literally but interpreted, so the = has its
 special meaning, and only the last part of subsubtitle string (q2r3...) is
 used as title.

Please can you add a test case to the issue, and also mention the =
problem which is almost certainly due to an overly greedy regex.

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-02-08 Thread Martin Tarenskeen



On Fri, 8 Feb 2013, Adam Spiers wrote:


Hi all,

I'm happy to announce the release of ly2video 0.4.1.


Great !


Feedback is very welcome; you can use the issue tracker:

   https://github.com/aspiers/ly2video/issues

or mail me.  Pull requests are of course even more welcome than
feedback!


Remember my problems with --title-at-start ?
I added the --title-at-start issue to the tracker.

No big deal - any video editor can probably create much nicer title 
screens. But the option is there, and thus should work.


--

MT

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-02-08 Thread Adam Spiers
On Fri, Feb 8, 2013 at 8:37 AM, Martin Tarenskeen
m.tarensk...@zonnet.nl wrote:
 On Fri, 8 Feb 2013, Adam Spiers wrote:
 Hi all,

 I'm happy to announce the release of ly2video 0.4.1.

 Great !

 Feedback is very welcome; you can use the issue tracker:

https://github.com/aspiers/ly2video/issues

 or mail me.  Pull requests are of course even more welcome than
 feedback!

 Remember my problems with --title-at-start ?

Yes I did, even though you didn't file an issue at the time ;-)

 I added the --title-at-start issue to the tracker.

 No big deal - any video editor can probably create much nicer title screens.

Agreed, for sure ...

 But the option is there, and thus should work.

I already fixed it prior to this release:

https://github.com/aspiers/ly2video/commit/327558f

I've closed the issues, but please file a new one immediately
if you see any other problems.  Thanks for raising this!

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [ANNOUNCE] ly2video 0.4.1

2013-02-08 Thread Martin Tarenskeen



On Fri, 8 Feb 2013, Adam Spiers wrote:


I already fixed it prior to this release:

   https://github.com/aspiers/ly2video/commit/327558f

I've closed the issues, but please file a new one immediately
if you see any other problems.  Thanks for raising this!


Sorry, I was trying my old copy. The new one works!

--

MT


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


[ANNOUNCE] ly2video 0.4.1

2013-02-07 Thread Adam Spiers
Hi all,

I'm happy to announce the release of ly2video 0.4.1.

ly2video is a Python script which converts music represented by a GNU
LilyPond file into a video containing a horizontally scrolling music
staff which is synchronized with a MIDI-generated audio rendering of
the music.

You can download it from here:

https://github.com/aspiers/ly2video/tags

The most significant aspect of this release is a complete redesign and
rewrite of the A/V synchronization code, which should make it *far*
more robust and easier to maintain:

https://github.com/aspiers/ly2video/commit/c2ab06e

Advantages of the new algorithm include being able to correctly handle
ChordNames, transparent notes, and MIDI filtered through
articulate.ly.

I'm especially grateful to Jan Nieuwenhuizen, who I had the pleasure
of meeting at FOSDEM last weekend, and whose help made this redesign
possible.

This release also fixes numerous other bugs:

https://github.com/aspiers/ly2video/issues?milestone=4state=closed
https://github.com/aspiers/ly2video/issues?milestone=5state=closed

Feedback is very welcome; you can use the issue tracker:

https://github.com/aspiers/ly2video/issues

or mail me.  Pull requests are of course even more welcome than
feedback!

Regards,
Adam

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user