Re: Testers wanted

2021-07-29 Thread Knut Petersen

On 29.07.21 02:41, Michael Hendry wrote:


Hi, Knut.

Now that I’ve settled in to my new iMac (64-bit, X86 processor, Mac OS 11,5.1) 
I’ve got all my usual utilities running in the new environment except lilypond 
and Frescobaldi.

Pre-compiled binaries for this computer aren’t available, so I’ve cloned the 
source code into my ~/git_stuff directory as follows...


checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/Users/michaelhendry/git_stuff/lilypond':
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details
**

Am I naive to think this should “just work”?


Well, to build lilypond  you need a working toolchain, and a working cpp is 
definitely part of that toolchain needs.

Maybe you should have a look at https://gitlab.com/marnen/lilypond-mac-builder 
if you want to build lilypond on your mac

Knut





Re: Centering staves on the page

2021-07-15 Thread Knut Petersen

Hi Mark,

I want to be able to centre staves, which have varying lengths, on the page, as 
if they were centre-justified. Can anyone help me with the code for this?


Put scores into a markup, e.g.

   \version "2.23.4"
   \markup
  \fill-line {
    \center-column {
  \line {\score { \relative { c'4 d e f }}} \vspace #2
  \line {\score { \relative { c'4 d e f f e d c}}} \vspace #2
  \line {\score { \relative { c'2 d }


Knut


Re: Testers wanted

2021-07-14 Thread Knut Petersen

Hi Knute!

(define-public (output-framework basename book scopes fields)
   (let* ((port (%make-void-port "w"))
  (outputter (ly:make-paper-outputter port stencil-dispatch-alist))

Knut

With the above change, Windows LilyPond works fine.  I don't have any
complex source files to try, but I did try it on a Satie piece that's
-- at least -- unusual.


Thanks for testing and the bug report. I uploaded a corrected installer.

Which version of Windows do you use?

Knut



Re: Testers wanted

2021-07-14 Thread Knut Petersen

On 13.07.21 22:54, Knut Petersen wrote:


Hi everybody,

below you find links to four lilypond installers. These installers contain LilyPond version git ee4513cb238cc (2.23.4) plus an additional patch that implements a new backend based on cairo. All installers were built with a modified version of GUB. Cairo 1.16.0 with Pixman 0.40 are used to produce  
the output files.




I fixed the two reported bugs (invalid use of /dev/null on windows, incorrect 
handling of a cid keyed font collection ttc) and built new installers (git 
master 2151499a7ca + cairo backend patch):

Mac OS X 10.4–10.14, Intel x86 CPU, 32 bit 
<https://drive.google.com/file/d/1oZEu-t1eeD1G3YaB4IvADsLlQRZQqPKd/view?usp=sharing>

Windows 2000, XP, Vista, 7, 8, 10 
<https://drive.google.com/file/d/1iOQ-WYwXCfoudfljCx3IQVmjrXInfSBb/view?usp=sharing>

GNU/Linux x86, 32 bit 
<https://drive.google.com/file/d/1geCnIDnC7aqm9YgaqhY5lALIk1lpJ3uK/view?usp=sharing>

GNU/Linux 64, 64 bit 
<https://drive.google.com/file/d/1PbS5Ki_SIHSqPvNPjGT9D6KZERFOULC0/view?usp=sharing>


I tested the Linux installers, but I own neither a Windows nor a Mac OS X 
system. It would be nice if some people could test the installers and the 
lilypond system they provide. I'm especially interested in answers to the 
following questions:

  * Does installation work on your system?
  * Does the cairo backend produce valid output?
  * Is font handling ok? Also for asian fonts?
  * Don't forget to include a short description of your system in 
success/failure/error reports


*How to test:*

Select the desired output formats by any combination of the '--pdf', '--ps', 
'--png' and '--svg' command line options and add -dbackend=cairo'. The '--svg' 
option must precede  the '-dbackend=cairo' option.

If the cairo backend is selected lilypond produces output files with cairo.ps, 
cairo.pdf, cairo.png and cairo.svg extensions.


*Features:*

  * Faster than all other backends (at least on linux systems)
  * Files that fail with the svg backend produce valid svg output with the 
cairo backend.
  * You can produce all output files in one run of lilypond


*Known problems / limitations:*

  * The cairo backend is _experimental_ code.
  * Only setting of standard PDF metadata tags is supported ('Author', 'Title', 
'Subject', 'Keywords' and 'Creator'). 'Creation Time' and 'PDF Producer' are 
set automatically.
  * A lot of seldom used pdf features are not supported (e.g. embedding the 
lilypond source file into the pdf document). There is also no support for 
cropping, clipping, and all features that depend on ghostscripts extensions of 
the postscript language (gs-nevern-embed-fonts, music-font-encodings,
etc ...)
  * Internal page hyperlinks: If page is a forward reference (a link to a page 
that has not been generated yet) cairo silently fails to generate correct 
hyperlink. As this behaviour is not documented I tend to believe that it is a 
cairo 1.16 bug, but I have to verify that assumption.
  * SVG files produced by the cairo backend are bigger than SVG files produced 
by the svg backend.
  * PNG: -dresolution=dpi works, but I do not care about other parameters for 
now. A rgba with transparent background and 8 bits per channel is generated.

Knut







Re: Testers wanted

2021-07-14 Thread Knut Petersen



(x86)/LilyPond-2.23.4/usr/share/lilypond/current/scm/lily/framework-cairo.scm:262:16:
No such file or directory: "/dev/null"



Background: ly:make-paper-outputter assumes that every backend will
need an output file,  I thought choosing /dev/null would be ok as
(most of) the output files are  created, written and closed directly
by the cairo library.

At least the calling convention appears only to assume that every
backend will need an output _port_.  %make-void-port may fit the bill
though I haven't checked.


Yes, thanks, it does fill the need, at least on linux-64. Line 262 of framework-cairo.ps 
should be changed to (let* ((port (%make-void-port "w")).

New version in context of lines 261..263:

   (define-public (output-framework basename book scopes fields)
  (let* ((port (%make-void-port "w"))
 (outputter (ly:make-paper-outputter port stencil-dispatch-alist))

Knut




Re: Testers wanted

2021-07-14 Thread Knut Petersen

On 14.07.21 16:09, Knute Snortum wrote:

I had problems with a basic ly file.  It looks like the program is
trying to open /dev/null and that doesn't work on a windows machine.


lilypond --pdf -dbackend=cairo bach_first_lesson_minuet.ly

GNU LilyPond 2.23.4
Processing `bach_first_lesson_minuet.ly'
Parsing...
Interpreting music...[8][16][24][32][40]
Preprocessing graphical objects...
Interpreting music...
MIDI output to `bach_first_lesson_minuet.mid'...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...C:/Program Files
(x86)/LilyPond-2.23.4/usr/share/lilypond/current/scm/lily/framework-cairo.scm:262:16:
In procedure open-file in expression (open-file "/dev/null" "w"):
C:/Program Files
(x86)/LilyPond-2.23.4/usr/share/lilypond/current/scm/lily/framework-cairo.scm:262:16:
No such file or directory: "/dev/null"


Please change "/dev/null" in line 262 of  C:/Program 
Files(x86)/LilyPond-2.23.4/usr/share/lilypond/current/scm/lily/framework-cairo.scm to the 
equivalent of /dev/null on windows. What name is used for the NullDevice in the supported 
Windows versions? \Devices\Null? Null?

Background: ly:make-paper-outputter assumes that every backend will need an 
output file,  I thought choosing /dev/null would be ok as (most of) the output 
files are  created, written and closed directly by the cairo library.


Also, just a note, my windows system tried everything it could not to
let me download and run the LilyPond file.  Google Drive, Google
Chrome, Windows, and Norton all tried to stop the process.


The glory of a hero rises with the strength of his enemies ;-))

Knut



Re: Testers wanted

2021-07-14 Thread Knut Petersen

Hi Harm,

I'm on Ubuntu 64-bit 20.04 and used your lilypond-2.23.4-1.linux-64.sh
with the attached file.
I got:
$ lilypond -dbackend=cairo filename_名字♯.ly
GNU LilyPond 2.23.4
Processing `filename_名字♯.ly'
Parsing...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Generating filename_名字♯.cairo.pdf ...lilypond:
/home/gub/gub/target/linux-64/src/lilypond-localhost--lilypond.git-tmp-gubllt-test/lily/lily-guile.cc:126:
std::string ly_scm2string(SCM): Assertion `scm_is_string (str)'
failed.
Aborted (core dumped)

Does the file hit some of the mentioned limitations?

Surprisingly an empty pdf "filename_名字♯.cairo.pdf" is generated.

Please retest with

bin/lilypond -l DEBUG -dbackend=cairo filename_名字♯.ly  &> trace

and send the trace file.

Unfortunately your file compiles fine on my system:

   Musik wird auf eine Seite angepasst...
   Systeme erstellen...
   set-paper-width:  595.275591
   set-paper-height: 841.889764
   set-lily-output-units:    2.834646, sf: 0.00
   set-output-scale: 1.757299 sf: 4.981320
   Generating filename_名字♯.cairo.pdf ...
   cairo-use-font: name: C059-Roman, file: 
/home/lilytest/lilypond/usr/share/lilypond/current/fonts/otf/C059-Roman.otf, 
index: 0
  inserted font C059-Roman loaded from 
/home/lilytest/lilypond/usr/share/lilypond/current/fonts/otf/C059-Roman.otf in 
fontmap
   cairo-use-font: name: Sazanami-Mincho-Regular, file: 
/usr/share/fonts/truetype/sazanami-mincho.ttf, index: 0
  inserted font Sazanami-Mincho-Regular loaded from 
/usr/share/fonts/truetype/sazanami-mincho.ttf in fontmap
   cairo-use-font: name: DejaVuSerif, file: 
/usr/share/fonts/truetype/DejaVuSerif.ttf, index: 0
  inserted font DejaVuSerif loaded from 
/usr/share/fonts/truetype/DejaVuSerif.ttf in fontmap
   moveto x: 5.690551 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 40
   moveto x: 45.760214 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 2
   moveto x: 47.760090 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 5
   moveto x: 56.759343 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 15
   moveto x: 89.863772 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 2
   moveto x: 89.249192 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 1
   moveto x: 88.190750 y: -5.689014
   print_glyphs font: DejaVuSerif, size: 3.865234375000, glyph count: 1
   moveto x: 83.820406 y: -5.689014
   print_glyphs font: Sazanami-Mincho-Regular, size: 3.865234375000, glyph 
count: 2
   moveto x: 74.021277 y: -5.689014
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 8
   moveto x: 31.684989 y: -165.117033
   url-link rect=[ 157.832031 824.881102 279.609449 -10.544882 ] 
uri='https://lilypond.org/'
   moveto x: 31.684989 y: -165.117033
   print_glyphs font: C059-Roman, size: 3.865234375000, glyph count: 51
   showpage
   CAIRO: Finished Pdf, cairo surface and context destroyed.
   Paper_outputter elapsed time: 0.00 seconds]gc time taken: 0.08

If possible send also the fonts used on your system.

Knut


Re: Testers wanted

2021-07-14 Thread Knut Petersen

Hi Harm,

If possible send also the fonts used on your system.

Do you mean the output of
$ lilypond -dshow-available-fonts &> fonts
?


Of course not ;-)

Ok. Compile the test file without the cairo backend :

   LANG=c bin/lilypond  -l DEBUG filename_名字♯.ly &> nocairotrace

In nocairotrace you see the fonts that were used, e.g.:

   [...]
   Drawing systems...
   Initializing embedded CFF font list.
   Embedding CFF font `C059-Roman'.
   [/home/lilytest/lilypond/usr/share/lilypond/current/fonts/otf/C059-Roman.otf]
   [/usr/share/fonts/truetype/DejaVuSerif.ttf]
   [/usr/share/fonts/truetype/sazanami-mincho.ttf]
   
[/home/lilytest/lilypond/usr/share/lilypond/current/ps/music-drawing-routines.ps]
   [/home/lilytest/lilypond/usr/share/lilypond/current/ps/lilyponddefs.ps]
   Paper_outputter elapsed time: 1.09 seconds
   Converting to `filename_名字♯.pdf'...
   [...]

The font files that were not supplied by the lilypond installer are those of 
interest (here: DejaVuSerif.ttf and sazanami-mincho.ttf).

After that compile with the cairo backend:

   LANG=c bin/lilypond  -l DEBUG -dbackend=cairo filename_名字♯.ly &> cairotrace

and send the fonts identified in the first rund and cairotrace from the second 
run.

Knut



Re: Testers wanted

2021-07-14 Thread Knut Petersen

Hi Michael,



Mac OS X 10.4–10.14, Intel x86 CPU, 32 bit



I’m currently using a late-2012 27” iMac with macOS Catalina 10.15.7, but this 
can’t be upgraded to macOS Big Sur, and a recent whiff of overheated 
circuit-board when I leant over the back of my monitor prompted me to order a 
replacement which is due to arrive today.

I want to make an orderly transition of all my applications and data to the new 
computer, but would be happy to try a quick installation of lilypond on a 
virgin machine running MacOS 11 if that would help you.



Only installers for the x86 32-bit MacOS versions 10.4 to 10.14 are produced 
using GUB. Users of those versions of MacOS can help with a test.

It's clear that MacOS 11 is not within that range. Neither MacOS "Catalina" nor "Big 
Sur" are supported by the linked installation archive.

Knut




Testers wanted

2021-07-13 Thread Knut Petersen

Hi everybody,

below you find links to four lilypond installers. These installers contain LilyPond version git ee4513cb238cc (2.23.4) plus an additional patch that implements a new backend based on cairo. All installers were built with a modified version of GUB. Cairo 1.16.0 with Pixman 0.40 are used to produce  
the output files.


Mac OS X 10.4–10.14, Intel x86 CPU, 32 bit 


Windows 2000, XP, Vista, 7, 8, 10 


GNU/Linux x86, 32 bit 


GNU/Linux 64, 64 bit 


I tested the Linux installers, but I own neither a Windows nor a Mac OS X 
system. It would be nice if some people could test the installers and the 
lilypond system they provide. I'm especially interested in answers to the 
following questions:

 * Does installation work on your system?
 * Does the cairo backend produce valid output?
 * Is font handling ok? Also for asian fonts?
 * Don't forget to include a short description of your system in 
success/failure/error reports


*How to test:*

Select the desired output formats by any combination of the '--pdf', '--ps', 
'--png' and '--svg' command line options and add -dbackend=cairo'. The '--svg' 
option must precede  the '-dbackend=cairo' option.

If the cairo backend is selected lilypond produces output files with cairo.ps, 
cairo.pdf, cairo.png and cairo.svg extensions.


*Features:*

 * Faster than all other backends (at least on linux systems)
 * Files that fail with the svg backend produce valid svg output with the cairo 
backend.
 * You can produce all output files in one run of lilypond


*Known problems / limitations:*

 * The cairo backend is _experimental_ code.
 * Only setting of standard PDF metadata tags is supported ('Author', 'Title', 
'Subject', 'Keywords' and 'Creator'). 'Creation Time' and 'PDF Producer' are 
set automatically.
 * A lot of seldom used pdf features are not supported (e.g. embedding the 
lilypond source file into the pdf document). There is also no support for 
cropping, clipping, and all features that depend on ghostscripts extensions of 
the postscript language (gs-nevern-embed-fonts, music-font-encodings,
   etc ...)
 * Internal page hyperlinks: If page is a forward reference (a link to a page 
that has not been generated yet) cairo silently fails to generate correct 
hyperlink. As this behaviour is not documented I tend to believe that it is a 
cairo 1.16 bug, but I have to verify that assumption.
 * SVG files produced by the cairo backend are bigger than SVG files produced 
by the svg backend.
 * PNG: -dresolution=dpi works, but I do not care about other parameters for 
now. A rgba with transparent background and 8 bits per channel is generated.

Knut





Re: slurs and ties to end of bar

2019-07-25 Thread Knut Petersen

Hi Werner!

Attached is a lilypond source that shows how to  use postscript
to crop parts from a lilypond page.

Obviously you still need to find a way to pass the right corner
coordinates to the postscript code ...

Knut
\version "2.21.0"

\pointAndClickOff

#(set-global-staff-size 18)
#(set-default-paper-size "a4")

\book {
  \header {
title = \markup {
  \postscript " 
grestore
/myclipbox{
  newpath
50 -5 moveto 
50 0 rlineto
0 -50 rlineto
-50 0 rlineto
  closepath
  gsave 1 0 0 setrgbcolor stroke grestore
  clip
} def
0 setlinewidth myclipbox
gsave
"
  "Postscript Clipping Example"
  }
tagline = ##f
  }
  
  \relative c' { \repeat unfold 100 { c4 d e f } }
  \addlyrics { \lyricmode { \repeat unfold 100 { foo -- bar A B  } } }
}

#(system "gs -dBATCH -dNOPAUSE -r900 -sDEVICE=png16 -sOutputFile=testclip.png testclip.pdf")
#(system "LD_LIBRARY_PATH= convert testclip.png -trim -shave 4x4 testclip-clipped.pgm")
#(system "LD_LIBRARY_PATH= potrace -b pdf -r 900 testclip-clipped.pgm")
#(system "LD_LIBRARY_PATH= rm testclip.png testclip-clipped.pgm")
#(system "LD_LIBRARY_PATH= okular testclip-clipped.pdf")
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: LilyPond 2.20 or 2.21 on Ubuntu 18.04

2019-07-18 Thread Knut Petersen

On 18.07.19 14:37, Ralph Palmer wrote:

Has any progress been made in making a process available to install LilyPond 2.20 or 2.21 on Ubuntu 18.04? Back in March of this year (2019), there was a brief discussion about installing Guile 1.8 on Ubuntu 18.04, so that ly 2.20 could run. I tried to follow the suggestions, but was unsuccessful. 
If someone would be willing to work with me, perhaps off-list, and we were successful, maybe we could post a working process to enable others to install and use ly 2.20.


Build guile 1.8 yourself, then lilypond. You even could use gub:

   git clone https://github.com/gperciva/gub.git
   cd gub
   touch regtests/ignore
   make lilypond

will take some time but builds a full lilypond distribution if some basic 
development tools and texlive are installed. I don't remember exactly which 
packages are required, but I wrote about that some months ago in 
lilypond-devel. Have a look at the archives.

Knut


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


Re: Please test new lilypond installers

2019-02-04 Thread Knut Petersen

On 05.02.19 00:36, Karlin High wrote:

On 1/29/2019 3:19 AM, Knut Petersen wrote:

lilypond-2.21.0-1.freebsd-x86.sh

Intel Core i5-3450 3.10 GHz
Windows 7 Pro 64-bit SP1
VirtualBox 5.2.22r126460
VM with 2 cores and 4 GB RAM

$ uname -a
FreeBSD freebsd32-vbox 12.0-RELEASE FreeBSD 12.0-RELEASE r341666 GENERIC  i386

# pkg install compat6x-i386

And it seems to work. A simple C-Major scale compiled just fine.

Ok.


It does look like there would be some further issues to resolve,
dependencies perhaps. I was going to give it a good test by compiling
the Heinrich Schütz "Schwanengesang" Psalm 119 that Brent Annable had
posted back in May 2018 - makes 194 pages. LilyPond parsed and
interpreted music and preprocessed graphical objects, then said "fatal
error: cannot allocate 70423 bytes."


Hmm ... 32bit ... 194 pages ... it could be that job really consumed all usable 
memory ;-)


I tried convert-ly, it gave a Python error that ended with "Undefined
symbol "PyString_Type"

Executing lilypond/usr/bin/python said: ld-elf.so.1: Shared object
"libstdc++.so.6" not found, required by "python"


Direct execution of binaries in lilypond/usr/bin is not expected to  work, they 
need some help ... see ~/bin/lilypond-wrapper.python.



That's about as far as I want to go here; the test was mainly just for
the installer.


Thanks for your help.

Knut


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


Re: Please test new lilypond installers

2019-02-03 Thread Knut Petersen

Hi Karlin!


Maybe, installing compat6x package is required.

# pkg install compat6x-amd64

...and it did indeed fix the issue. LilyPond seems fully functional.

Next, I want to make a FreeBSD 32-bit VM, and see about reviving an
iMac G5 to test the PowerPC installers. Although I doubt there's a
very big user base for those.


Thanks for your help!

Yes, some of the installers target somewhat aged platforms ... but as long as 
the installers are functional and don't cause too much work to maintain there's 
no reason  not to keep them around.

Knut


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


Re: Please test new lilypond installers

2019-01-30 Thread Knut Petersen

Hi everybody!

Thanks for testing the installers. Below I try to summarize your results:

*lilypond-2.21.0-1.linux-64.sh*

   OK:

 * Ubuntu 18.04.1 LTS (bionic), running under Windows Subsystem for Linux  
Windows 10 Version 1803 (OS Build 17134.523) [Aaron Hill]
 * [Johan Vromans]
 * Debian 9 stretch [David Wright]
 * Ubuntu 18.04.1 LTS [Paul Morris]

***lilypond-2.21.0-1.linux-x86.sh *

   OK:

 * Debian 9 stretch [David Wright]

*lilypond-2.21.0-1.mingw.exe*

   OK:

 * Windows 10 Pro 64-bit version 1803. [Karlin High]
 * Windows 10 Home on Intel Core i7-7500U cpu [Trevor Daniels]
 * Windows 10 Home 1809, installation proceeds without problems. [Matthias 
Böhringer]
 * Windows 10 Version 1803. [Michael Käppler]

* lilypond-2.21.0-1.darwin-x86.tar.bz2 *

   OK:

 * Works on MacBook Air (mid 2012) with Intel Core i5 and macOS Mojave 
10.14.2 [Karlin High]
 * iMac with High Sierra (installer worked ok but Michael reports a problem 
with lilypond not finding the external lilyjazz font) [Michael Hendry]

*No test reports for*

 * lilypond-2.21.0-1.darwin-ppc.tar.bz2
 * lilypond-2.21.0-1.linux-ppc.sh
 * lilypond-2.21.0-1.freebsd-64.sh
 * lilypond-2.21.0-1.freebsd-x86.sh

Knut


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


Please test new lilypond installers

2019-01-29 Thread Knut Petersen

Hi everybody

Urs Liska provides installers for branch master of lilypond, generated by an 
updated version of our build system GUB:

   https://cloud.ursliska.de/s/QPINwLqJNeVslCu

There you'll find

   lilypond-2.21.0-1.darwin-ppc.tar.bz2
   lilypond-2.21.0-1.darwin-x86.tar.bz2
   lilypond-2.21.0-1.freebsd-64.sh
   lilypond-2.21.0-1.freebsd-x86.sh
   lilypond-2.21.0-1.linux-64.sh
   lilypond-2.21.0-1.linux-ppc.sh
   lilypond-2.21.0-1.linux-x86.sh
   lilypond-2.21.0-1.mingw.exe
   lilypond-2.21.0.tar.gz

Please test if those files provide valid lilypond installations and report 
success / failure by replying to this thread if no identical test results 
already have been posted.

Knut

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


Re: Compiling LilyPond on Linux Mint 19.1

2018-12-21 Thread Knut Petersen

On 20.12.18 12:21, Lukas-Fabian Moser wrote:

Folks,

this is mostly to give a reference to those who might hit the same problems 
that I had:

I decided to switch from my ancient Linux Mint 17.3 to Linux Mint 19.1 
yesterday. In order to set up a working build environment, I had to provide a 
working Guile 1.8 which seems not to be in the repositories any more.


Have a look at the build script attached to 
https://lists.gnu.org/archive/html/bug-lilypond/2017-08/msg00038.html

Knut



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


Re: Lilypond fails after system upgrade.

2018-07-15 Thread Knut Petersen

Am 16.07.2018 um 02:37 schrieb Peter Terpstra:

Upgraded my the pc to opensuse leap 15.

On many documents (not all) i get now this error:
warning:
`(gs -q -dSAFER -dDEVICEWIDTHPOINTS=612.00 -dDEVICEHEIGHTPOINTS=792.00 
-dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite 
-sOutputFile=./Etude-nr.8.pdf -c.setpdfwrite -fEtude-nr.8.ps)'
failed (256)


Which version of lilypond and ghostscript?

   lilypond --version
   gs --version


Execute

   lilypond --ps --pdf Etude-nr.8.ly
   gs -q -dSAFER -dDEVICEWIDTHPOINTS=612.00 -dDEVICEHEIGHTPOINTS=792.00 
-dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -r1200 -sDEVICE=pdfwrite 
-sOutputFile=./Etude-nr.8.pdf -c.setpdfwrite -fEtude-nr.8.ps

to get the error messages from ghostscript.

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


Re: Interactive PDF Link to Notes in Preview

2018-07-04 Thread Knut Petersen

Am 03.07.2018 um 18:47 schrieb Zone Dremik:

Hello,
After a recent upgrade to my computer, the function that links music notes (and 
lyrics) in the PDF viewer, to the text in the Lilypond files, has stopped 
working.

The ability to click on notes and lyrics in the preview screen, and have the 
exact point highlighted in the corresponding Lilypond file was so enormously 
useful, that the loss of this function has become a great barrier to efficient 
use of the program.

I am using Lilypond Version 2.18.2-1
Apple Macintosh System 10.11.6
Apple Preview Version 8.1 (877.7)


Nothing has changed in lilypond 2.18.2-1, you have to configure your system to 
handle the textedit links lilypond inserts in the pdf.

Be aware of the fact that lilypond-invoke-editor, the script that handles 
textedit links in lilypond, is insecure.
The problem has been fixed in recent versions of lilypond.

Knut


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


Re: Different time signature on different staff

2018-04-16 Thread Knut Petersen

Hi Ming!


Question: how to align bar lines for the above lilybin sample.


Well, as long as your MelodyA starts with \partial 8 \time 6/8
and your MelodyB starts with \partial 4 \time 4/4, bars will
never happen at the same moment in time and thus bars
will not be aligined ...

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


Re: Different time signature on different staff

2018-04-16 Thread Knut Petersen

Hi Ming!

My code did not produce the expecting of time 6/8 on the first staff.

What shall I code to correct this.


After reading the manual location pointed out by Brian you might have a look
at my edition of Hugo Distles polymetric "Er ist's". PDF 
 and source 
code 


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


Re: bookparts

2018-03-05 Thread Knut Petersen

Hi Joram et al!

*What I want to achieve* is to have ~10 independent pieces and
concatenate all of them into one book as well as printing everyone on
its own. The separate pieces should have taglines etc. on the first/last
page as usual. But the book should not repeat them for every piece. Each
piece should start a new page in the book. I dreamed of just including
all the scores into one document. But the output is terrible (errors as
the ones above etc.).



I think the attached file gives some useful examples.

Knut
\version "2.21.0"
\include "deutsch.ly"
\pointAndClickOff

%
% Define all the music first
%

musicA  = {
  \time 4/4 \key c \major
  \repeat unfold 20 {
\relative c' { c4 d e f g a h c c h a g f e d g c1 }
  } \bar "|."
}

musicB = { \transpose c cis { \musicA } }

musicC = { \transpose c d   { \musicA } }

musicD = { \transpose c es  { \musicA } }

musicE = { \transpose c f   { \musicA } }

%
% Global paper definitions
%

\paper {
#(set-paper-size "a4")
top-margin = 20\mm
bottom-margin = 20\mm
line-width = 170\mm
left-margin = 20\mm
ragged-bottom = ##f
ragged-last-bottom = ##t
print-page-number = ##t
page-breaking = #ly:optimal-breaking
}

#(set-global-staff-size 18)

%
% The collection including title page ...
%

\book{
  \bookOutputSuffix "Collection"
  \bookpart {
\markup { 
  \column {
\vspace #5.0 \fill-line { \fontsize #18  "Titelpage" }
\vspace #3.0 \fill-line { \fontsize #4.0 "This is an example." }
  }
}
  }
  \bookpart {
\paper  { print-page-number = ##f }
\markup { \column { \vspace #5.0 \fill-line { \fontsize #4.0 "Page 2: empty, without pagenumber!" } } }
  }
  \bookpart {
 \paper  { system-count = #12 }
 \header { title = "Title A" subtitle = "Subtitle A"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicA } \layout { indent = 0.0 } }
   }
  \bookpart {
 \paper  { system-count = #14 }
 \header { title = "Title B" subtitle = "Subtitle B"  composer = "Fred Mbogo"  }
 \score  { \new Staff { \musicB } \layout { indent = 5.0 } }
   }
  \bookpart {
 \paper  { system-count = #16 }
 \header { title = "Title C" subtitle = "Subtitle C"  composer = "Fred Feuerstein"  }
 \score  { \new Staff { \musicC } \layout { indent = 10.0 } }
   }
  \bookpart {
 \paper  { system-count = #18 }
 \header { title = "Title D" subtitle = "Subtitle D"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicD } \layout { indent = 15.0 } }
   }
  \bookpart {
 \paper  { system-count = #20 }
 \header { title = "Title E" subtitle = "Subtitle E"  composer = "Fred Foobar"  }
 \score  { \new Staff { \musicE } \layout { indent = 20.0 } }
   }
  \bookpart {
\paper  { print-page-number = ##f }
\include "otherfile.ly"
\markup { \column { \vspace #5.0 \fill-line { \fontsize #4.0 "Last page" } } }
  }
}

%
% Use scheme if you want to do some postprocessing 
%

#(system "pdfbook --short-edge --landscape  --suffix 'sig4' --quiet --pdftitle 'Collection' \
  --pdfauthor 'Fred Foobar'  --pdfsubject 'My famous collection' \
  --pdfkeywords 'Collection, Fred Foobar' 4Joram-Collection.pdf")

%
% Now produce ndividual pdfs
%

\book {
   \bookOutputSuffix "Piece-A"
   \paper  { system-count = #12 }
   \header { title = "Title A" subtitle = "Subtitle A"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicA } \layout { indent = 0.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-B"
   \paper  { system-count = #14 }
   \header { title = "Title B" subtitle = "Subtitle B"  composer = "Fred Mbogo"  }
   \score  { \new Staff { \musicB } \layout { indent = 5.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-C"
   \paper  { system-count = #16 }
   \header { title = "Title C" subtitle = "Subtitle C"  composer = "Fred Feuerstein"  }
   \score  { \new Staff { \musicC } \layout { indent = 10.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-D"
   \paper  { system-count = #18 }
   \header { title = "Title D" subtitle = "Subtitle D"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicD } \layout { indent = 15.0 } }
}
 
\book {
   \bookOutputSuffix "Piece-E"
   \paper  { system-count = #20 }
   \header { title = "Title E" subtitle = "Subtitle E"  composer = "Fred Foobar"  }
   \score  { \new Staff { \musicE } \layout { indent = 20.0 } }
}
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: bookparts

2018-03-05 Thread Knut Petersen

Hi Kieren!


%%%  tempTest.ly

\version "2.19"
testing = { c''4 4 4 4 }


%%%  file2.ly

\version "2.19"
\bookpart {
  \include "tempTest.ly"
  \score { \testing }
}

throws several errors.

Because the definition of testing is invalid at that point of the main
source file. If tempTest.ly would contain e.g. a score or a \paper block
no error would occur.

Knut

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


Re: "\includepdf" in LilyPond

2017-12-18 Thread Knut Petersen

Am 18.12.2017 um 21:50 schrieb k...@aspodata.se:

Urs:
...

OTOH: is it possible to have LilyPond trigger an external program
*after* the PDF has been created? I recall getting an answer for a hook
that works at the very end of the engraving process (this should allow
me to write out data into a log file that has only been generated during
the after-line-breaking stage). Is there such a hook to execute after
the PDF has been written?

Something like this should be possible:

$ PATH=~/your_wrappers:$PATH
$ cat ~/your_wrappers/lilypond
#!/bin/sh

/usr/bin/lilypond "$@"
echo Finished, do something
$ lilypond xxx
...
Finished, do something
$

Or use a Makefile, you can look at my workflow if you like:
  http://aspodata.se/git/musik/bin/
  http://aspodata.se/git/musik/include/


Much simpler . Put

   #(system "program parameters ...") 


after a book, at the very end of the file or wherever you want to execute an 
external program.

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


Re: lilypond code in (pdf/lua/xe)latex documents

2017-12-08 Thread Knut Petersen

Am 06.12.2017 um 20:40 schrieb Jacques Peron:

Here is a modified version, that calls `lilypond` only when needed by computing 
a md5 hash of the content.


A good idea.


What about making a package out of that and putting it on CTAN ? It would be 
more universal than lyluatex, so I think many could be interrested. And why not 
put it on a public repository, to have bug reports and feature requests ?


Well, I think lilypond-user is a good place to publish code related to a lilypond/latex interface. Yes, it would be possible to make a latex .sty file and publish it on CTAN - but there are projects that are more important to me right now. Before I'd think of putting a style based on this code on 
CTAN, at least the following problems should be solved:


 * Extended error handling is necessary.
 * A check if write18 really is available should be implemented.
 * A check for supported ghostscript / lilypond versions should be implemented.
 * We must adapt command lines to the ghostscript / lilypond versions found.
 * Support also win/mac platforms.
 * Support of pure latex.
 * Optionally synchronize global-staff-size to the design size of the latex 
document class.
 * Some code to optionally synchronize fonts and fontsizes used by latex and 
lilypond would be nice.
 * It should be possible to automatically deleted temporary files.
 * Everything should be properly documented.
 * ...

Nothing of that is complicated, but it takes some time.

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


Re: lilypond code in (pdf/lua/xe)latex documents

2017-12-06 Thread Knut Petersen

Am 06.12.2017 um 10:20 schrieb Mark Knoop:

The file should be translated with either

  * pdflatex --shell-escape lyInLatex
  * lualatex --shell-escape lyInLatex
  * pdflatex --shell-escape lyInLatex

Thanks for this Knut, very helpful. Presumably the 3rd of these should
be xelatex.


Yes.

Interestingly, only pdflatex produces all four bars/systems of
fragment 1. When run with lualatex and xelatex only the first system
is shown. Any idea why this might be?

Apologies - I was missing a hyphen in the commandline - all produce correct 
results.

;-)

Knut

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


lilypond code in (pdf/lua/xe)latex documents

2017-12-06 Thread Knut Petersen

Hi everybody!

Some years ago I published example code how to integrate lilypond code in latex 
documents.
The attached file is an extended update, it might be used with pdflatex, 
lualatex or xelatex, and
it demonstrates how to use the new command line options that replaced --bigpdf 
in master.

The file should be translated with either

 * pdflatex --shell-escape lyInLatex
 * lualatex --shell-escape lyInLatex
 * pdflatex --shell-escape lyInLatex


After that run ghostscript to generate the final document that contains an 
optimized set of subsetted
fonts:

   gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=lyInLatex-final.pdf 
lyInLatex.pdf

Some documentation is included.

Knut

\NeedsTeXFormat{LaTeX2e}
\documentclass[10pt]{letter}
%
% It is assumed that lilypond 2.21 and a recent TeX distribution is used, e.g. TeX-Live 2017.
%
% Compile with with either
%
%pdflatex --shell-escape sourcefile.ly
%xelatex  --shell-escape sourcefile.ly
%lualatex --shell-escape sourcefile.ly
%
% Then run ghostscript:
%
%gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=final.pdf sourcefile.pdf
%
\usepackage{geometry}
\geometry{a4paper,noheadfoot,nomarginpar,left=3.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm}

\usepackage[english,german]{babel}

\usepackage{ifluatex,ifxetex,ifpdf}
\def\isLuaTeX{\ifluatex 1\else 0\fi}
\def\isXeTeX{\ifxetex 1\else 0\fi}
\def\nocont{}
\if\isLuaTeX\isXeTeX
\ifpdf
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else
\def\nocont{
   \typeout{***}
   \typeout{* Use either pdflatex, lualatex or xelatex}
   \typeout{* to compile this file!}
   \typeout{***}
   \stop
}
\fi
\else
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{cmunrm.otf}[BoldFont=cmunbx.otf,ItalicFont=cmunti.otf,BoldItalicFont=cmunbi.otf]
\setsansfont{cmunss.otf}[BoldFont=cmunsx.otf,ItalicFont=cmunsi.otf,BoldItalicFont=cmunso.otf]
\setmonofont{cmuntt.otf}[BoldFont=cmuntb.otf,ItalicFont=cmunst.otf,BoldItalicFont=cmuntx.otf]
\fi
\nocont

\usepackage{graphicx}
\usepackage{shellesc}

\def\tmpNamePrefix{\jobname .tly}
\def\tmpFragPrefix{\tmpNamePrefix -frag}
\def\tmpNameFull{\tmpNamePrefix .ly}
\def\tmpNameHead{\tmpNamePrefix -head.ly}
\def\tmpNamePaper{\tmpNamePrefix -paper.ly}
\def\tmpNamePdf{\tmpNamePrefix .pdf }
\def\tmpNameTail{\tmpNamePrefix -tail.ly}

\def\lilycommand{lilypond -E --pdf -O TeX-GS -daux-files=\#t -dgs-load-fonts=\#t }

\def\lilyversion{2.21.0} 
\def\intersystemcommand{\vskip\parskip}

\newwrite\tmpFileMain\newwrite\tmpFileHead\newwrite\tmpFileTail
\newwrite\tmpFilePaper   \newread\fragcountfile   \newcount\fragcount
\newcount\fragpagecount  \newcount\fragpagenum

{
  \catcode`|=0 \catcode`[=1 \catcode`]=2 \catcode`\#=12
  \catcode`\{=12 \catcode`\}=12 \catcode`\\=12
  |gdef|eohead[\end{lilyhead}]
  |gdef|eofrag[\end{lilyfrag}]
  |gdef|eotail[\end{lilytail}]
  |gdef|hashtag[#]
  |gdef|escape[\]
  |gdef|definepaper[\definepaper]
]

{
  \obeylines
  \gdef\doline#1
  {
\def\oneline{#1}
\ifx\oneline\eohead\def\next{\end{lilyhead}}\else
\ifx\oneline\eofrag\def\next{\end{lilyfrag}}\else
\ifx\oneline\eotail\def\next{\end{lilytail}}\else 
\ifx\oneline\definepaper\immediate\write\tmpFile{\escape include "\tmpNamePaper"}\let\next\doline
\else\immediate\write\tmpFile{\unexpanded\expandafter{\oneline}}\let\next\doline
\fi\fi\fi\fi\next%
  }
}

\makeatletter

\newenvironment{lilyfrag}[2]{
  \global\advance\fragcount by 1
  \immediate\openout\tmpFileMain=\tmpNameFull
  \gdef\tmpFile{\tmpFileMain}
  \immediate\write\tmpFileMain{\escape version "\lilyversion"}
  \immediate\write\tmpFileMain{\escape include "\tmpNameHead"}
  \immediate\openout\tmpFilePaper=\tmpNamePaper
  \immediate\write\tmpFilePaper{\hashtag(set!
 paper-alist (cons '("mySize" . (cons (* #1) (* #2))) paper-alist))}
  \immediate\closeout\tmpFilePaper
  \let\do=\@makeother\dospecials\obeylines\doline
}{
  \immediate\write\tmpFileMain{\escape include "\tmpNameTail"}
  \immediate\closeout\tmpFileMain
  \immediate\write18{\lilycommand \tmpNameFull}
  \openin\fragcountfile=\tmpNamePrefix-systems.count
  \read\fragcountfile to \fragpagecount
  \closein\fragcountfile
  \fragpagenum=1
  \begin{center}
  \loop
\immediate\write18{mv \tmpNamePrefix-\the\fragpagenum.pdf \tmpFragPrefix\the\fragcount-\the\fragpagenum.pdf}
\IfFileExists{./\tmpFragPrefix\the\fragcount-\the\fragpagenum.pdf}{}{
   \def\nocont{
  \typeout{*}
  \typeout{* Something went wrong. Probably lilypond failed}
  \typeout{* or you tried to compile this file without the}
  \typeout{* --shell-escape command line parameter!}
  \typeout{*}
  \stop
   }
}
\nocont

Re: Security problem: lilypond-invoke-editor

2017-11-23 Thread Knut Petersen

Am 23.11.2017 um 17:53 schrieb Stanton Sanderson:

Is this Windows-specific or is there a potential threat for other platforms?



It definitely affects linux systems.

I suspect that also Windows/Mac systems are affected, but I cannot verify that.

Knut

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


Re: Security problem: lilypond-invoke-editor

2017-11-23 Thread Knut Petersen

Am 23.11.2017 um 10:23 schrieb David Kastrup:

Stupid question: what does run-editor do to be inherently safer than
run-browser, and what would prevent run-browser from doing the same?


Your suspicion is correct. Also textedit URIs are vulnerable to a very similar 
attack.

So EVERYBODY should completely disable (delete/rename) lilypond-invoke-editor 
for now.

Knut


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


Security problem: lilypond-invoke-editor

2017-11-23 Thread Knut Petersen

Hi everybody!

12 years ago a security problem was introduced into lilypond-invoke-editor.
On 2017/11/15 the problem was reported to the bug-lilypond mailing list by 
Gabriel Corona.

If you decided to install lilypond-invoke-editor helper as a general URI 
helper, you _are_ affected.

If you decided to install lilypond-invoke-editor to only handle textedit URIs 
(or if you do not use it at all) you are _not_ affected.

If you do not know if you are affected:

1.: locate lilypond-invoke-editor

2. Open lilypond-invoke-editor in your favorite text editor. Search for

   (if (is-textedit-uri? uri)
 (run-editor uri)
 (run-browser uri)

and replace it with

   (if (is-textedit-uri? uri)
     (run-editor uri)

Knut

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


Re: [OT] Linux Users

2017-11-18 Thread Knut Petersen

Am 17.11.2017 um 23:59 schrieb Brett M. Gilio:

How many Linux users are out there in the Lilypond community? Do any of
you use other type-setting software such as LaTeX or Csound rather than
graphical tools?

I completely switched to Linux more than 20 years ago and use *TeX for more 
than 25 years.
Today I prefer the LuaTeX engine.

I don't use Csound.

Knut


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


Re: [OT] Grammatic gender

2017-11-17 Thread Knut Petersen

Am 17.11.2017 um 08:55 schrieb Henning Hraban Ramm:

The wrong use of an apostrophe in German is called "Deppen-Apostroph" (Deppostroph?), it shows only that you don’t master your mother language. 


Sometimes an apostrophe completely changes the meaning of a sentence:

"Der Vogelsberg, wo's Vögeln gut geht."   !=  "Der Vogelsberg, wos Vögeln gut 
geht." ;-))

Knut



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


Re: Video generation on linux systems: Note and rests change color

2017-11-16 Thread Knut Petersen

Am 16.11.2017 um 12:46 schrieb Christian Alpen:

I changed the usleep 250 to sleep 0.000250 in mkvideo.
Now the short video_mwe.ly goes pretty fast.


ok


I have some further questions (if they still fit in here?):

1. Is the ./kptestpiano.sf2 desperately needed? As I couldn't get this 
prerepuisite solved, I followed Karlin's tip
 and replaced it with 'usr/share/sounds/sf2/FluidR3_GM.sf2'


/usr/share/sounds/sf2/FluidR3_GM.sf2 might be used as well as any other 
soundfont you like.


2. Can the metronom be skipped by some command in the .ly-file? Or do I Have to 
edit the mkvideo for that?


The attached updated version of the script implements a -noMetro command line 
option.


3. Am I bound to 16:9 format, or is it possible for example to view an entire 
A4 page?


Yes, you might any format you like. But I recommend to change 
"VIDEORESOLUTION=1280x720" to a more reasonable value (e.g. 1280x1810) if you 
want to use A4.


4. What about repeats? Right now I one part with repeats, that is only rendered 
once. Of course there
    is a workound with editing the video. But would it be possible to get this 
done while generating the video?


Don't use repeats, it is not supported.

Knut
#!/bin/bash

##
# Copyright (C) 2016-2017 Knut Petersen (address@hidden)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
##


VERSION=2017-11-16
# FPS=n: video files will use n frames per second
#  Currently FSP != 25 is broken. It's either ffmpeg or I am too
#  blind to see my mistake ;-(
FPS=25
VIDEORESOLUTION=1280x720
PRESET=veryslow
AUDIOBITRATE=128k
# TITLETIME: number of seconds the title page shall be visible
TITLETIME=4.0
# AFTERTIME
AFTERTIME=6.666
# METRONOME: n != 0 enables generation of metronome ticks
METRONOME=1
# DEBUG: n != 0 turns on debugging mode (verbose output)
DEBUG=0
# CLEAN: n != 0 enables deletion of all temporary files
CLEAN=1
#
SOUNDFONTB=./kptestpiano.sf2
SOUNDFONTA=/usr/share/sounds/sf2/FluidR3_GM.sf2
SOUNDFONTS="$SOUNDFONTA $SOUNDFONTB"

FAIL=0

function weneedprog {
 for P in $@; do
   TMP=`which $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

function weneeddata {
 for P in $@; do
   TMP=`ls -q $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

echo This is mkvideo version $VERSION

for i in "$@"
do
case $i in
--noMetro)
echo not generating metronome ticks ...
METRONOME=0
;;
*)
;;
esac
done

echo checking dependencies ...
weneedprog ls sort tail uniq grep sed bc gs pdftk lilypond fluidsynth sox ffmpeg
weneeddata $SOUNDFONTS videohelper.notes
if [ $FAIL -ne 0 ]; then
  echo $FAIL missing dependencies, aborting
  exit 1
else
  echo dependencies ok
fi

function checknotes {
  grep "$1" videohelper.notes &> /dev/null
  if [ $? -ne 0 ]; then
 echo Fatal error: $2
 exit 2
  fi
}

grep "NOPAGEREPETITIONS" videohelper.notes  &> /dev/null
if [ $? -eq 0 ]; then
echo "No video generation because \noPageRepetitions was used!"
exit
fi

echo checking videohelper.notes ...
checknotes "LILYSOURCE" "LILYSOURCE undefined"
checknotes "VIDEOSOURCE" "VIDEOSOURCE undefined"
checknotes "MIDISOURCE" "MIDISOURCE undefined"
checknotes "tempo" "no tempo definition"
checknotes "time" "no time definition"
checknotes "page 1 contains no music" "no title page defined"
checknotes "[0-9.]* page" "not a single page"
echo videohelper.notes ok

TDIR=`mktemp -d mkvideo-X`

eval `grep LILYSOURCE videohelper.notes`
eval `grep VIDEOSOURCE videohelper.notes`
eval `grep LASTMOMENT videohelper.notes`

grep VIDEORESOLUTION videohelper.notes &> /dev/null
if [ $? -eq 0 ]; then
  eval `grep VIDEORESOLUTION videohelper.notes`
fi

grep PRESET videohelper.notes &> /dev/null
if [ $? -eq 0 ]; then
  eval `grep PRESET videohelper.notes`
fi

grep AUDIOBITRATE videohelper.notes &> /dev/null
if [ $? -eq 0 ]; then
  eval `grep AUDIOBITRATE videohelper.notes`
fi

MIDILIST=`grep MIDISOURCE videohelper.notes | sed -e 
"s/MIDISOURCE=\([[:print:]]*\).midi/\1/" | sort | uniq | sed ':a;N;$!ba;s/

Re: Video generation on linux systems: Note and rests change color

2017-11-15 Thread Knut Petersen



Yes, but it's a factor of a million, not a thousand, so
sleep 0.00025
would be appropriate as a replacement for usleep 250.


Any short sleep is ok at that place of the script  ...

Knut


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


Re: double time signature problem

2017-11-15 Thread Knut Petersen

Am 15.11.2017 um 00:26 schrieb Noeck:



The diminutive of „Magd“ is „Mägdelein“ or maybe „Mägdchen“ (nobody
would use the latter), but not „Mädchen“.

But still "Mädchen" seems to be derived from "Magd":
http://www.wissen.de/wortherkunft/maedchen


Yes, Grimm agrees 
.

It's a pity that Mark Twain did not know about "Mensch": "Der Mensch" (masculine) means "the human being". 
The old "das Mensch" (neuter)  means "a female human being" and is still occasionally used in some areas of Germany. 
Plural: "Die Menscher" ;-)

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


Re: Video generation on linux systems: Note and rests change color

2017-11-15 Thread Knut Petersen

Am 15.11.2017 um 09:36 schrieb Christian Alpen:


Hi,

hm, I thought I had used the appropriate mkvideo version...
However, now it seems to work in both constellations: With lilypond 2.19 in a 
regular Debian system, and with
lilypond 2.21 in lilydev and with the corrected mkvideo-lily-diff.

The only thing: In both cases it takes a rather long time to generate the files. First 
when "generating wav files from midi input"



Here fluidsynth is executed.


and after that when "generating xx temporary h264 files" the process seems to 
be stuck. It takes about 4-5 minutes per file
to generate.



Here ghostscript and ffmpeg are executed.


So when I try your example "video_mwe.ly", it takes about 1 hour...

I am wondering if this has to be, cause with the prior version without coloured 
notes, the whole video took no longer than
4-5 Minutes.



As the number of temporary x264 files increases, the coloured notes mode 
requires a lot more time. Typically the consumed cpu time will rise by a factor 
greater 10.


Do you have any idea?



Unless you use a very old system video generation really should be faster.

On my i4790K system it takes a bit more than 6 seconds to generate 
video-mwe.mp4:

   time lilypond video_mwe.ly
   ==
   GNU LilyPond 2.21.0
   Processing `video_mwe.ly'
   Parsing...
   Interpreting music...
   Preprocessing graphical objects...
   Interpreting music...
   MIDI output to `video_mwe.midi'...
   Finding the ideal number of pages...
   Fitting music on 1 or 2 pages...
   Drawing systems...
   Layout output to `/tmp/lilypond-A0Uk0X'...
   Converting to `video_mwe.pdf'...
   Deleting `/tmp/lilypond-A0Uk0X'...
   Success: compilation successfully completed

   real    0m0,505s
   user    0m0,484s
   sys 0m0,018s

   time ./mkvideo
   ==
   This is mkvideo version 2017-07-21
   checking dependencies ...
   dependencies ok
   checking videohelper.notes ...
   videohelper.notes ok
   we decided to use up to 9 parallel jobs ...
   generating metronome ticks ...
   generating tsilence.wav ...
   generating wav files from midi input ...
   bursting pdf ...
   synchronizing ...
   generating 23 temporary h264 files ...
   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
   synchronizing ...
   normalizing audio data ...
   synchronizing ...
   adding metronome wav to audio data ...
   synchronizing ...
   adding silence to audio data ...
   synchronizing ...
   generating video_mwe.mp4 ...
   synchronizing ...
   removing temporary files ...

   real    0m5,647s
   user    0m22,152s
   sys 0m1,249s

1. Edit mkvideo, change "CLEAN=1" to "CLEAN=0".
2. lilypond video-mwe
3. ./mkvideo

Please send the console output that mkvideo generated.

Please send the result of "dir --sort=time mkvideo-X | tac" (adapt the name 
of the temp directory created by mkvideo.

Please send a description of your system (cpu/ram/disk).

While mkvideo is generating the temporary x264 files: Is swap memory used?

Slow hard disk? Partition almost full? Encrypted file system?

Dont't forget to restore CLEAN and to remove the temporary directory.

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


Re: Video generation on linux systems: Note and rests change color

2017-11-06 Thread Knut Petersen

Am 05.11.2017 um 10:41 schrieb Christian Alpen:


Hi,

thanks for the fast response!

Everything worked fine, even the patch command without extra installation 
(don't know what happened before)

Like you I was able to make the video from "Wolf_Resignation"and "JSBI1" from 
here:
http://lilypond.1069038.n5.nabble.com/Video-generation-bash-script-keeps-sync-in-spite-of-tempo-changes-td194245.html

The only thing missing was the color of the active notes.



Don't expect coloring to work if you use the old mkvideo version that did not 
support it.

Use the version provided in 
https://lists.gnu.org/archive/html/lilypond-user/2017-07/msg00234.html and, if 
you use a very recent lilypond, use the diff provided in 
https://lists.gnu.org/archive/html/lilypond-user/2017-11/msg00098.html to patch 
lilypond.

JSBI1.ly needs one change to be compatible to the July-2017 version: Add "\time 
4/4" after line 21. Probably you would want to remove the insane tempo changes that 
served to demonstrate synchronization capabilities.

Knut

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


Re: Video generation on linux systems: Note and rests change color

2017-11-06 Thread Knut Petersen

Am 06.11.2017 um 10:02 schrieb Knut Petersen:

Am 21.07.2017 um 10:00 schrieb Knut Petersen:

Hi everybody!

To generate score videos like Bach: Invention 1 
<https://www.youtube.com/watch?v=EqWYmrwTcqQ>, Wolf: Resignation 
<https://www.youtube.com/watch?v=IonPmbdY7ME> and Peterson-Berger: I Fyrreskoven 
<https://www.youtube.com/watch?v=hgDWprKiyo0>
that give a different color to notes and rest while they are active you might 
use the attached files if
you run a unixoid system like linux.

mkvideo-lily-diff contains changes to an installed version of lilypond (tested 
with 2.19.65, but it also
should work with much older versions). 


Because of recent changes to framework-ps.scm an updated diff is needed. Use 
the attached file instead of mkvideo-lily-diff versions of lilypond containing

Commit 398c2e17d45bf4d18723e14d52531e4e7d006dea
Author: Knut Petersen <knut_peter...@t-online.de>
Date:   Tue Oct 3 15:05:56 2017 +0100

    Adapt lilypond to ghostscript 9.22, change command line options [...]

That means: Use it for e.g. lilypond 2.21.x, current git master.



One file was missing in the diff, corrected version attached.

Knut

diff -rU 4 2.21.0/ps/music-drawing-routines.ps 
2.21.0.vid/ps/music-drawing-routines.ps
--- 2.21.0/ps/music-drawing-routines.ps 2017-07-24 08:33:37.003754000 +0200
+++ 2.21.0.vid/ps/music-drawing-routines.ps 2017-11-06 10:47:41.153810422 
+0100
@@ -307,5 +307,33 @@
moveto %w
0 rmoveto
}repeat
 }bind def
+
+/MKVIDcolor { 0.7 0.0 1.0 } def % color to use
+%
+/MKVIDmagic { 2.0 } def % magic value for our own coloring 
requests
+%
+/MKVIDsetrgbcolor { % the extended setrgbcolor
+  3 dict begin  % start local name space
+  /Stop exch def% local "blue": stop
+  /Start exch def   % local "green": start
+  /Red exch def % local "red": magic
+  Red MKVIDmagic eq % if (Red = MKVIDmagic) (
+ { Start MkVidTime eq   %   if (start = current time)
+{ MKVIDcolor ORIGsetrgbcolor}   % change color to red
+{ Start MkVidTime gt%   else if ((start > current time)
+  { Stop MkVidTime lt   %  and (stop < current time))
+{ MKVIDcolor ORIGsetrgbcolor }  %change color to red
+  if }  %   else
+if }%  do not change color
+ ifelse }   %
+ { Red Start Stop ORIGsetrgbcolor } % ) else change color as requested
+ ifelse %
+  end   % stop local namespace
+} def   %
+%
+/ORIGsetrgbcolor /setrgbcolor load def  % make original setrgbcolor 
available as /ORIGsetrgbcolor
+%
+/setrgbcolor { MKVIDsetrgbcolor } bind def  % redefine setrgbcolor
+
 %end music-drawing-routines.ps
diff -rU 4 2.21.0/scm/framework-ps.scm 2.21.0.vid/scm/framework-ps.scm
--- 2.21.0/scm/framework-ps.scm 2017-10-23 00:09:21.28620 +0200
+++ 2.21.0.vid/scm/framework-ps.scm 2017-11-06 10:50:01.368233724 +0100
@@ -101,9 +101,14 @@
(output-entry "page-width" 'paper-width)
(if (ly:get-option 'strokeadjust) "true setstrokeadjust\n" "")
))
 
+;; [mkvideo] This version of dump-page is extended for mkvideo.
+;; As long as null? videopagelist is true nothing changes.
 (define (dump-page outputter page page-number page-count landscape?)
+  (let* (
+(ml (assoc page-number videopagelist))
+(rep? (and (not (null? videopagelist)) (if (pair? ml) (not (null? (cdr 
ml))) #f
   (ly:outputter-dump-string
outputter
(string-append
 (format #f "%%Page: ~a ~a\n" page-number page-number)
@@ -112,11 +117,18 @@
 "page-width output-scale lily-output-units mul mul 0 translate 90 
rotate\n"
 "")
 "%%EndPageSetup\n"
 "\n"
+(format #f (if rep? "/lilypage {\n" ""))
 "gsave 0 paper-height translate set-ps-scale-to-lily-scale\n"))
   (ly:outputter-dump-stencil outputter page)
-  (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n"))
+  (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n")
+  (if rep? (list
+(ly:outputter-dump-string outputter (format #f "} def 1 "))
+(do ((i 0 (1+ i)))
+  ((>= i (length (cdr ml
+  (ly:outputter-dump-string outputter (format #f "~a " (list-ref (cdr ml) 
i)

Re: Video generation on linux systems: Note and rests change color

2017-11-06 Thread Knut Petersen

Am 21.07.2017 um 10:00 schrieb Knut Petersen:

Hi everybody!

To generate score videos like Bach: Invention 1 
<https://www.youtube.com/watch?v=EqWYmrwTcqQ>, Wolf: Resignation 
<https://www.youtube.com/watch?v=IonPmbdY7ME> and Peterson-Berger: I Fyrreskoven 
<https://www.youtube.com/watch?v=hgDWprKiyo0>
that give a different color to notes and rest while they are active you might 
use the attached files if
you run a unixoid system like linux.

mkvideo-lily-diff contains changes to an installed version of lilypond (tested 
with 2.19.65, but it also
should work with much older versions). 


Because of recent changes to framework-ps.scm an updated diff is needed. Use 
the attached file instead of mkvideo-lily-diff versions of lilypond containing

   Commit 398c2e17d45bf4d18723e14d52531e4e7d006dea
   Author: Knut Petersen <knut_peter...@t-online.de>
   Date:   Tue Oct 3 15:05:56 2017 +0100

    Adapt lilypond to ghostscript 9.22, change command line options [...]

That means: Use it for e.g. lilypond 2.21.x, current git master.

Knut
diff -U 4 scm/framework-ps.scm scmvid/framework-ps.scm
--- scm/framework-ps.scm2017-10-23 00:09:21.28620 +0200
+++ scmvid/framework-ps.scm 2017-11-06 08:14:22.160854215 +0100
@@ -101,9 +101,14 @@
(output-entry "page-width" 'paper-width)
(if (ly:get-option 'strokeadjust) "true setstrokeadjust\n" "")
))
 
+;; [mkvideo] This version of dump-page is extended for mkvideo.
+;; As long as null? videopagelist is true nothing changes.
 (define (dump-page outputter page page-number page-count landscape?)
+  (let* (
+(ml (assoc page-number videopagelist))
+(rep? (and (not (null? videopagelist)) (if (pair? ml) (not (null? (cdr 
ml))) #f
   (ly:outputter-dump-string
outputter
(string-append
 (format #f "%%Page: ~a ~a\n" page-number page-number)
@@ -112,11 +117,18 @@
 "page-width output-scale lily-output-units mul mul 0 translate 90 
rotate\n"
 "")
 "%%EndPageSetup\n"
 "\n"
+(format #f (if rep? "/lilypage {\n" ""))
 "gsave 0 paper-height translate set-ps-scale-to-lily-scale\n"))
   (ly:outputter-dump-stencil outputter page)
-  (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n"))
+  (ly:outputter-dump-string outputter "stroke grestore\nshowpage\n")
+  (if rep? (list
+(ly:outputter-dump-string outputter (format #f "} def 1 "))
+(do ((i 0 (1+ i)))
+  ((>= i (length (cdr ml
+  (ly:outputter-dump-string outputter (format #f "~a " (list-ref (cdr ml) 
i
+(ly:outputter-dump-string outputter (format #f " { /MkVidTime exch def 
MkVidTime 1 eq { exit } if lilypage } loop\n" ))
 
 (define (supplies-or-needs paper load-fonts?)
   (define (extract-names font)
 (if (ly:pango-font? font)
diff -U 4 scm/output-lib.scm scmvid/output-lib.scm
--- scm/output-lib.scm  2017-10-23 00:10:15.753555000 +0200
+++ scmvid/output-lib.scm   2017-11-06 07:59:38.826857643 +0100
@@ -706,13 +706,14 @@
 
 ;;
 ;; Color
 
+;; [mkvideo] This version of color? does _not_ check that
+;; r, g and b are in the range [0.0 .. 1.0]!
 (define-public (color? x)
   (and (list? x)
(= 3 (length x))
-   (every number? x)
-   (every (lambda (y) (<= 0 y 1)) x)))
+   (every number? x)))
 
 (define-public (rgb-color r g b) (list r g b))
 
 ;; predefined colors
diff -U 4 scm/output-ps.scm scmvid/output-ps.scm
--- scm/output-ps.scm   2017-10-23 00:09:21.28620 +0200
+++ scmvid/output-ps.scm2017-11-06 07:59:38.830857600 +0100
@@ -204,10 +204,11 @@
 (ly:format  "~4l draw_round_box"
 (list width height x y blotdiam
 
 ;; save current color on stack and set new color
+;; [mkvideo] This version of setcolor extends the precision
 (define (setcolor r g b)
-  (ly:format "gsave ~4l setrgbcolor\n"
+  (ly:format "gsave ~9l setrgbcolor\n"
  (list r g b)))
 
 ;; restore color from stack
 (define (resetcolor) "grestore\n")
diff -U 4 scm/paper.scm scmvid/paper.scm
--- scm/paper.scm   2017-08-19 07:52:05.563096000 +0200
+++ scmvid/paper.scm2017-11-06 07:59:38.830857600 +0100
@@ -17,8 +17,10 @@
 
 ;; for define-safe-public when byte-compiling using Guile V2
 (use-modules (scm safe-utility-defs))
 
+(define-public videopagelist '())
+
 (define-public (set-paper-dimension-variables mod)
   (module-define! mod 'dimension-variables
   '(binding-offset
 blot-diameter
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Video generation on linux systems: Note and rests change color

2017-11-06 Thread Knut Petersen



 This thing really needs a Tiny Example. Could you make a video project with 
just a C-major scale or something?


See attached file.

Knut

\version "2.21.0"

% Minimal video example

#(set! paper-alist (cons '("video" . (cons (* 21 cm) (* 11.8125 cm))) paper-alist)) % You have to define a 16:9 paper size

\include "videohelper.ily" % You have to include videohelper.ily

\book { % You have to put the score in a book block

\paper { #(set-paper-size "video") } % You have to use the 16:9 paper size previously defined

\markup { \column { \vspace #5 \fill-line { \fontsize #18.0 "TITLE" } } } % You have to create a title page with no music

\pageBreak % You have to start your music on page two

\score  {
\new Staff {
\relative c' {
\time 4/4 % You have to use \time ...
\tempo 4 = 90 % You have to use \tempo ...
c4 d e f g a b a8 b c2 r4 c4 b a g f e d d d8 g c,1
\bar "|."
}
}
\layout{}
\midi{}
}
}

\pdfforvideo % You have to use \pdfforvideo once after the book that contains the video definition has been closed
\midiforvideo % You have to use \midiforvideo at least once after the book that contains the midi definition has been closed
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Video generation on linux systems: Note and rests change color

2017-11-04 Thread Knut Petersen

Am 04.11.2017 um 22:55 schrieb Karlin High:


I think this feature shows great promise. Further exploring this is high on my LilyPond 
to-do list. But at this point, getting set up for the mkvideo features seems to me like a 
"void your warranty" operation.


Probably it is, although you should not notice any difference if patching 
succeeded and you do not use the extended syntax.

I have not tried it, but I think patching will fail with lilypond versions 
containing my postscript changes for ghostscript 9.22 ... (git commit 
398c2e17d45bf4d, applied to master 2017/20/03).
The 2.19.65 release should work.

Follwing Knut's instructions, I was able to get the Wolf_Resignation video produced, but none of my own projects yet. Knut? This thing really needs a Tiny Example. Could you make a video project with just a C-major scale or something? I love looking at other people's lilypond code for picking up 
tips and inspiration, but in this case my mediocre lilypond skills got drowned while trying to understand all the different \book outputs at the end. I couldn't easily tell which code was needed for video projects and which was just the Knut Petersen standard for coding style and project structure.


The visual part is first defined in one book, it contains a \layout but no midi 
\block. \pdfforvideo is the significant keyword here that must be used 
immediately after that book. The script expects that exactly one book is marked 
with \pdfforvideo.

\book {
\bookOutputSuffix "Partitur-Video"
[...]
} \pdfforvideo


Then there are 6 more books defining different audio tracks.  Each of those books contains a \midi but no \layout block. \midiforvideo is the significant keyword that must be used immediately after every book that is intended to define an audio track. The script accepts an arbitrary number of books 
marked with \midiforvideo.


\book{
\bookOutputSuffix "Video..."
[...]
} \midiforvideo
 


The script makes the silent video defined in the book marked \pdfforvideo and 
the audio tracks defined in the boos marked \midiforvideo, then it combines the 
video with the audio tracks so that we have the desired six videos with 
identical video streams but different audio streams.

Knut

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


Re: Any other Thunderbird users have messages never post? (WAS: Hide slur?)

2017-10-26 Thread Knut Petersen

Am 25.10.2017 um 05:58 schrieb Bob Proulx:


At the Mailman layer if the sender address has not posted to the
mailing before then the message will be held for moderation.  This
only happens *once* for the *first* messages from a new address until
the modertors approve it.  After that point messages from that address
are no longer held for moderation.


Thanks for the information. All that sounds pretty reasonable, it sufficiently 
protects against spam and does not discourage participants.

Other FOSS mailing lists implement different policies.  One particularly bad 
example: The main linux-kernel  mailing lists (those hosted at vger.kernel.org) 
completely block all mails from native email addresses of the biggest German 
ISP (t-online.de) since 2014/05.

Knut

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


Re: GS error on somewhat large score

2017-10-16 Thread Knut Petersen

Am 16.10.2017 um 19:23 schrieb Simon Albrecht:

On 16.10.2017 18:50, David Kastrup wrote:

Simon Albrecht  writes:

On 16.10.2017 17:13, David Kastrup wrote:

Simon Albrecht  writes:

Hello everybody,

I’ve just noticed a problem when compiling a medium to large score (44
pages of output) with 2.19.65: everything is fine until GS fails with
the message
warning: g_spawn_sync failed (0): gs: Failed to fork (Cannot allocate
memory).
Compiling the 3–5 page bookparts individually is no problem.

Does this ring a bell with anybody? or
How should I further investigate the problem? or
Would anybody be interested in getting the file privately to investigate?

It might be worth mentioning what kind of system and which Ghostscript
you are seeing this problem with.

Ubuntu 16.04.

This is great.  Now we only need to know your system architecture
(64bit? 32bit? arm? x86?), whether you installed the system version of
LilyPond or a predistributed binary or compiled something yourself, your
Ghostscript version.


$ uname -m
x86_64 


The glib function g_spawn_sync() is called from  our general-scheme.cc file in 
ly_run_command().

It seems your system is low on memory. Did you set a limit on memory usage?

You might run lilypond under control of gdb, set a breakpoint at the start of 
ly_run_command() and inspect memory usage when the breakpoint is reached.

Or temporarily replace "gs" with a script that ignores the arguments and 
executes a tool that allows you  to inspect the amount of free memory.

Try to increase the amount of available memory by adding some more GB of swap.

Knut



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


Re: Getting absolute position of objects

2017-09-10 Thread Knut Petersen


I also need to output the absolute coordinates of all objects on the page, to generate training data for optical music recognition. I'm trying to print some information in \applyOutput, and I see that NoteHead X-offset and Y-offset are 0, and X-parent, Y-parent, X-positions, and Y-positions all 
seem to be (). Is there a way to get the absolute coordinates, so that I can add them to event-listener.ly ?




It certainly is possible, but you need to implement an after-line-breaking function. There you can access the paper variables (margins etc.) as well as the xy-position of grobs. You may have a look at videohelper.ily file I published on this list on 2017-07-21. There is a function mkvideo-dump that 
easily could be extended to meet your requirements.


Knut

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


Re: video generation

2017-09-03 Thread Knut Petersen

Am 03.09.2017 um 19:36 schrieb Adam Spiers:

However please don't write off ly2video just because I
haven't done much with it recently (except for today).


The most annoying bugs should really be fixed. One example: The problem that 
ly2video needs pure 7-bit ascii as input has been discussed on this list 54 
months ago.

  It has some nice features, like multiple scrolling modes, and the ability to
synchronise the video perfectly with live performances with variable
tempi.  In the long term it'd be great if the LilyPond community
converged on a single best-of-breed solution.


Yes.

Knut

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


Re: Video generation on linux systems: Note and rests change color

2017-09-03 Thread Knut Petersen

Hi Adam!

Two questions:

1. Please can you put the source files in a git repository and publish
it somewhere (e.g. GitLab.com), to reduce barrier to collaboration?


Well, not now.


2. Would it be possible to generate video which is perfectly
synchronised with a live performance with variable tempi?


That's my mid-term objective. You see that there is a video with a fft 
visualization on my youtube channel 

The problem of synchronization is not trivial for less than optimal 
performances / recordings. Not only tempi change, there is reverb, there is 
applause, musicians make mistakes, a choir goes flat 

Knut

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


Re: Gotlandstoner

2017-09-03 Thread Knut Petersen

Am 02.09.2017 um 13:08 schrieb Erik Ronström:

If I apply the attached patch to a cloned git archive I get the following 
results with ghostscript 9.06:

bok2: Original size 9.996.691 bytes, optimized size 2.043.380 bytes
bok3: Original size 13.706.324 bytes, optimized size 2.447.232 bytes

Unfortunately I found that a current git master of ghostscript does not work as 
intended. I have to bisect and investigate that problem.

Lovely! Thanks again!



I had a closer look at ghostscript.

Between ghostscript versions 9.16 and 9.17 commit 
0ec0f1627b7f7f5ffa1347123a926cd1e32c9f19 was added.

That commit normally results in better handling of different subsets of the 
same font, but it breaks our existing solution.
Fortunately this commit also allows to define the PDFDontUseFontObjectNum 
option. If this option is used with ghostscript 9.17
or newer, the old behavior is restored.

Example for gs 9.17(+):

   gs -dPDFDontUseFontObjectNum -dNOPAUSE -dBATCH -q -r600 -sDEVICE=pdfwrite 
-sOutputFile=bok3-opt.pdf bok3.pdf

Knut


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


Re: video generation

2017-09-01 Thread Knut Petersen

Am 01.09.2017 um 23:26 schrieb Flaming Hakama by Elaine:

> I am not top posting


I've been wanting to generate videos from lilypond, and so far it seems like 
the best approach (scrolling, rather than paginated) is:

https://github.com/aspiers/ly2video


It does not allow anything but 7-bit characters in the entire score, does not understand 
modern lilypond syntax (e.g. "c2 2" ) and has a number of other serious bugs.

Search the archive of this list for a thread "Video generation on linux systems: 
Note and rests change color" (July 2017).

Knut



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


Re: Gotlandstoner

2017-09-01 Thread Knut Petersen

Am 01.09.2017 um 22:42 schrieb Erik Ronström:

Nice work, but your pdf includes many different subsets of the lilypond fonts 
and is several MB to big because of this.

Use the --bigpdfs option of lilypond  in step 3. The resulting pdfs are _much_ 
bigger because all glyphs from the fonts are included.

  …

Wow, thanks, I hadn’t thought of that at all! There’s always something more to 
learn! :)


If I apply the attached patch to a cloned git archive I get the following 
results with ghostscript 9.06:

bok2: Original size 9.996.691 bytes, optimized size 2.043.380 bytes
bok3: Original size 13.706.324 bytes, optimized size 2.447.232 bytes

Unfortunately I found that a current git master of ghostscript does not work as 
intended. I have to bisect and investigate that problem.


A lot of pages contain a lot of white space. It would be possible to include 
every staff as a paragraph instead of including the whole pdfs ….

Yeah, but that is intentional. I didn’t want tunes split over page breaks 
(except the tunes that are too long to fit in one page). Actually that was the 
main reason for not using lilypond-book: I wanted more fine-grained control 
over vertical spacing, and I found that much easier to achieve when lilypond 
takes care of the whole typesetting process.


I did not write about using lilypond-book, I never use it and prefer 
pdf(la)tex/xe(la)tex/lua(la)tex for similar reasons.

I agree that there are valid reasons not to split over page breaks if a page 
turn would be the result. But why do you have objections against  a score 
starting on an even page and continuing on an uneven page?

A possible extension of your work: You might generate score videos (example) 
 and add links to those videos in 
your books 

Knut
diff --git a/bin/generate-book-2.pl b/bin/generate-book-2.pl
index 28dd48e..5895d4b 100755
--- a/bin/generate-book-2.pl
+++ b/bin/generate-book-2.pl
@@ -141,7 +141,7 @@ for my $num ($From..$To) {
 #my $md5 = `md5 -q $songfile.ly`;
 #$md5 =~ s/\s//g;
 unless (-e "$songfile-$md5-crop.pdf") {
-system("lilypond", "-l", "WARNING", "-o", "$songfile-$md5", "$songfile.ly") unless -e "$songfile-$md5.pdf";
+system("lilypond", "-l", "WARNING", "--bigpdf", "-d", "gs-load-fonts=\#t", "-o", "$songfile-$md5", "$songfile.ly") unless -e "$songfile-$md5.pdf";
 `pdfcrop $songfile-$md5.pdf`; # Use backticks instead of system() to suppress output
 unlink("$songfile-$md5.pdf");
 }
diff --git a/bin/make-books.sh b/bin/make-books.sh
index 94f3054..769ab76 100755
--- a/bin/make-books.sh
+++ b/bin/make-books.sh
@@ -6,7 +6,9 @@ then
 fi
 rm -f fredin.out
 bin/generate-book-2.pl book 2 && lualatex $VERBOSE book/fredin.latex && mv fredin.pdf bok2.pdf
+gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bok2-opt.pdf bok2.pdf
 rm fredin.out
 bin/generate-book-2.pl book 3 && lualatex $VERBOSE book/fredin.latex && mv fredin.pdf bok3.pdf
+gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bok3-opt.pdf bok3.pdf
 rm fredin.out
 echo
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: different notation fonts and LilyPond’s -b option

2017-09-01 Thread Knut Petersen

Am 01.09.2017 um 17:03 schrieb Malte Meyn:

Hi list,

I wanted to try Knut’s advice from the Gotlandstoner thread (https://lists.gnu.org/archive/html/lilypond-user/2017-09/msg00013.html) but the -b option doesn’t seem to work with different notation fonts; 


You are right, it only works with the emmentaler fonts. It would be possible to 
support other fonts, but that requires some work.

Have to leave now, a more detailed answer will follow.

Knut




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


Re: Gotlandstoner

2017-09-01 Thread Knut Petersen



3) The song files are run through lilypond to produce pdf files

4) The text information from the abc source is extracted and inserted into a 
book template, again using the config file, to produce a ”book document” in 
latex format, which also includes the individual song pdf files

5) The latex document is run through LuaLaTEX


Nice work, but your pdf includes many different subsets of the lilypond fonts 
and is several MB to big because of this.

Use the --bigpdfs option of lilypond  in step 3. The resulting pdfs are _much_ 
bigger because all glyphs from the fonts are included.

Proceed with steps 4 and 5.

Feed the pdf produced from lualatex in step 5 to ghostscript to produce a final pdf. This step 6 will produce a pdf significantly smaller than your current file because ghostscript sees several hundred identical fonts and is smart enough to produce one subset of a font that contains only the glyphs 
that are really used in your document.


Another topic:

A lot of pages contain a lot of white space. It would be possible to include 
every staff as a paragraph instead of including the whole pdfs 

Knut

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


Re: Specify output directory *in* the file

2017-08-01 Thread Knut Petersen

Hi Thomas

#(format #t
   "\nCurrent output-filename: \"~a\"\n"
   (paper-variable (ly:parser-lookup '$current-book) 'output-filename))


Thanks for that snippet. I spent hours to find a way to get the current output 
filename
and suffix. $current-book and similar variables definitely should be documented.

Knut

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


Re: .ly file partially compiles, then LP crashes

2017-07-29 Thread Knut Petersen

Am 29.07.2017 um 09:01 schrieb David Kastrup:


Uh, the proper way to throw in the towel is not a segfault.  If you can
find a reproducible manner of segfaulting on a hard page break problem,
that warrants fixing.


I remember segfaults that looked exactly like Guys, but those scores have 
changed a lot and I don't
have the old versions. Maybe I find something in old backups.

One score that reliably segfaults with global staff size above a certain limit 
is attached to issue #5169,
but I think that segfault is caused by a different problem.

Knut



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


Re: .ly file partially compiles, then LP crashes

2017-07-29 Thread Knut Petersen

Hi Guy!


Starting lilypond-windows.exe 2.19.56 
[Leloupgarou_transformationscene-pianoReduction.ly]...

Processing `[filename].ly'

Parsing...

Interpreting 
music...[8][16][24][32][40][48][56][64][72][80][88][96][104][112][120][128][136][144][152][160][168][176][184][192][200][208][216][224][232]

Preprocessing graphical objects...

Interpreting music...

MIDI output to `[filename].mid'...

Finding the ideal number of pages...

Fitting music on 9 or 10 pages...

Drawing systems...

warning: compressing over-full page by 7.1 staff-spaces

warning: page 3 has been compressed

Exited with return code -1073741819.




Try to play with set-global-staff-size.

It's definitely possible to find combinations of global staff size, page-count, 
system-count, etc
and music that are hard or impossible to solve. I remember more than one 
segfault caused
by such an exercise. That problem is old, it is also reproducible on linux 
systems and current
git master.

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


Re: Video generation on linux systems: Note and rests change color

2017-07-23 Thread Knut Petersen

Hi David!




But contributing code to lilypond is complex and time-consuming.

Maintaining your own changes tends to be a permanent time drain and
makes it harder to share experience and join efforts with other users.


Probably both is correct. I experienced that it is easier, faster and involves 
substantially less formalism to get some code into e.g. the linux kernel and 
X11. But I also understand that there are good reasons for the formalized 
approach of lilypond development.

Knut


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


Re: Video generation on linux systems: Note and rests change color

2017-07-23 Thread Knut Petersen

Hi Karlin!


I got some font errors during the lilypond compile: "warning: no glyph
for character U+9F in font [...] ./texgyreschola- [*]" (Square brackets
with placeholders for brevity.) Looks my setup is choking on the German
ß sharp-S thing.


Lilypond handles utf-8 characters, and the texgyre fonts include those 
characters.
Your font setup seems to be seriously broken.



Hmm... if everything else is the same after patching, any chance this
could be included in the standard lilypond code? Or maybe that's what
you have in mind, and just want more people to try it out first? I think
this would be a great feature to have standard.


Yes: It would be nice if lilypond could produce videos.

No: I don't think that this code should be part of lilypond. Although it works 
pretty
well for me I have to admit that it is a hackish solution of a problem I had. 
Maybe
it would be a good idea to introduce some additional hooks into lilypond that 
would
eliminate the need to patch lilypond. But contributing code to lilypond is 
complex
and time-consuming.



All the dependencies, though... might be a bit much to include in the
standard lilypond setup?


Yes.


And it turns out Debian does not have usleep but rather sleepenh. I
ended up doing...

ln -s /usr/bin/sleepenh /usr/bin/usleep


Thanks for reporting.



Is there a way to set a path for the patched lilypond when running the
mkvideo script? Or a definition to edit somewhere? I looked around a
little in the mkvideo code, but my limited bash script skills didn't
pick anything up.


Patching some scm/ps files definitely does not change the lilypond binary.
No need to change  PATH.

If you want to keep separate set of patched and unpatched files you could use
 "lilypond -ddatadir=/path/to/set/"  to use that set not used by default.

Knut


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


Video generation on linux systems: Note and rests change color

2017-07-21 Thread Knut Petersen
%%
%
% Here we do some post-processing and build the alist for the page dumper
% (key is the page number, value is the list of moments on the page)
%

#(define dumpedstartlist? #f)

#(define (dumpstartlist)
(list
(do ((i 0 (1+ i)))
((>= i (length startlist)))
( format mkvid_out "~a page\n" (- 0 (list-ref startlist i
(format mkvid_out "LASTMOMENT=~a\n"  (- 0 maxstop))
(set! dumpedstartlist? #t)))


#(define (after-pb-processing layout pages)
  (let* (
(lines(map
(lambda (page)
  (ly:prob-property page 'lines))
  pages))
(systems  (map
(lambda (line)
  (append-map
(lambda (l)
  (let (
(system-grob (ly:prob-property l 'system-grob)))
(if (not (null? system-grob)) 
  (list system-grob) system-grob)))
  line))
  lines))
(firstmoments (append
(map 
  (lambda (m) 
(if (and (not (null? m)) (ly:grob? (car m)))
  (- 0 (format-moment (grob::when (car m
  #f))
systems)
      (list maxstop)))
(moments  (append startlist (list maxstop
  (if (and (not (null? firstmoments)) pagerepetitions?)
(map 
  (lambda (page m) 
(if m
  (set! videopagelist (acons page (cdr (member (list-ref firstmoments 
page) (reverse (member m moments videopagelist))
  (list
(if (not dumpedstartlist?)
  (dumpstartlist))
(set! videopagelist (acons page '() videopagelist ))
(format mkvid_out "page ~a contains no music\n" page)
  )
)
  )
(iota (length pages) 1 1) 
firstmoments

\paper {
#(define (page-post-process layout pages) (after-pb-processing layout 
pages))
}
#!/bin/bash

##
# Copyright (C) 2016-2017 Knut Petersen (knut_peter...@t-online.de)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
##


VERSION=2017-07-21
# FPS=n: video files will use n frames per second
#  Currently FSP != 25 is broken. It's either ffmpeg or I am too
#  blind to see my mistake ;-(
FPS=25
VIDEORESOLUTION=1280x720
PRESET=veryslow
AUDIOBITRATE=128k
# TITLETIME: number of seconds the title page shall be visible
TITLETIME=4.0
# AFTERTIME
AFTERTIME=6.666
# DEBUG: n != 0 turns on debugging mode (verbose output)
DEBUG=0
# CLEAN: n != 0 enables deletion of all temporary files
CLEAN=1
#
SOUNDFONTB=./kptestpiano.sf2
SOUNDFONTA=/usr/share/sounds/sf2/FluidR3_GM.sf2
SOUNDFONTS="$SOUNDFONTA $SOUNDFONTB"

FAIL=0

function weneedprog {
 for P in $@; do
   TMP=`which $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

function weneeddata {
 for P in $@; do
   TMP=`ls -q $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

echo This is mkvideo version $VERSION
echo checking dependencies ...
weneedprog ls sort tail uniq grep sed usleep bc gs pdftk lilypond fluidsynth 
sox ffmpeg
weneeddata $SOUNDFONTS videohelper.notes
if [ $FAIL -ne 0 ]; then
  echo $FAIL missing dependencies, aborting
  exit 1
else
  echo dependencies ok
fi

function checknotes {
  grep "$1" videohelper.notes &> /dev/null
  if [ $? -ne 0 ]; then
 echo Fatal error: $2
 exit 2
  fi
}

grep "NOPAGEREPETITIONS" videohelper.notes  &> /dev/null
if [ $? -eq 0 ]; then
echo "No video generation because \noPageRepetitions was used!"
exit
fi

echo checking videohelper.notes ...
checknotes "LILYSOURCE" "LILYSOURCE undefined"
checknotes "VIDEOSOURCE" "VIDEOSOURCE undefined"
checknotes "MIDISOURCE" "MIDISOURCE undefined"
checknotes "tempo" "no tempo definition"
checknotes "time" "no time definition"
checknotes "page 1 contains no music" "no title page defined"
checknotes "[0-9.]* page"

Re: Back in the Pond

2017-01-20 Thread Knut Petersen

The autoextender patch only adds extenders at places where extenders
can be added without it.

That does not sound like we should remove __ from lyrics to me.


I don't understand that comment.


With the autoextender patch there will be an extender if a melisma is

detected and there is enough place for an extender.


At places where an extender token "__" is/would be ignored by current master

(that's the problem Alexander describes) the autoextender patch does not

change anything.


Knut




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


Re: Back in the Pond

2017-01-20 Thread Knut Petersen

Hi everybody!


+1.  A personal wish: I think that \lyricsto ChoirStaff = "ctx" {
... } has the potential to be a killer feature w.r.t. usability for
choir literature (especially combined with the upcoming automatic
extenders). Unfortunately, assignment of lyrics to *container*
contexts does not work (at least, not reliably), and extender
generation is completely defunct.

Uh, I thought that people replaced extenders right now?

Well, may I cite the notation manual:

"extender lines cannot be drawn when there is no associated voice."

The autoextender patch only adds extenders at places where extenders can be 
added without it.

Prior to Alexanders bugreport I wasn't even aware that something like \lyricsto 
ChoirStaff ... could work.
If we get it to work it might be a good idea to document the feature in the 
notation manual.


I reported that in a thread from 2016-12-26 on bug-lilypond, but could
not motivate any supporters yet.


I verified that the changes made by the autoextender patch are unrelated
but decided that probably the person who added the feature is the most
obvious candidate to fix it ;-)

Currently I work on  LyricHyphen enhancements. After I know if the autoextender
patch will be accepted I'll send a patch that will implement the following 
features:

1: use either a rounded box or an arbitrary markup as a hyphen. Solves issue 
#1255.

2: allow to whiteout every hyphen individually instead of the whole set of 
hyphens
 generated for a HyphenEvent (Yes, I know that some people do not like that)

3: allow minimum distance to be automatically set to the with of the hyphen 
stencil.

4: Improved placement of hyphens:
4a: If the spanner starts at the beginning of a system, place the first hyphen
at the start of the system.
4b: If the spanner ends at the end of the system, place the last hyphen at the 
end of
the system
4c: If neither 4a nor 4b apply: In cases where the old code uses n hyphens  use 
n+1
hyphens if enough place between the first/last syllable and the hyphens remain.
'Enough place' might be changed by a property.

Feature 4 gives much better results if there are multiple stanzas.

I think that these proposed changes could also be a something worth to be
integrated in a lilypond 2.20.

Knut

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


Re: Which Linux distro for Lilypond

2017-01-14 Thread Knut Petersen



OK, thanks for working on this.  However, it would be still valuable
to know why module loading fails with a static version of guile.  This
might be either a bug or missing information in the documentation.


It's a known problem ... there already is a related thread in guile-user that 
should be helpful:
http://lists.gnu.org/archive/html/guile-user/2013-02/msg00073.html

cu,
 Knut


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


Re: Which Linux distro for Lilypond

2017-01-12 Thread Knut Petersen

Hi Werner et al.!

*If* we bundle guile 1.8 with lilypond, I strongly prefer static
linking of the library (this is, adding `--disable-shared' to guile's
configure script, together with a proper argument to the
`--datarootdir' option to install the .scm files under a lilypond
directory).  This avoids *any* problems with different guile library
versions, and the created lilypond binary can peacefully coexist with
guile 2.0 even in the `/usr' tree.


After a loser look at the sources and the build system I think it's better
(= much easier) to stay with shared libraries.

At runtime we do need both libguile and guile itself (it is used by
 lilypond-invoke-editor), and all of our guile must be invisible to the
rest of the system.

That means:
+ there must be no entry in PATH leading to our private guile, guile-config etc.
+ there must be no entry leading to libguile etc in the system library search 
path.

All that is possible without major changes to the sources... attached find a 
bash
script as a proof of concept. The requirements described above are met.
It passes the "full make" test without problems:

knut@golem:~/sources>./mknewlily
Building GUILE 579b6041730357abcbb01e1f259e37c6e573cb7c first ...
  First we add a library search path to libguile/dynl.c
  exec ./autogen.sh in /home/knut/sources/guile ... succeeded after 14 seconds
  exec ./configure --disable-error-on-warning 
--prefix=/home/knut/sources/lilybuilt/share/lilypond in 
/home/knut/sources/guile ... succeeded after 10 seconds
  exec make -j 11 in /home/knut/sources/guile ... succeeded after 10 seconds
  exec make -j 11 install in /home/knut/sources/guile ... succeeded after 1 
seconds
Building LILYPOND 5bfd1e31928841704c5e5913290b948f6a480b09...
  exec ./autogen.sh --noconfigure in /home/knut/sources/lily ... succeeded 
after 1 seconds
  exec ../configure --prefix=/home/knut/sources/lilybuilt in 
/home/knut/sources/lily/build ... succeeded after 5 seconds
  exec make -k -j 11 CPU_COUNT=11 all in /home/knut/sources/lily/build ... 
succeeded after 92 seconds
  exec make -j 11 CPU_COUNT=11 install in /home/knut/sources/lily/build ... 
succeeded after 1 seconds
  exec make -j 11 CPU_COUNT=11 doc in /home/knut/sources/lily/build ... 
succeeded after 838 seconds
  exec make -j 11 CPU_COUNT=11 install-doc in /home/knut/sources/lily/build ... 
succeeded after 18 seconds
Total guile and lilypond build time: 990 seconds

cu,
 Knut
#!/bin/bash

#
# Build lilypond and guile 1.8 in a way that
#  -> guile is installed under PREFIX/share/lilypond
#  -> guile does not need to be in PATH
#  -> libguile does not need to be in the systems library search path
#

RED='\033[0;31m'
NOCOLOR='\033[0m'

STARTTIME=`date +"%s"`

#===
# Adapt the next three lines to your needs!
# LILYSOURCE is the local lilypond git repository
# GUILESOURCE is the local guile git repository
# LILYROOT is the install destination root directory
#===
LILYSOURCE=/home/knut/sources/lily
GUILESOURCE=/home/knut/sources/guile
LILYROOT=/home/knut/sources/lilybuilt

#===
# derived from the defintions above, there should be
# no need to change these:
#===
BUILDLOG=$LILYROOT/lilypond_buildlog
GUILEROOT=$LILYROOT/share/lilypond
GUILELIBDIR=$GUILEROOT/lib64
GUILEBINDIR=$GUILEROOT/bin
LILYLIBDIR=$LILYROOT/lib64/lilypond
LILYBINDIR=$LILYROOT/bin

#===
# options for make
#===
LILYMAKEPAR="-j 11 CPU_COUNT=11"
GUILEMAKEPAR="-j 11"


function doit {
  AT=`date +"%s"`
  echo -en "  exec $RED$1$NOCOLOR in `pwd` ..."
  $1  &>> $BUILDLOG
  if [ $? -ne 0 ]; then echo -n " failed";cat $BUILDLOG;exit 1;else echo -n " 
succeeded";fi
  BT=`date +"%s"`
  let "CT = $BT - $AT"
  echo " after $CT seconds"
}

#
# ensure that our LILYROOT directory exists!
mkdir -p $LILYROOT

cd $GUILESOURCE

git checkout branch_release-1-8  &>> $BUILDLOG
git reset --hard  &>> $BUILDLOG
git clean -dfx  &>> $BUILDLOG

echo Building GUILE `git rev-parse HEAD` first  ...

#
# We do not want our guile to be visible to other applications, so we
# need to tell our hidden libguile where it has to look for module libraries!
#
echo "  First we add a library search path to libguile/dynl.c"
sed -i "s|lt_dlinit ();|lt_dlinit (); lt_dlsetsearchpath (\"$GUILELIBDIR\");|" 
libguile/dynl.c

doit "./autogen.sh"
doit "./configure --disable-error-on-warning --prefix=$GUILEROOT"
doit "make $GUILEMAKEPAR"
doit "make $GUILEMAKEPAR install"

#===
# As our guile is hidden, our binaries need to know where
# guile and libguile is located ... during build we need
# guile-config etc to be in PATH.
#===
PATH=$GUILEBINDIR:$PATH
export 

Re: Which Linux distro for Lilypond

2017-01-11 Thread Knut Petersen

Hi Werner!

*If* we bundle guile 1.8 with lilypond, I strongly prefer static
linking of the library (this is, adding `--disable-shared' to guile's
configure script, together with a proper argument to the
`--datarootdir' option to install the .scm files under a lilypond
directory).  This avoids *any* problems with different guile library
versions, and the created lilypond binary can peacefully coexist with
guile 2.0 even in the `/usr' tree.


Using a guile 1.8.8 built with --disable-shared building of lilypond fails 
early:

   chmod 755 out/lilypond-invoke-editor
   echo /home/knut/sources/lily/build/scripts/build/out/help2man
   /home/knut/sources/lily/build/scripts/build/out/help2man
   /home/knut/sources/lily/build/scripts/build/out/help2man 
out/lilypond-invoke-editor > out/lilypond-invoke-editor.1
   help2man: can't get `--help' info from out/lilypond-invoke-editor
   Try `--no-discard-stderr' if option outputs to stderr

Running build/scripts/out/lilypond-invoke-editor gives a hint:

   ERROR: In procedure dynamic-link:
   ERROR: file: "libguile-srfi-srfi-1-v-3", message: "file not found"

Ok, we don't really need it, so a brutal fix is to simply remove the srfi 
modules from that file... that works.

After that the build does not succeed, but it fails after building the binary.

Executing the lilypond binary gives

   GNU LilyPond 2.19.55
   /home/knut/sources/guile18built/share/guile/1.8/srfi/srfi-1.scm:223:1: In procedure dynamic-link 
in expression (load-extension "libguile-srfi-srfi-1-v-3" "scm_init_srfi_1"):
   /home/knut/sources/guile18built/share/guile/1.8/srfi/srfi-1.scm:223:1: file: 
"libguile-srfi-srfi-1-v-3", message: "file not found"

Ok, let's look at srfi-1.scm line 221..223:

   ;; Load the compiled primitives from the shared library.
   ;;
   (load-extension "libguile-srfi-srfi-1-v-3" "scm_init_srfi_1")

Could it be that --disable-shared kills support of required modules? Is there a 
known workaround?

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


Re: Which Linux distro for Lilypond

2017-01-07 Thread Knut Petersen

Am 07.01.2017 um 21:50 schrieb H. S. Teoh:



I think that the most promising way of attack is to make sure that
Guile-2.0 and Guile-1.8 libraries can be installed in parallel, and
with parallel architectures (most libraries can, Guile-1.8 was not
multiarch-capable when it was removed).

When Debian can include Guile-1.8 without significant cost, why
wouldn't they?  I think that there lies our most promising approach in
the short term.

[...]

Debian does have quite a good number of libraries that can coexist with
different versions of themselves.  And in theory, I'd imagine that it
should be possible to tweak guile-1.8's build scripts so that it
installs into a version-specific path, so as not to have any conflicts
with guile-2.0.  So this should all be possible.  But I don't know how
much actual work it would take to make this all work, though.


On 2016/12/24 I recommended to use OpenSuSE Tumbleweed, and I gave
one reason: In 2011 (!) they changed guile 1.x so that it can coexist with
guile 2.x. They gave a reason for that, you can read it in the changelog:

   *Changed name to guile1 to create new package for factory, based*
   *on the 11.4 guile-1.8.7, to enable lilypond to build. *

Nothing prevents the debian advocates to adopt the changes made
by opensuse.

Nevertheless, as there's more than debian and opensuse,  I'd recommend to
fork guile 1 and use that fork as a git submodule in lilypond.

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


Re: Which Linux distro for Lilypond

2016-12-24 Thread Knut Petersen

Am 24.12.2016 um 04:06 schrieb Craig Dabelstein:

Hi Lilyponders,

Just a quick question. I'm taking the plunge and moving to Linux. Which distro 
would you recommend for running Lilypond and Frescobaldi?


OpenSuSE, I'd recommend to use the Tumbleweed variant. It's a good 
distribution, and a nice feature for
developers is that it allows easy parallel installation of guile 1 and 2.

cu,
 Knut

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


Re: Automatic lyric extenders

2016-12-13 Thread Knut Petersen

Hi Alexander!


add-lyric-extenders =
#(define-music-function (parser location lyrics) (ly:music?)


You don't need "parser location".

cu,
 Knut

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


Re: Automatic lyric extenders

2016-12-13 Thread Knut Petersen

Am 13.12.2016 um 22:43 schrieb Alexander Kobel:

On 2016-12-12 13:48, Knut Petersen wrote:

Hi everybody!

Please test and comment, patch and examples attached.


Hi Knut,

works beautifully, as far as your code is concerned. But I found a bug in my 
function (add-lyric-extenders): Unintuitively, adding an extender after _ makes 
extenders disappear: compare { Foo __ _ } against { Foo __ _ __ }.



Very interesting. Have a look at the scheme code produced from your example, you'll see the reason: 
every _ is translated to an " " and an extender event is added by your scheme code. But 
then in lyric-engraver.cc there is a special handling for the " " case:

Lyric_engraver::process_music ()
{
  if (event_)
{
  SCM text = event_->get_property ("text");

  if (ly_is_equal (text, scm_from_ascii_string (" ")))
{
  if (last_text_)
last_text_->set_property ("self-alignment-X",
  get_property ("lyricMelismaAlignment"));
}
  else
text_ = make_item ("LyricText", event_->self_scm ());
}

A hackish solution, but it works ;-)


The fixed function is in your regtest, along with a testcase for it.


Yes, your extended \add-lyric-extenders is correct.

I think \has-hypen? and \add-extender! should be merged with 
add-lyric-extenders. Then the code should be put into a file in the scm 
directory. E.g. scm/music-functions.scm. It's your code, will you prepare a 
patch?

cu,
 Knut

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


Automatic lyric extenders

2016-12-12 Thread Knut Petersen

Hi everybody!

Please test and comment, patch and examples attached.

Cheers,
 Knut

>From 456cee254df6133a611f108d2e9ca3671b01886f Mon Sep 17 00:00:00 2001
From: Knut Petersen <knut_peter...@t-online.de>
Date: Mon, 12 Dec 2016 13:13:13 +0100
Subject: [PATCH] Enhance and clean lyric-extender.cc, add force-extender
 property

Allow exteners to be forced even after single notes, automatically
kill extenders that are not needed. Also removed some dead and
unnecessary code.

Signed-off-by: Knut Petersen <knut_peter...@t-online.de>
---
 lily/lyric-extender.cc | 39 +++
 scm/define-grob-properties.scm |  4 
 scm/define-grobs.scm   |  1 +
 3 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc
index 8afe2c5569..6fd70b7c7b 100644
--- a/lily/lyric-extender.cc
+++ b/lily/lyric-extender.cc
@@ -45,51 +45,49 @@ Lyric_extender::print (SCM smob)
   common = common->common_refpoint (me->get_system (), X_AXIS);
 
   Real sl = me->layout ()->get_dimension (ly_symbol2scm ("line-thickness"));
+  bool at_start_of_line = !left_edge->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface"));
+  bool at_end_of_line = me->get_bound (RIGHT)->break_status_dir ();
+  bool force_extender = to_boolean (me->get_property ("force-extender"));
 
   extract_grob_set (me, "heads", heads);
 
-  if (!heads.size ())
+  if (!heads.size () || (!force_extender && !at_start_of_line && !at_end_of_line && heads.size () < 2))
 return SCM_EOL;
 
   common = common_refpoint_of_array (heads, common, X_AXIS);
 
   Real left_point = 0.0;
-  if (left_edge->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+  if (!at_start_of_line)
 left_point = left_edge->extent (common, X_AXIS)[RIGHT];
-  else if (heads.size ())
-left_point = heads[0]->extent (common, X_AXIS)[LEFT];
   else
-left_point = left_edge->extent (common, X_AXIS)[RIGHT];
+left_point = heads[0]->extent (common, X_AXIS)[LEFT];
 
   if (isinf (left_point))
 return SCM_EOL;
 
-  /* It seems that short extenders are even lengthened to go past the
- note head, but haven't found a pattern in it yet. --hwn 1/1/04  */
-  SCM minlen = me->get_property ("minimum-length");
-  Real right_point
-= left_point + (robust_scm2double (minlen, 0));
-
-  right_point = min (right_point, me->get_system ()->get_bound (RIGHT)->relative_coordinate (common, X_AXIS));
-
-  if (heads.size ())
-right_point = max (right_point, heads.back ()->extent (common, X_AXIS)[RIGHT]);
-
   Real h = sl * robust_scm2double (me->get_property ("thickness"), 0);
   Drul_array paddings (robust_scm2double (me->get_property ("left-padding"), h),
  robust_scm2double (me->get_property ("right-padding"), h));
 
+  Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
+
+  Real right_point = heads.back ()->extent (common, X_AXIS)[RIGHT];
+
+  if (force_extender)
+right_point = max (heads.back ()->extent (common, X_AXIS)[RIGHT], left_point + minlen);
+
   if (right_text)
 right_point = min (right_point, (robust_relative_extent (right_text, common, X_AXIS)[LEFT] - paddings[RIGHT]));
 
-  /* run to end of line. */
-  if (me->get_bound (RIGHT)->break_status_dir ())
+  if (at_end_of_line)
 right_point = max (right_point, (robust_relative_extent (me->get_bound (RIGHT), common, X_AXIS)[LEFT] - paddings[RIGHT]));
 
-  left_point += paddings[LEFT];
+  if (!at_start_of_line)
+left_point += paddings[LEFT];
+
   Real w = right_point - left_point;
 
-  if (w < 1.5 * h)
+  if (w < minlen && !at_start_of_line && !at_end_of_line && !force_extender)
 return SCM_EOL;
 
   Stencil mol (Lookup::round_filled_box (Box (Interval (0, w),
@@ -111,4 +109,5 @@ ADD_INTERFACE (Lyric_extender,
"next "
"right-padding "
"thickness "
+   "force-extender "
   );
diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm
index c234792dd2..2ee4fe1ed6 100644
--- a/scm/define-grob-properties.scm
+++ b/scm/define-grob-properties.scm
@@ -330,6 +330,10 @@ allowed.")
  (footnote ,boolean? "Should this be a footnote or in-note?")
  (footnote-music ,ly:music? "Music creating a footnote.")
  (footnote-text ,markup? "A footnote for the grob.")
+ (force-extender ,boolean? "Force a lyric extender to be generated
+if none would be generated otherwise and/or force it to be at least as
+wide as indicated by minimum-width unless it would collide with the
+next syllable.")
  (force-hshift ,number? &

Re: exchange LyricHyphen with a "proper" hyphen

2016-12-11 Thread Knut Petersen

Hi Alexander
IIUC (I didn't compile it in), your patch inhibits extenders on a single note, correct? 


Yes.

Is that really what we want unconditionally, 


Currently we get a short extender ... that is imho of no use and should be 
killed.


or are there reasonable use cases where one might want to have an extender 
printed after a single note?


No really ... but ... yes. In a situation like << { c1 } { a8 (g f g a2 ) } >>  
it could be usefull.
Would need an override ...


Second: Did you test with broken extenders? Like
{ c1 d \break e f } \addlyrics { c de __ _ f }? Asking because there should be an extender for 
"de" across the break despite the fact that both the d and e are "alone" on 
that line. Such an extender may never be killed.

The 2nd part of the extender is killed by the "if (heads.size () < 2)". That could be changed to "if 
(left_edge->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")) && heads.size () < 
2)".

It's late now, good night.

Knut



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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-11 Thread Knut Petersen

Am 11.12.2016 um 09:05 schrieb Simon Albrecht:

On 11.12.2016 08:37, Knut Petersen wrote:

The attached patch should solve your problem.


Thanks for having a look into it! Would you mind posting your patch as reply 
under issue 4509, to keep the information in one place?


No. Now and here's the discussion, I see no need to split it up into two 
threads at different locations.
Of course, you are free to add links to this thread ;-)


Sorry to ask so bluntly, but can it really be that simple? I thought a solution 
must consider the x-extent of the syllable vs. the melisma as well…


As you can see from 0001-Better-lyric-extender-handling.patch it needs one more 
change,
and and automatic solution (don't write "__" but get extenders where they are 
needed)
requires the scheme code by Alexander.

But at the moment I think this is all that is needed, and yes, it seems to be 
that simple.

If testing does not show problems, the code should be added to lilypond.

Todo:

- cleanup of c++ code
- proper documentation.

cu,
 Knut

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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-11 Thread Knut Petersen

Hi Alexander!


Here's a first shot. Please test thoroughly...

#(define (has-hyphen? event)
   (let* ((art (ly:music-property event 'articulations))
  (is-hyphen? (lambda (ev) (eq? (ly:music-property ev 'name) 
'HyphenEvent
  (find is-hyphen? art)))

[]


Thanks a lot for that code. Works fine together with my 
0001-Better-lyric-extender-handling.patch.

cu,
 Knut

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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-11 Thread Knut Petersen

Am 11.12.2016 um 10:08 schrieb David Kastrup:

Noeck <noeck.marb...@gmx.de> writes:


Btw, I realized that at least visually setting the min. length to 0
already makes the non-melismata hyphens disappear even without your code
to kill them:

\layout {
 \override Lyrics.LyricExtender.minimum-length = 0.0
}

{ a a( a) }
\addlyrics { A __ B __}

But one does not want extenders indistinguishable from fly specks, so 0
is a bad size to use.


I think also the minim-length should be handled differently in the c++ code.

Imho the use of minimum-length and documentation of minimum-length do not agree 
in current master,
so we have some freedom ;-)

cu,
 Knut

>From e37b3eeaca692db26a2384548c71d180f090c4a1 Mon Sep 17 00:00:00 2001
From: Knut Petersen <knut_peter...@t-online.de>
Date: Sun, 11 Dec 2016 12:30:38 +0100
Subject: [PATCH] Better lyric extender handling

---
 lily/lyric-extender.cc | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc
index 8afe2c5569..d05e71a41a 100644
--- a/lily/lyric-extender.cc
+++ b/lily/lyric-extender.cc
@@ -48,7 +48,7 @@ Lyric_extender::print (SCM smob)
 
   extract_grob_set (me, "heads", heads);
 
-  if (!heads.size ())
+  if (heads.size () < 2)
 return SCM_EOL;
 
   common = common_refpoint_of_array (heads, common, X_AXIS);
@@ -66,9 +66,8 @@ Lyric_extender::print (SCM smob)
 
   /* It seems that short extenders are even lengthened to go past the
  note head, but haven't found a pattern in it yet. --hwn 1/1/04  */
-  SCM minlen = me->get_property ("minimum-length");
-  Real right_point
-= left_point + (robust_scm2double (minlen, 0));
+  Real minlen = robust_scm2double (me->get_property ("minimum-length"), 0);
+  Real right_point = left_point + minlen;
 
   right_point = min (right_point, me->get_system ()->get_bound (RIGHT)->relative_coordinate (common, X_AXIS));
 
@@ -89,7 +88,7 @@ Lyric_extender::print (SCM smob)
   left_point += paddings[LEFT];
   Real w = right_point - left_point;
 
-  if (w < 1.5 * h)
+  if (w <= minlen)
 return SCM_EOL;
 
   Stencil mol (Lookup::round_filled_box (Box (Interval (0, w),
-- 
2.11.0

\version "2.19.53"
\language "deutsch"

\pointAndClickOff

% Requires Libertine Open Fonts from http://www.linuxlibertine.org/

\header {
  title = "Brich an, o schönes Morgenlicht"
  subtitle = "12. Choral – Weihnachtsoratorium"
  composer = "J. S. Bach"
  shortcomposer = "Bach"
  maintainer = "Joram Berger"
  maintainerWeb = "http://joramberger.de;
  style = "Baroque"
  source = "Breitkopf & Härtel, Leipzig, 1856"
  mutopiacomposer = "BachJS"
  mutopiapoet = "Johann Rist"
  mutopiaopus = "BWV 248"
  mutopiainstrument = "Choir (SATB)"
  license = "cc-by-sa"
  date = "1734"

 mutopialicense = "Creative Commons Attribution-ShareAlike 4.0"
 footer = "Mutopia-2016/04/22-1900"
 copyright = \markup {\override #'(font-name . "DejaVu Sans, Bold") \override #'(baseline-skip . 0) \right-column {\with-url #"http://www.MutopiaProject.org; {\abs-fontsize #9  "Mutopia " \concat {\abs-fontsize #12 \with-color #white \char ##x01C0 \abs-fontsize #9 "Project "}}}\override #'(font-name . "DejaVu Sans, Bold") \override #'(baseline-skip . 0 ) \center-column {\abs-fontsize #11.9 \with-color #grey \bold {\char ##x01C0 \char ##x01C0 }}\override #'(font-name . "DejaVu Sans,sans-serif") \override #'(baseline-skip . 0) \column { \abs-fontsize #8 \concat {"Typeset using " \with-url #"http://www.lilypond.org; "LilyPond " \char ##x00A9 " 2016 " "by " \maintainer " " \char ##x2014 " " \footer}\concat {\concat {\abs-fontsize #8 { \with-url #"http://creativecommons.org/licenses/by-sa/4.0/; "Creative Commons Attribution ShareAlike 4.0 International License "\char ##x2014 " free to distribute, modify, and perform" }}\abs-fontsize #13 \with-color #white \char ##x01C0 }}}
 tagline = ##f
}

#(define (lh-test-stencil arg)
 (lambda (grob)
   (if (ly:stencil? (ly:lyric-hyphen::print grob))
   (let* ((stil (ly:lyric-hyphen::print grob))
  (x-ext (ly:stencil-extent stil X))
  (dash-period (ly:grob-property grob 'dash-period))
  (arg-stil (grob-interpret-markup grob arg))
  (arg-stil-x-ext (ly:stencil-extent arg-stil X))
  (length-to-print (interval-length x-ext))
  (guess (max 0 (truncate (/ length-to-print dash-period
  (guessed-args-line-length (* guess dash-period))
  (line-length-diff (- length-to-print guessed-args-line-length))
  (line-length-diff-for-each-arg (/ line-length-diff guess))
  (firs

Re: exchange LyricHyphen with a "proper" hyphen

2016-12-10 Thread Knut Petersen

Hi Joram!

Ok, I misunderstood your problem.


What I do is shown here [like 1]:

 \new ChoirStaff <<
   \new Staff \soprano
   \addlyrics \text
   \new Staff \alto
   \addlyrics \text
   \new Staff { \clef "treble_8" \tenor }
   \addlyrics \text
   \new Staff { \clef "bass" \bass }
   \addlyrics \text
 >>

Or the same with
   \new Staff \new Voice = "soprano" \soprano
   \new Lyrics \lyricsto "soprano" \text
etc.

So each staff has its own lyrics context but the content is the same
variable. That works.


The attached patch should solve your problem. But it changes the c++ sources 
and requires
recompilation.

Probably it will not be accepted as it is possible to reimplement a 
Lyric_extender::print()
with the desired changes in scheme and to include it in any lilypond source 
that needs it ;-)


In principle, the information about where to put
extender lines is already given by the number of notes per syllable.

You don't want extenders and hyphens at the same time ...

cu,
 Knut
>From 62bfdf5eba38e4ff09830b81a17ac6eeed798785 Mon Sep 17 00:00:00 2001
From: Knut Petersen <knut_peter...@t-online.de>
Date: Sun, 11 Dec 2016 07:54:34 +0100
Subject: [PATCH] Kill lyric extenders if number of heads < 2

This allows to reuse lyric definitions if they only
differ by some extenders.

Signed-off-by: Knut Petersen <knut_peter...@t-online.de>
---
 lily/lyric-extender.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc
index 8afe2c5569..441ceea34f 100644
--- a/lily/lyric-extender.cc
+++ b/lily/lyric-extender.cc
@@ -48,7 +48,7 @@ Lyric_extender::print (SCM smob)
 
   extract_grob_set (me, "heads", heads);
 
-  if (!heads.size ())
+  if (heads.size () < 2)
 return SCM_EOL;
 
   common = common_refpoint_of_array (heads, common, X_AXIS);
-- 
2.11.0

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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-10 Thread Knut Petersen

Hi Joram!

Would it be possible to have automatic extender lines? For every melisma
there is an extender line if it would be longer than the minimum-length?


Currently lyrics are attached to one voice, but you use them for up to four 
voices in a
staff like "SA combined, lyrics, TB combined".
A better lyrics engraver would allow to attach the lyrics to more than one 
voice and
handle the special cases of lyric placement. With that design automated extender
lines wouldn't be a problem 

cu,
 Knut

BTW: Nach einem Blick auf Deine Adresse: Gruß aus dem Vogelsberg ;-)

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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-10 Thread Knut Petersen

Am 07.12.2016 um 23:59 schrieb Thomas Morley:
So here a very first shot. 


Thanks for your work. I think the attached code shows a problem of your code ...

Knut

\version "2.19.53"

#(define (lh-test-stencil arg)
 (lambda (grob)
   (if (ly:stencil? (ly:lyric-hyphen::print grob))
   (let* ((stil (ly:lyric-hyphen::print grob))
  (x-ext (ly:stencil-extent stil X))
  (dash-period (ly:grob-property grob 'dash-period))
  (arg-stil (grob-interpret-markup grob arg))
  (arg-stil-x-ext (ly:stencil-extent arg-stil X))
  (length-to-print (interval-length x-ext))
  (guess (max 0 (truncate (/ length-to-print dash-period
  (guessed-args-line-length (* guess dash-period))
  (line-length-diff (- length-to-print guessed-args-line-length))
  (line-length-diff-for-each-arg (/ line-length-diff guess))
  (first-arg-length (+ dash-period line-length-diff-for-each-arg))
  (first-arg-end-coord
  (/ (* first-arg-length
(- (interval-length x-ext)
   (interval-length arg-stil-x-ext)))
 length-to-print))
  (list-of-starts
(map
  (lambda (n) (* n first-arg-end-coord))
  (iota (+ 1 guess)
 (ly:stencil-translate-axis
   (apply
 ly:stencil-add
 (map
   (lambda (x-val) (ly:stencil-translate-axis arg-stil x-val X))
   list-of-starts))
   (car x-ext) X))
   (ly:grob-suicide! grob


newLH = #(define-music-function (mrkp)(markup?)
#{
  \override LyricHyphen.after-line-breaking =
#(lambda (grob)
  (if (ly:stencil? (ly:lyric-hyphen::print grob))
  (ly:grob-set-property! grob 'stencil
(ly:stencil-add
  (stencil-with-color (ly:lyric-hyphen::print grob) red)
  ((lh-test-stencil mrkp ) grob)
#})

\paper { ragged-right = ##f }

\layout {
  \context {
\Lyrics
\newLH "¦"
\override LyricHyphen #'height = #0.6
  }
}

<<
\new Voice = "sopran" { c''2.. 8 \bar "|." }
\new Lyrics \lyricsto sopran { bro -- ken  }
>>


harmA.pdf
Description: Adobe PDF document
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-10 Thread Knut Petersen

Am 10.12.2016 um 00:36 schrieb Alexander Kobel:




Maybe minimum-distance may help here, not tested though.


AFAICS for now: Works like a charm. Thanks a ton again.

And with this, all of this week's issues of mine are worked around, and I can proudly present a beautiful little setting of a beautiful little piece by Reger... :-) 


There are two wrong hypens: Bar 30, lyrics of Soprano / Alto and Bass: An additional hyphen is 
printed below the "e" of "ten".

Those old settings by Max Reger are really music that must not be forgotten. 
Nice to see that you published te score on cpdl.org.
I'd recommend some fine tunings of ties etc ... e.g. bars 18, 20 ...

cu,
 Knut

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


Re: exchange LyricHyphen with a "proper" hyphen

2016-12-07 Thread Knut Petersen

Hi Alexander!

every now and then, I use a font for lyrics where the hyphen is quite different from Lilypond's LyricHyphen (in particular, sometimes it's slightly slanted). That combined with lyrics where a hyphen has to appear looks, well, ugly. (Recent example: a repetition of part of a word that has to be 
written as { ro -- sen-, ro -- sen -- rot }.)


I failed with [...]



Did anyone ever successfully try to do that, or has an idea how to approach 
such a tweak?


Yes, there is a solution in my local git repository. To activate the code you 
would include something like

 \override Lyrics.LyricText #'font-size = #+1.5

  \override Lyrics.LyricHyphen.use-markup = ##t
  \override Lyrics.LyricHyphen.text = "-"
  \override Lyrics.LyricHyphen #'font-size = #'1.5
  \override Lyrics.LyricHyphen #'font-name = "OffenbacherSchwab OT"
  \override Lyrics.LyricHyphen #'minimum-distance = #0.8

into \layout{}. It's on top of some other changes either not published or not 
accepted, but I could tear it out.

Of course, you would need to rebuild lilypond as the solution requires changes 
to the c++ sources.

cu,
 Knut

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


Re: Creating marginal comments?

2016-12-05 Thread Knut Petersen

Hi Tapani!

Two problems:
1. I'm producing a hymnal with 100s of entries. To keep things tidy, those
hymns are in separate .ly files, and I then use lilypond-book to compile
them into one document. To embed every music file in a single (massive) .tex
document is not realistic at this stage of the project.


Well, I agree that it is a good idea to keep the hymns in separate files. TeX knows 
"\input".
But I do not know how much work would it be to edit your scores. It might be an 
easy
automatic process using sed, it might be complicated ...


2. I'm too much of a newbie to understand /how/ your method works. Would you
be able to explain it to me in simple/ish terms, or do I just have to go
away and buy a LaTeX manual and really learn the language properly? OR,
alternatively, can I just insert the \newcount commands into my preamble and
use the \def\callback[etc.] argument in the document?

I prepared a somewhat commented version of hymex.tex. Having a LaTex manual
as well as the TeXbook is always a good idea.

cu,
 Knut
\NeedsTeXFormat{LaTeX2e}
%
% Translate with 
% lualatex (or xelatex) --shell-escape
%
% Postprocess the pdf with
% gs -dNOPAUSE -q -sOutputFile=hymexc.pdf -sDEVICE=pdfwrite -dBATCH *.font.ps hymex.pdf
%
\documentclass[10pt]{letter}
%
% We use geometry to define A5 page parameters. After that quire.tex
% from Midnight Macros is used to redefine shipout routines to
% put these pages on A4 sheets. \quire{n} defines the number of A5
% pages for each quire. This probably is the only parameter you want
% to adapt to your needs.
%
% See: tug.ctan.org/macros/generic/midnight/midnight.pdf
%
\usepackage{geometry}
\geometry{a5paper,left=2cm,right=3cm,top=1.5cm,bottom=1.5cm,twoside,
 marginparsep=3mm,marginparwidth=1.9cm}
\input quire.tex
   \paperwidth=2\paperwidth  \shhtotal=\paperwidth   \htotal=0.5\paperwidth
   \vtotal=\paperheight  \horigin=1in\vorigin=1in
   \shvoffset=-1in   \shvcorrection=0pt  \shthickness=0pt
   \shhcorrection=0pt\shoutline=0pt  \shstaplewidth=0pt
   \shstaplelength=0pt   \shcrop=0pt \shfootline={}
   \def\supereject{\par\penalty-2}
   \latexquire
   \quire{8} % You might want to change this, see midnight.pdf

\usepackage[english,german]{babel}
\selectlanguage{german}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\DeclareUTFcharacter[\UTFencname]{x201C}{\grqq}
\DeclareUTFcharacter[\UTFencname]{x201E}{\glqq}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{graphicx}
\usepackage{shellesc}
\usepackage{soul}
\usepackage{calc}

% Define our name space
%===
% file name prefix for all our temporary files
\def\tmpNamePrefix{tmplily}
% file name prefix for all our fragment files
\def\tmpFragPrefix{\tmpNamePrefix frag}

% Files we construct and use
%
% main lilypond source file
\def\tmpNameMain{\tmpNamePrefix .ly}
\newwrite\tmpFileMain
% head part, included by main file
\def\tmpNameHead{\tmpNamePrefix head.ly}
\newwrite\tmpFileHead
% paper definition part, included by main file
\def\tmpNamePaper{\tmpNamePrefix paper.ly}
\newwrite\tmpFilePaper
% tail part, included by main file  
\def\tmpNameTail{\tmpNamePrefix tail.ly}
\newwrite\tmpFileTail
% name of pdf construced by lilypond from the files above
\def\tmpNamePdf{\tmpNamePrefix .pdf }
% name of fragment count file (also provided by lilypond)
\def\tmpNameFragCount{\tmpNamePrefix -systems.count }
\newread\fragcountfile

% Define some counters
%==
\newcount\fragcount % holds the number of the lilyfrag environment
\newcount\fragpagecount % holds the number of pages in the pdf constructed by lilypond
\newcount\fragpagenum % holds the page number currently processed


% This defines how we call lilypond. Don't change the parameters unless you really
% know what you are doing:

\def\lilycommand{lilypond -b -dbackend=eps -dgs-never-embed-fonts=\#t -dfont-export-dir=./ }

%
% The following code is needed by the definition of the lily* environments below.
% The typical lilypond user does not need to understand what's going on here below:
%

{
  \catcode`|=0 \catcode`[=1 \catcode`]=2 \catcode`\#=12
  \catcode`\{=12 \catcode`\}=12 \catcode`\\=12
  |gdef|eohead[\end{lilyhead}]
  |gdef|eofrag[\end{lilyfrag}]
  |gdef|eotail[\end{lilytail}]
  |gdef|hashtag[#]
  |gdef|escape[\]
  |gdef|definepaper[\definepaper]
]

{
  \obeylines
  \gdef\doline#1
  {
\def\oneline{#1}
\ifx\oneline\eohead\def\next{\end{lilyhead}}\else
\ifx\oneline\eofrag\def\next{\end{lilyfrag}}\else
\ifx\oneline\eotail\def\next{\end{lilytail}}\else 
\ifx\oneline\definepaper\immediate\write\tmpFile{\escape include "\tmpNamePaper"}\let\next\doline
\else\immediate\write\tmpFile{\oneline}\let\next\doline
\fi\fi\fi\fi\next%
  }
}

%
% Define the lilyhead, lilytail and lilyfrag environments.
%
% The lilyhead environment has no arguments. Lilypond 

Re: Creating marginal comments?

2016-11-30 Thread Knut Petersen

Am 29.11.2016 um 13:02 schrieb tapani:

I am producing a hymnal, using Lilypond and lilypond-book with xelatex. I
would like to insert biblical references in the margin of the page, parallel
with the lyrics.

For example, in "Hark, the Herald Angels Sing", the lyrics "Ris'n with
healing in his wings" would have "Mal. 4:2" in the margin.

In TeX like systems, this is easily done with the \marginnote command.



So do use TeX ;-) Put the attached files in an empty directory, don't forget to 
make mkhymex and mypdfcrop
executable, then run ./mkhymex. You'll get an 8-page hymnal book with some 
example marginal notes.
Two A5 pages on every side of an A4 sheet, correctly arranged for printing.

hymex.tex is the hymnal example file to be compiled by lualatex or xelatex.
mkhymex is a script to translate hymex.tex to hymexc.pdf.
mypdfcrop is needed because pdfcrop is broken for pdfs without embedded fonts.

Only recent versions of luaLatex and xelatex will work. For lualatex that means 
version 0.8x won't work.
hymex.tex requires quire.tex provided by the midnight macro package.

You need a recent lilypond. Recent means very recent. The 
"-dgs-never-embed-fonts" must be present.

You need ghostscript. You'll need the current version.

cu,
 Knut
#!/bin/bash

xelatex --shell-escape hymex.tex
if [ $? -ne 0 ]; then echo "ABORT";exit;else echo "OK";fi

gs -dNOPAUSE -q -sDEVICE=pdfwrite -dBATCH -sOutputFile=hymexc.pdf *.font.ps 
hymex.pdf
if [ $? -ne 0 ]; then echo "ABORT";exit;else echo "OK";fi

rm -f tmplily* hymex.log hymex.aux
#!/bin/bash

SOURCE=$1.pdf
TARGET=$1-crop.pdf

HRBB=`gs -sDEVICE=bbox -dBATCH -dNOPAUSE -c save pop -f *.font.ps -f $SOURCE 
2>&1 | \
  grep "%%HiResBoundingBox:" | \
  sed -e "s/%%HiResBoundingBox: \([[:print:]]*\)/\1/"`

echo Cropping $SOURCE, result is $TARGET
gs  -o $TARGET -sDEVICE=pdfwrite -dEmbedAllFonts=false -dUseCropBox=true -c 
"[/CropBox [$HRBB] /PAGES pdfmark" -f *.font.ps -f $SOURCE 2>&1 > /dev/null
\NeedsTeXFormat{LaTeX2e}
%
% Übersetzen mit "lualatex --shell-escape wm15fom"
%
\documentclass[11pt]{letter}
%
% Der Einfachheit halber verwenden wir hier geometry zum
% Setzen der diversen Seitenparameter und im Anschluß das
% uralte quire.tex aus den Midnight Macros, um je zwei Seiten
% auf einen A4-Bogen zu kombinieren.
%
\usepackage{geometry}
\geometry{papersize={14.85cm,21cm},left=1.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm,twoside,
 marginparsep=3mm,marginparwidth=1.9cm}
\input quire.tex
   \paperwidth=2\paperwidth  \shhtotal=\paperwidth   \htotal=0.5\paperwidth
   \vtotal=\paperheight  \horigin=1in\vorigin=1in
   \shvoffset=-1in   \shvcorrection=0pt  \shthickness=0pt
   \shhcorrection=0pt\shoutline=0pt  \shstaplewidth=0pt
   \shstaplelength=0pt   \shcrop=0pt \shfootline={}
   \def\supereject{\par\penalty-2}
   \latexquire   \quire{8}
\usepackage[english,german]{babel}
\selectlanguage{german}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\DeclareUTFcharacter[\UTFencname]{x201C}{\grqq}
\DeclareUTFcharacter[\UTFencname]{x201E}{\glqq}
\setmainfont{CMU Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\usepackage{graphicx}
\usepackage{shellesc}
\usepackage{soul}
\usepackage{calc}


\def\tmpNamePrefix{tmplily}
\def\tmpFragPrefix{\tmpNamePrefix frag}
\def\tmpNameFull{\tmpNamePrefix .ly}
\def\tmpNameHead{\tmpNamePrefix head.ly}
\def\tmpNamePaper{\tmpNamePrefix paper.ly}
\def\tmpNamePdf{\tmpNamePrefix .pdf }
\def\tmpNameTail{\tmpNamePrefix tail.ly}

\def\lilycommand{lilypond -b -dbackend=eps -dgs-never-embed-fonts=\#t -dfont-export-dir=./ }

\newwrite\tmpFileMain
\newwrite\tmpFileHead
\newwrite\tmpFileTail
\newwrite\tmpFilePaper

\newread\fragcountfile

\newcount\fragcount
\newcount\fragpagecount
\newcount\fragpagenum

{
  \catcode`|=0 \catcode`[=1 \catcode`]=2 \catcode`\#=12
  \catcode`\{=12 \catcode`\}=12 \catcode`\\=12
  |gdef|eohead[\end{lilyhead}]
  |gdef|eofrag[\end{lilyfrag}]
  |gdef|eotail[\end{lilytail}]
  |gdef|hashtag[#]
  |gdef|escape[\]
  |gdef|definepaper[\definepaper]
]

{
  \obeylines
  \gdef\doline#1
  {
\def\oneline{#1}
\ifx\oneline\eohead\def\next{\end{lilyhead}}\else
\ifx\oneline\eofrag\def\next{\end{lilyfrag}}\else
\ifx\oneline\eotail\def\next{\end{lilytail}}\else 
\ifx\oneline\definepaper\immediate\write\tmpFile{\escape include "\tmpNamePaper"}\let\next\doline
\else\immediate\write\tmpFile{\oneline}\let\next\doline
\fi\fi\fi\fi\next%
  }
}

\makeatletter

\newcommand{\zeit}[2]{#1%
 \sbox\z@ T%
 \vbox to\ht\z@{\hbox{\check@mathfonts
 \fontsize\ssf@size\z@
 \math@fontsfalse\selectfont
 \setul{.17em}{.03em}\,\ul{#2}\resetul}%
 \vss}~Uhr}
 
 
\newenvironment{lilyfrag}[2]{
  \global\advance\fragcount by 1
  \immediate\openout\tmpFileMain=\tmpNameFull
  \gdef\tmpFile{\tmpFileMain}
  \immediate\write\tmpFileMain{\escape include "\tmpNameHead"}
  \immediate\openout\tmpFilePaper=\tmpNamePaper
  

Re: Getting a new computer

2016-11-21 Thread Knut Petersen

Am 17.11.2016 um 16:19 schrieb Knut Petersen:

Hi Vaughan!


I’ve included a large project if anyone with a newish computer would like to 
test their compilation time. The main file is MDSM.ly. It takes my computer 
between 4 and 5 minutes to compile.




I tried my old computer ... Pentium-M Dothan 1.86 GHz on an AOpen i915GMm-hfs 
mobo with 2 GB RAM.
One hardware update: OpenSuSE linux system installed on SSD, all the other 
parts are older than 11 years.
That old machine only needs  between 138 and 140 seconds!

The old machine takes about 5 times longer to compile your score than my fast 
PC, and more than 50% of that
is related to the increased system clock.

But: If I do a full build of lilypond, the old machine takes about 23 times as 
long as the modern computer ;-)

Some further comments: With some slight modifications you could compile Agnus, 
Credo, etc as individual scores
and combine the pdf using a program like pdftk. That reduced the time to build 
the pdf to a bit less than 8 seconds
on the modern hardware.

cu,
 Knut


My system:
=
   mainboard:  asus h97 pro gamer
   cpu: i7-4790K, 4.00 Ghz (turbo speed: up to 4.4 GHZ,)
   SSD: Samsung SSD 850 PRO 512GB
   os: Linux, based on openSuSE Tumbleweed
   For the test I used lilypond 2.18.2.

Compile times:

   1st run: 27,123 seconds
   2nd run: 26,697 seconds
   3rd run: 26,700 seconds
   4th run: 26,901 seconds



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


Re: Trolling and unacceptable behaviour on the list

2016-11-18 Thread Knut Petersen

Hi Andrew!

As long as he uses his identity mclaren, you need to remember to ignore that 
one name. If mclaren
would be banned, there probably would be a ferrari to ignore ... now you would 
need to ignore two
names. The list administrator could also excommunicate ferrari ... maybe a 
porsche would appear ;-)

Excommunication does not help against trolls, they have enough names and 
addresses for free.

cu,
 Knut

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


Re: Solution to 7 over sqr(71) time against integer polyrhythms

2016-11-18 Thread Knut Petersen

Hi Carl!

There is a GNU library for arbitrary precision rationals.  It may be
possible to replace the LilyPond Rational type with an arbitrary precision
rational type.  Then the ability to go to big nested tuplets would be
limited by the amount memory (perhaps the amount on the heap or the stack).


MetaPost had a problem with precision requirements. Nowadays you might choose
between four different number systems. Appendix A of the metapost manual gives
more informtion about that and the libraries used ...

cu,
 Knut

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


Re: Getting a new computer

2016-11-17 Thread Knut Petersen

Hi Vaughan!


I’ve included a large project if anyone with a newish computer would like to 
test their compilation time. The main file is MDSM.ly. It takes my computer 
between 4 and 5 minutes to compile.


My system:
=
   mainboard:  asus h97 pro gamer
   cpu: i7-4790K, 4.00 Ghz (turbo speed: up to 4.4 GHZ,)
   SSD: Samsung SSD 850 PRO 512GB
   os: Linux, based on openSuSE Tumbleweed
   For the test I used lilypond 2.18.2.

Compile times:

   1st run: 27,123 seconds
   2nd run: 26,697 seconds
   3rd run: 26,700 seconds
   4th run: 26,901 seconds


For lilypond single thread performance is critical ... the high turbo speed of 
the
i7-4790K helps a lot. An i7-6700K will probably be slightly slower,  a system
built around an i7-7700K will probably be slightly faster.

Put your system on a fast SSD. Nowadays there are SSDs faster than the one I 
use.

Use HGST hard disks.

cu,
 Knut


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


Re: Skyfonts

2016-11-06 Thread Knut Petersen

Am 07.11.2016 um 06:44 schrieb Andrew Bernard:


The question is, since they are not in the standard sort of location, is 
lilypond able to make use of such fonts at all? So far, I have been unable to 
persuade it to do so.


You should be able to produce a pdf containing either a subset or a full copy 
of the font you want to use in lilypond.
A great number of tools allows to extract font objects from pdfs (ghostscript, 
mutool, fontforge, ...). Lilypond should
be able to use the extracted fonts. Be aware of the fact that all this might be 
illegal in your country .

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


Re: Horizontal alingment of lyrics hyphens?

2016-09-28 Thread Knut Petersen

Am 27.09.2016 um 16:34 schrieb David Kastrup:

Urs Liska  writes:


But in general the advantage of a feature being solvable in the Scheme
domain is that it can be done in the "user space", that is, without
having to compile LilyPond yourself. This is not only lowering the
entry barrier but actually makes it possible to implement and test
features on all supported platforms and not only on Linux.

That's not all of it.  If you had to modify LilyPond's scm/*.scm files,
you'd still have most disadvantages of hard code modification, in
particular your changes not surviving an upgrade of the LilyPond
installation.

"git pull --rebase" is a close friend of mine ;-)

There is one problem with people relying on binaries instead of
building and improving lilypond itself: Almost nobody seems to be able to
bisect a problem. It's e.g. amazing to see how long it takes to track down
the speed problem on Mac OS systems.


The main advantage of solving problems at the user Scheme level (rather
than the core Scheme level) is that your problems tend to stay solved
while upgrading LilyPond.

I have to agree, although I still really do not like scheme. But solving the
the problem of optinal vertical alignment of lyric hyphens would require
to delay generation of the lyric hyphen stencils and to  hook into lilyponds
internals at a time when all lyric spanners of a system are known. I cannot
see where this could be done with reasonable effort. Any idea?

Cheers,
 Knut


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


Re: Video generation, bash script, keeps sync in spite of tempo changes

2016-09-28 Thread Knut Petersen

Am 27.09.2016 um 23:43 schrieb Dr. Thomas Tensi:

There is also another python script written by me
and mentioned in a message in this group from
March 6th. Funnily it seems to be a mixture of
the approaches of Knut Petersen and ly2video.



the python file plus some demos can be downloaded at
http://www.tensi.eu/thomas/iPod/notation-video.zip


Your script fails here because lilypond generates ".midi" files, not  ".mid" 
files on linux systems.
Line 983 could be changed to

Processing._midiFileName   = _pictureFileStem + ".midi"

to cure that problem. A better idea would be to add

 #(ly:set-option 'midi-extension "mid")

to  notationVideo.ly as this will not break other systems.

After that minor modification the script succeeds to produce bach_639.mp4
with lilypond 2.18.2 on linux. Unfortunately some later changes in lilypond 
2.19.x break
your program, it only builds temp1.mp4, not the mp4 files for the succeeding 
pages.



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


Re: Horizontal alingment of lyrics hyphens?

2016-09-27 Thread Knut Petersen

Am 25.09.2016 um 11:34 schrieb Simon Albrecht:



Simon showed how to whiteout barlines, but Krzysztof also asked about aligning 
hyphens in verses. Have a look
at the attached pdf and compare Lilyponds output to the hand-engraved original.


Seems like a good feature request. Could you please write a concise description 
with the examples, preferably as images, and write to bug-lilyp...@gnu.org?
Best, Simon


Any non-hackish solution would be anything but trivial, and I doubt that there 
is enough interrest in that area.
One example: The feature request to allow the use of the original hyphen of the 
lyrics font is more than 6 years old ;-)

A sketch of a hackish solution:

Use some kind of marker mechanism, change lyric-hyphen.cc a bit to pass that 
marker information
to the postscript output, postprocess that file and finally generate the pdf.

A marker could be e.g. something like "ch = { \once \override 
Lyrics.LyricHyphen.thickness = #-1.3 }" , used in
a lyric definition like foo = \lyricmode {Ro -- bins \ch Hoch -- zeit gehn wir 
heut; }.

Intercepting the negative thickness in lyrics-hypen.cc is easy, a colored box 
giving the information about
the spanner bounds could be emitted. (See attached file)

Identifying such marked places in the postscript code is easy again, you only 
have to look for the appropriate
setrgbcolor command:

gsave 0. 1. 0. setrgbcolor
109.2199 -47.9884 moveto 7.7519 0.0558 0.0446 0.4646 0.0893 draw_round_box
grestore

gsave 0. 1. 0. setrgbcolor
111.0878 -40.9884 moveto 4.9000 0.0558 0.0446 0.4646 0.0893 draw_round_box
grestore

gsave 0. 1. 0. setrgbcolor
109.2199 -51.4884 moveto 7.1896 0.0558 0.0446 0.4646 0.0893 draw_round_box
grestore

These postscript command blocks then would  be replaced by code to generate 
hyphens according
to a set of alignment and spacing  rules yet to be formulated ...

Advantages of this solution: All that could be done in c / c++ / postscript, no 
need for scheme.
As there is no need to understand and change the blackbox lilypond it's much 
easier and faster
to implement.

Cheers,
 Knut

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


Re: Horizontal alingment of lyrics hyphens?

2016-09-25 Thread Knut Petersen

Am 19.09.2016 um 19:01 schrieb Phil Holmes:


Generally, songs with lyrics are set with a ChoirStaff rather than a 
StaffGroup.  These do not have barlines spanning the space between the staves, 
and so the problem does not occur.


IMHO: The LyricHyphen code in lilypond is able to handle only the most simple 
cases in an acceptable way.

Simon showed how to whiteout barlines, but Krzysztof also asked about aligning 
hyphens in verses. Have a look
at the attached pdf and compare Lilyponds output to the hand-engraved original. 
I think it's pretty clear that
lilypond is not the winner of the race.

cu,
 Knut


LyricHyphenComp.pdf
Description: Zip archive
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Horizontal alingment of lyrics hyphens?

2016-09-25 Thread Knut Petersen

Hi Simon!


I use the following in my standard style sheet:



   \override LyricExtender.whiteout-style = #'outline


I recommend to use whiteout-box here as it will translate to much smaller 
ps/pdf code and should give identical results.


\override LyricHyphen.whiteout-style = #'outline


\override LyricHyphen.whiteout = 1.4 


whiteout-box obviously isn't an option here. But I prefer higher values for 
LyricHyphen.whiteout, and
stencil-whitout-outline is broken if whiteout is big compared to the height of 
the object, see attached
file WhiteoutOrig.jpg where the whiteout areas are marked red.

There is an easy fix for the problem: Increase angle-increments and 
radial-increments in scm/stencil.scm.
For a higher LyricHyphen.whiteout of 4 I recommend the following changes:

Original:

   (define*-public (stencil-whiteout-outline
stil #:optional (thickness 0.3) (color white)
(angle-increments 16) (radial-increments 1))

Edited

(define*-public (stencil-whiteout-outline
stil #:optional (thickness 0.3) (color white)
(angle-increments 32) (radial-increments 3))

See WhiteoutImproved.jpg to verify that stencil-whiteout-outline works 
correctly for hyphens after this change.

BUT: Using stencil-whiteout-outline will dramatically increase file size:
example.pdf without whiteout: 113.185 bytes
The same source with LyricHyphen.whiteout=outline 160.400 bytes
The same source with edited LyricHyphen.whiteout=outline 342.336 bytes

I think we need some optimization here, but LyricHyphen needs a serious 
overhauling anyway.
Here it would help a lot if _every_ hyphen would be a grob as then we could use 
whiteout-box.

cu,
 Knut

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


Re: Lyric tie inside word?

2016-09-16 Thread Knut Petersen

Am 16.09.2016 um 21:59 schrieb Thomas Morley:

2016-09-16 13:20 GMT+02:00 Knut Petersen <knut_peter...@t-online.de>:

Am 06.05.2015 um 01:08 schrieb Thomas Morley:

I had a hard time to find that code, I needed some kind of tunable \undertie


Well,

commit 4e9fd2773a496f31bf6f3a2c1a900fbc4d647487
Author: Thomas Morley thomasmorle...@gmail.com
Date: Tue Nov 3 22:05:50 2015 +0100


rotfl ;-)

http://lilypond.org/doc/v2.19/Documentation/notation/common-notation-for-vocal-music#multiple-syllables-to-one-note
definitely does need an update ;-)

Cheers,
 Knut

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


Re: moving notes in cue-voice must not influence dot after notehead in main voice

2016-09-16 Thread Knut Petersen

Am 16.09.2016 um 13:48 schrieb Malte Meyn:

Ok  it was to M ;-) It's from bar 26/27 of this score. 

Attached: snippet from the original score.

\version "2.19.49"
mezmus = {
  \key c \major
  \autoBeamOff
  \relative b' {
\time 2/4 b4 gis \breathe a2 e4 \breathe
  << \new Voice {\voiceTwo e'4. 8 4}
 \new CueVoice { \voiceOne %\stemDown
\override NoteColumn.force-hshift = 1.0 a,4.
\override NoteColumn.force-hshift = 1.2  8
\override NoteColumn.force-hshift = 0.4 b4} >>
cis a b cis b2 a
  }
}
\score {
  \new Staff = mezzos << \new Voice = "mezzo" { \mezmus } >>
  \layout {
\context {
  \Score \hide BarLine
}
  }
}

cu,
 Knut



mweorig.pdf
Description: Zip archive
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


moving notes in cue-voice must not influence dot after notehead in main voice

2016-09-16 Thread Knut Petersen

Hi everybody!

I used

  <<
   \new Voice {\voiceTwo e'4. 8 4}
   \new CueVoice { \voiceOne
  \override NoteColumn.force-hshift = 0.4a,4.
  \override NoteColumn.force-hshift = 1.2  8
  \override NoteColumn.force-hshift = 0.4 h4}
  >>

to tell lilypond to engrave some alternative notes as a
cue voice. But moving the colliding notes also moves
the dot of the normal voice, giving an unpleasant look.
There seems to be no force-hshift for DotColumn.

\stemDown helps a bit, but to avoid unacceptable space
between notehead and dot in the main voice it's necessary
to use a small force-hshift, and the result is far from
optimal.

Any ideas?

Cheers,
 Knut

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


Re: Lyric tie inside word?

2016-09-16 Thread Knut Petersen

Am 06.05.2015 um 01:08 schrieb Thomas Morley:

I had a hard time to find that code, I needed some kind of tunable \undertie for Hugo 
Distler: Mausfallensprüchlein 

I think that "ratio" should probably be tunable. Any idea why the code  has not 
already been
incorporated into lilypond?

cu,
 Knut


2015-05-06 1:02 GMT+02:00 Tobias Braun :

Never mind. It's working now, thanks a lot!

Good night,
Tobias


Am 06.05.2015 um 00:51 schrieb Simon Albrecht :


So sorry. I should’ve tested the code before posting…
You need to use \line { } instead of a simple string in "". See attachment.


Am 06.05.2015 um 00:41 schrieb Tobias Braun:

I got it to work in \lyricmode now, but it still won't work in the \markup 
section.

If I do it like you say below, I just get the code printed in the lyrics. If I end the string 
before \override and start a new one after "köñiglichen", it works, but then I get line 
breaks around "königlichen". Adding \markup doesn't improve things either.

What exactly do "\override #'(word-space . 0)" and "\tied-lyric" do? When using "\override #'(word-space 
. 0)" inside a \lyricmode expression, "~" won't create a lyric tie (with a blank) anymore, but just literally 
print "~". I have to explicitly use \tied-lyric then.

They are markup commands. \override (the markup command) takes two arguments: a pair and 
a markup. The pair consists of property and value, given in Scheme syntax: #'(word-space 
. 0). The markup is produced using \tied-lyric, which takes a string (a series of 
characters enclosed in "") as its argument, again prefixed with # to make it a 
Scheme expression. And in order to use them in \lyricmode, you have to enclose them in 
\markup explicitly.

I hope that makes it a little clearer. Ein weites Feld…
Good night, :-)
Simon



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

How about:


\version "2.19.18"

%% https://code.google.com/p/lilypond/issues/detail?id=3088
%% extended

%%FIXME: add `\undertie "undertied"' to regression/markup-commands.ly

%% FIXME: c from stencil.scm -- define-public and remove copy
#(define (make-bezier-sandwich-stencil coords thick xext yext)
   (let* ((command-list `(moveto
 ,(car (list-ref coords 3))
 ,(cdr (list-ref coords 3))
 curveto
 ,(car (list-ref coords 0))
 ,(cdr (list-ref coords 0))
 ,(car (list-ref coords 1))
 ,(cdr (list-ref coords 1))
 ,(car (list-ref coords 2))
 ,(cdr (list-ref coords 2))
 curveto
 ,(car (list-ref coords 4))
 ,(cdr (list-ref coords 4))
 ,(car (list-ref coords 5))
 ,(cdr (list-ref coords 5))
 ,(car (list-ref coords 6))
 ,(cdr (list-ref coords 6))
 closepath)))
   (ly:make-stencil
 `(path ,thick `(,@' ,command-list) 'round 'round #t)
 xext
 yext)))

%% FIXME: rewrite generic wrt axes and replace make-parenthesis-stencil
#(define (make-bow-stencil width height thickness angularity)
  "Create a bow stencil.
  @var{width} is the width of the bow markup.
  @var{thickness} is the thickness of the bow.
  @var{height} is the heigth of the bow.
  The higher the value of number @var{angularity},
  the more angular the shape of the bow."
(let* ((line-width 0.1)
   (base-x (if (< width 0) (- width) 0))
   (base-y (if (< height 0) (- height) 0))
   (x-extent (ordered-cons 0 width))
   (y-extent (ordered-cons 0 height))
   (left-x (interval-start x-extent))
   (right-x (interval-end x-extent))
   (inner-y 0)
   (outer-y height)
   (left-end-point (cons left-x inner-y))
   (right-end-point (cons right-x inner-y))
   (outer-control-y (+ inner-y (* 4/3 outer-y)))
   (inner-control-y (+ outer-control-y
  (if (< height 0) thickness (- thickness
   ;; keeping angularity allows for refactoring and
   ;; merging with make-parenthesis-stencil
   (offset-index (- (* 0.6 angularity) 0.8))
   (left-control-x (interval-index x-extent offset-index))
   (right-control-x (interval-index x-extent (- offset-index)))
   (left-outer-control-point
  (cons left-control-x outer-control-y))
   (right-outer-control-point
  (cons right-control-x outer-control-y))
   (right-inner-control-point
  (cons right-control-x inner-control-y))
   (left-inner-control-point
   

Re: Write a custom backend?

2016-09-14 Thread Knut Petersen

Am 14.09.2016 um 12:19 schrieb David Kastrup:


Of course it is not "necessary to rewrite the code in Scheme first"
before making changes to it.  But for one thing, not a lot will happen
without it, for another, without some generally useful output definition
possibilities, backends like Braille, MusicXML, and others will require
individual programming and end up, if at all, individually maintained.

That's why I said "great project".  Not "prerequisite".


Thanks, I understand that point now.

Currently we have \layout{} and \midi{}. What backends would be fine to have?
You mentioned \braille{} and \musicxml{}, I'd like to add \audio{} and \video{}
to the list.

Maybe there should be some kind of stripped down generic backend
example first (like those example drivers in the linux kernel) to help people
to understand how to integrate a backend driver and hopefully boost
developement of real drivers?

Cheers,
 Knut

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


Re: Write a custom backend?

2016-09-14 Thread Knut Petersen

Am 13.09.2016 um 14:04 schrieb David Kastrup:



I believe the output backend principle is a good sign of extensibility
but is it really the case? How to instruct Lilypond to use a custom
one, then?

You'd have to make use of one of the existing translator groups (like
Engraver_group or Performer_group) which might me more accurately called
translator groupers: there is currently no way to define those in
Scheme.

Personally, I'd consider it a great project to convert _all_ of Midi
generation to Scheme.


Why? We need more details of the music going into \midi{}, but it is
necessary to rewrite the code in scheme first?

Cheers,
 Knut

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


Re: Video generation, bash script, keeps sync in spite of tempo changes

2016-09-14 Thread Knut Petersen

Am 13.09.2016 um 02:29 schrieb Paul:

Hi Knut,

Sounds cool!  I'd like to check it out when I get a chance.  I'm curious how it 
compares with ly2video?

https://github.com/aspiers/ly2video 


Some differences between my script and ly2video.py:
=
-> ly2video supports older versions of lilypond, my script needs at least 
version 2.19.23
->  ly2video requires clean 7-bit source files, it's almost unusable for vocal 
music if the lyrics text
  requires characters from european languages that use diacritics (german, 
french, ...) or completely
  different characters (russian ). My script does not have this 
limitation.
-> ly2video is very slow compared to my script (see below), especially on a 
multi-core cpu
-> ly2video files are big, even if you turn off the cursor
-> ly2video uses a single very long system and cuts part from that. This is a 
problem if the
 number of instruments used is not constant.
-> my script does not generate a cursor as I believe that it is useless --- if 
you know how to read
 music, you do not need it, if you don't know how to read music it does not 
help either.
-> There are some bugs in ly2video that cause it to loose sync sometimes (but 
there are probably
 bugs in my script / videohelper.ily too)

Some measurements
=

Test: Converting a lilypond source of J.S. Bach Invention Nr. 1
System: OS: Linux, cpu: i4790K cpu

ly2video, set to generate no cursor and identical Y-resolution
==
Processing time: 63.0 +/- 0.5 seconds
size of video file: 10.498.048 bytes

My script with h264 preset "ultrafast"
===
Processing time: 6.45 +/- 0.15 seconds (includes lilypond processing time of 
1.0 +/- 0.05s)
size of video file: 4.134.850 bytes

My script with h264 preset "veryslow"
===
Processing time 12.5 +/- 0.1 seconds (includes lilypond processing time of 1.0 
+/- 0.05s)
size of video file: 1.843.136 bytes

Attached find a new version of my script and an example source

Changes: -> Add metronome ticks at start of music
-> remove temporary files
-> limit number of parallel jobs to (virtual or real) cpu cores 
+ 1
-> fix a bug in videohelper.ily
Missing :  -> errors are ignored most of the time ...

cu,
 Knut

#!/bin/bash

##
# Copyright (C) 2016 Knut Petersen (knut_peter...@t-online.de)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
##

# FPS=n: video files will use n frames per second
FPS=25
# TITLETIME: number of seconds the title page shall be visible
TITLETIME=6.0
# AFTERTIME
AFTERTIME=4.0
# PRESET: x264 preset to be used by ffmpeg for final output
PRESET=veryslow
PRESET=ultrafast
# DEBUG: n != 0 turns on debugging mode (verbose output)
DEBUG=0
# CLEAN: n != 0 enables deletion of all temporary files
CLEAN=1

FAIL=0

function weneedprog {
 for P in $@; do
   TMP=`which $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

function weneeddata {
 for P in $@; do
   TMP=`ls -q $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

echo checking dependencies ...
weneedprog ls sort tail uniq grep sed usleep bc gs pdftk lilypond fluidsynth 
sox ffmpeg
weneeddata /usr/share/sounds/sf2/FluidR3_GM.sf2 videohelper.notes
if [ $FAIL -ne 0 ]; then
  echo $FAIL missing dependencies, aborting
  exit 1
else
  echo dependencies ok
fi

function checknotes {
  grep "$1" videohelper.notes &> /dev/null
  if [ $? -ne 0 ]; then
 echo Fatal error: $2
 exit 2
  fi
}

echo checking videohelper.notes ...
checknotes "LILYSOURCE" "LILYSOURCE undefined"
checknotes "VIDEOSOURCE" "VIDEOSOURCE undefined"
checknotes "MIDISOURCE" "MIDISOURCE undefined"
checknotes "tempo" "no tempo definition"
checknotes "note" "not a single note event"
checknotes "page 1 contains no music" "no title page defined"
checknotes "[0-9.]* page" "not a single page"
echo videohelper.notes ok

TDIR=`mktemp -d mkvideo-X`

eval `grep LILYSOURC

Re: polymetric music with mensuration lines

2016-09-11 Thread Knut Petersen



   2: There needs to be some more space between the clefs and the first notes


The solution to that problem is to increase first-note minimum-fixed-space, 
e.g.:

 \override Staff.Clef #'space-alist = #'(
(ambitus extra-space . 2.0)
(staff-bar extra-space . 0.7)
(key-cancellation minimum-space . 4.0)
(key-signature minimum-space . 4.0)
(time-signature minimum-space . 4.2)
(first-note minimum-fixed-space . 12.0) ; increased !
(next-note extra-space . 0.5)
(right-edge extra-space . 0.5))


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


Re: polymetric music with mensuration lines

2016-09-11 Thread Knut Petersen

Hi Pierre!

Hi Knut,
I’m afraid this is not easy to achieve. The „Mensurstriche“ in LilyPond are 
technically SpanBars, and they can only be drawn between two bar lines on the 
adjacent staves, and MultiMeasureRests can’t cross barlines. Which incidentally 
also shows that Distler’s concept isn’t flawless…
The easiest solution would be to choose a different way of notation and change defaultBarType: 


I came up with the attached partial solution, a layout with shortened
mensuration lines. But two problems remain up to now:

   1: I need a working \bar "|." at the end of the score ( or something that 
looks like it ;-) )
   2: There needs to be some more space between the clefs and the first notes

Cheers,
 Knut
\version "2.19.48" % git 5944d20489bb5b8e4c4907fa3b3bcae9ec275ccb

%
% Engraved 2016-09, Knut Petersen
%

global= {
  \key c \major
  \override NoteHead.style = #'baroque 
  \override Staff.BarLine #'hair-thickness = #0.5
  \set Staff.soloText = #""
  \set Staff.soloIIText = #""
  \set Staff.aDueText = #""
}

sopmus = {
  \global
  \set Staff.midiInstrument = #"pan flute"
  \relative c'' {
\time 3/4 \tempo \markup { \medium { Gemächlich rasche } \fontsize #-2 \note-by-number #1 #1 #1.0 }
c2 a2 4 4 g2 f4 c' c c c c d e d2 c4 \breathe f2 c4 es es es f c2 4 4 4 b c a?4. (g8 f 4 a) g2 f1.
\time 3/4 c'2 ^\markup { \fontsize #-2 \note-by-number #2 #0 #1.0 " = " \fontsize #-2 \note-by-number #2 #0 #1.0 }
4 f,2 g4 c,2. \breathe c'2 4 f,2 g4 c,2. \breathe c'2 4 f,2 g4 \time 2/4 c,1 \breathe
g'2 4 4 4 4 4 4 b b g2. \breathe 4 c c \time 3/4 g2 4 2. R2.
^\markup { "(immer "\fontsize #-2 \note-by-number #2 #0 #1.0 " = " \fontsize #-2 \note-by-number #2 #0 #1.0 ")"}
c2 4 f,2 g4 c,2. c'2 4 f,2 g4 c,2. \breathe f2 g4 c,2. f2 g4 c,2 \breathe c'4 c c a f2 4 \breathe c'2 4 4 4 a
\shape #'((0.5 . -1.0) (0 . 0.0) (0.0 . 0.0) (0 . 0.0)) Slur f4. (g8 a4 f g c, c'\breve.*3/4 ) c2. 
  }
}

sopal = {
  \global
  \relative c'' {
c2 a2 4 4 g2 f4 c' c c c c d e d2 c4 f2 c4 es es 
es f c2 4 4 4 b c a?4. (g8 f 4 a) g2 f2.~2. c'2 4 f,2 g4
c,2. c'2 4 f,2 g4 c,2. c'2 4 f,2 g4 c,2~2
g'2 4 4 4 4 4 4 b b g2~4 4 c c g2 4 2. R2.
c2 4 f,2 g4 c,2. c'2 4 f,2 g4 c,2. f2 g4 c,2. f2 g4 c,2 c'4
c c a f2 4 c'2 4 4 4 a f4. (g8 a4 f g c, c'\breve.*3/4 ) c2. 
  }
}

sopfoo = {
  \relative a' {
\override Staff.StaffSymbol.line-count = #0
\time 3/4 \repeat unfold 15 {s2.} \bar "||" 
\time 3/4 \repeat unfold  8 {s2.}
\time 2/4 \repeat unfold 10 {s2}
\time 3/4 \repeat unfold  2 {s2.} \bar "||" 
\time 3/4 \repeat unfold 21 {s2.}
  }
}

soplyr = \lyricmode {
  Früh -- ling läßt sein blau -- es Band wie -- der flat -- tern durch die Lüf -- te;
  sü -- ße, wohl -- be -- kann -- te Düf -- te strei -- fen ah -- nungs -- voll __ das "Land. " __
  Veil -- chen träu -- men schon, Veil -- chen träu -- men schon, Veil -- chen träu -- men "schon. " __
  Horch, horch, von fern ein lei -- ser Har -- fen -- "ton, " __ ein lei -- ser Har -- fen -- ton.
  Früh -- ling, ja, du bist's! Früh -- ling, ja, du bist's! Ja, du bist's! Ja, du bist's!
  Dich hab' ich ver -- nom -- men, dich, dich hab' ich ver -- nom -- men!
}

mezmus = {
  \global
  \set Staff.midiInstrument = #"pan flute"
  \relative a' {
\time 3/4
R2. R2. R2. r4 a a g4. (a8) b4 a f g2 f r4 b2
f4 as4 4 4 b f4. 8 4 4 c'2 4 c,2 4 f1. \time 2/4 R2 R2 R2
R2 R2 f4 4 c' a f4. (g8 a4 f g c, c'1) 2 \breathe 1
2 1 2 R2*6 \time 3/4 2 4 f,2 g4 c,2. c'2 4 f,2 g4 c,2. \breathe f2 g4 c,2. f2 g4 c,2 \breathe c'4 4 4 a
f2 f4  c'2 4 4 4 a4 
<< \partcombine
   { \new Voice=up \voiceOne  \relative f' { s1 g4 c, \shape #'((5 . 2.0) (10 . 1.0) (0.0 . -2.0) (0 . -2.0)) Slur f1 (g4 c, a' 1. ) a2. } }
   { \new Voice=down \voiceTwo \relative f' { \shape #'((0 . 3.0) (0 . 3.0) (0.0 . 2.0) (0 . 3.0)) Slur f1 ( s4 s4  s1  s4 c f 1. ) f2.} }
>>
  }
}

mezal = {
  \global
  \relative a' {
\time 3/4
R2. R2. R2. r4 a a g4. (a8) b4 a f g2 f r4 b2
f4 as4 4 4 b f4. 8 4 4 c'2 4 c,2 4 f2.~2. \time 2/4 R2 R2 R2
R2 R2 f4 4 c' a f4. (g8 a4 f g c, c'1) 2  1
2 1 2 R2*6 2 4 f,2 g4 c,2. c'2 4 f,2 g4 c,2. f2 g4 c,2. f2 g4 c,2 c'4 4 4 a
f2 f4  c'2 4 4 4 a4 f1 ( g4 c,  f1 g4 c, f 1. ) f2.
  }
}


mezfoo = {
  \relative a' {
\override Staff.StaffSymbol.line-count = #0
\time 3/4 \repeat unfold 15 {s2.} \bar "||" 
\time 2/4 \repeat unfold 25 {s2} \bar "||"
\time 3/4 \repeat unfold 21 {s2.}
  }
}


mezlyr = \lyricmode {
  wie -- der flat -- tern durch die Lüf -- te;
  sü -- ße, wohl -- be -- kann -- te Düf -- te strei -- fen ah -- nungs -- voll das Land. __
  wol -- len bal -- de kom -- men, kom -- men, kom -- men.
  Früh -- ling, ja, du bist's! Früh -- ling, ja, du bist's!
  Ja, du 

polymetric music with mensuration lines

2016-09-09 Thread Knut Petersen

Hi everybody!

Polymetric music is no problem, neiter are mensural lines.
But: Any idea to combine both with lilypond to achieve
something close to the attached example from Hugo Distler?

cu,
 Knut


ErIstsProblem.pdf
Description: Zip archive
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Video generation, bash script, keeps sync in spite of tempo changes

2016-09-06 Thread Knut Petersen
rom the context) and then adding all the
values.  The string ends with a newline."
   (let* ((moment (ly:context-current-moment context)))
(string-append
 (string-join
   (append
 (list (moment-grace->string moment))
 (map
 (lambda (x) (ly:format "~a" x))
 values))
   "\t")
 "\n")))


#(define (print-line context . values)
   "Prints the list of values (plus the score time) to a file, and
optionally outputs to the console as well.  context may be specified
as an engraver for convenience."
   (if (ly:translator? context)
   (set! context (ly:translator-context context)))
(display (make-output-string-line context values) out)
)

#(define (format-tempo engraver event)
   (print-line engraver
   "tempo"
   ( / 60
(* (ly:event-property  event 'metronome-count)
(format-moment (ly:duration-length (ly:event-property event 
'tempo-unit)))

#(define (format-rest engraver event)
   (print-line engraver
   "rest"
   (format-moment (ly:duration-length
   (ly:event-property event 'duration)

#(define (format-note engraver event)
 (print-line engraver
 "note"
 (format-moment (ly:duration-length
 (ly:event-property event 'duration)))
))

\layout {
  \context {
  \Voice
  \consists #(make-engraver
  (listeners
   (tempo-change-event . format-tempo)
   (rest-event . format-rest)
   (note-event . format-note)))
  }
}

\paper {
#(define (page-post-process layout pages) 
(print-pages-first-bar-numbers layout pages #t))
}

#(define* (print-pages-first-bar-numbers layout pages #:optional print-to-file)
  (let* ((lines (map (lambda (page) (ly:prob-property page 'lines)) pages))
 ;; list of systems of each pages
 (sys
   (map
 (lambda (line)
   (append-map
 (lambda (l)
   (let ((system-grob (ly:prob-property l 'system-grob)))
 (if (not (null? system-grob))
 (list system-grob)
 system-grob))
   )
 line))
 lines))
 (sys-moment-location
   (map
 (lambda (m)
   (if (and (not (null? m)) (ly:grob? (car m)))
   (grob::when (car m))
   #f))
 sys))
 (formatted-output
   (map
 (lambda (page m)
   (if m
   (format #f "~a page ~a\n" (format-moment m) page)
   (format #f "page ~a contains no music\n" page))
   )
 (iota (length pages) 1 1)
sys-moment-location))
 )
(if (not (null? sys-moment-location))
(begin
   (for-each (lambda (i) (display i out)) formatted-output))
(for-each display formatted-output 

#(format out "~a~a~a" "LILYSOURCE=" (ly:parser-output-name) ".ly\n")

pdfforvideo = #(define-void-function () () (format out "~a~a~a" "VIDEOSOURCE=" 
current-outfile-name ".pdf\n"))

midiforvideo = #(define-void-function () () (format out "~a~a~a" "MIDISOURCE=" 
current-outfile-name ".midi\n"))
#!/bin/bash

##
# Copyright (C) 2016 Knut Petersen (knut_peter...@t-online.de)
#
# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
##

FPS=25
TITLETIME=6.0
AFTERTIME=4.0

DEBUG=0
CLEAN=1

FAIL=0

function weneedprog {
 for P in $@; do
   TMP=`which $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

function weneeddata {
 for P in $@; do
   TMP=`ls -q $P 2> /dev/null`
   if [ "x" == "x$TMP"  ]; then
  echo We need $P but could not find it!
  FAIL=$((FAIL+1))
   fi
 done
}

echo checking dependencies ...
weneedprog ls sort tail uniq grep sed bc gs pdftk fluidsynth sox ffmpeg
weneeddata /usr/share/sounds/sf2/FluidR3_GM.sf2 videohelper.notes
if [ $FAIL -ne 0 ]; then
  echo $FAIL missing dependencies, aborting
  exit 1
else
  echo dependenci

Re: intercepting implicit/explicit page breaks

2016-09-04 Thread Knut Petersen

Hi Thomas!

I once made: [...]



Thanks a lot, that was exactly what I was looking for.

Knut

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


  1   2   >