Re: Square bracket version of \left-brace markup

2018-04-20 Thread Karlin High

On 4/18/2018 6:30 PM, Aaron Hill wrote:
However, I would prefer to use a square bracket instead of the curly 
brace.  It seems like I will have to manually "draw" the bracket using 
markup functions and/or custom PostScript.


Has anyone here attempted something like this and can offer advice?


In the documentation, I came across the \lookup command while looking 
for something else.


"Lookup a glyph by name"


CTRL+F for \lookup


First heading has an example.

However, those examples are still doing curly braces. Does anyone 
better-versed in LilyPond's Emmentaler font know if it's possible to 
bring up a square bracket instead?

--
Karlin High
Missouri, USA

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


Re: Replacing a certain character sequence in lyrics

2018-04-20 Thread Simon Albrecht

On 20.04.2018 22:52, Thomas Morley wrote:
make-replace-markup 


Nice, thanks! I’d not have had any memory of there being such a markup 
function.


For the record, I attach what I’ll be working with.

Best, Simon
\version "2.19.80"
\include "ly-utility.ily"

#(define modernise-apostrophes? #f)
replaceDoubleApostrophes =
#(define-music-function (mus)(ly:music?)
   (music-map
(lambda (m)
  (if (music-is-of-type? m 'lyric-event)
  (let ((txt (ly:music-property m 'text))
(replacement (if modernise-apostrophes? "" "’")))
(if (string? txt)
(begin
 (ly:music-set-property! m 'text
   (make-replace-markup
(list (cons "’’" replacement))
txt))
 m)
m))
  m))
mus))
\addToplevelMusicFunctions replaceDoubleApostrophes

<<
  { 4 }
  \addlyrics { test’’ }
>>\version "2.19.53"

musicFunctionDummy = #(define-music-function (mus) (ly:music?) mus)

addToplevelMusicFunctions =
#(define-scheme-function (names) (symbol-list-or-symbol?)
   (let* ((name-list (if (list? names) names (list names)))
  (lookup-function (lambda (name) (let ((fn (ly:parser-lookup name)))
(if (equal? fn '())
musicFunctionDummy
fn
  (fn-list (map lookup-function name-list)))
 (set! toplevel-music-functions (append fn-list toplevel-music-functions___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


frescobaldi destination temp folder

2018-04-20 Thread Gianmaria Lari
When I want to try a lilypond snippet using Frescobaldi, I normally create
a new file and I compile it without save it explicitly. Frescobaldi saves
it for me in a temporary folder (in my Frescobaldi settings I have "Save
the document if possibile" checked).

For example if I do it now, in the lilypond log window I read:

Starting lilypond-windows.exe 2.19.81 [Untitled (4)]... Processing
`*C:/Users/GIANMA~1/AppData/Local/Temp/frescobaldi-n5pqsywf/tmp0fvvk0ae/document.ly
*' Parsing... Interpreting music... Preprocessing
graphical objects... Interpreting music...

.

So the termporary path where it is saving my lilypond source is

  C:/Users/GIANMA~1/AppData/Local/Temp/frescobaldi-n5pqsywf/tmp0fvvk0ae/
document.ly


I'm writing a small program that make some processing on the lilypond
source file and the pdf/png file and I would need this path information.
Does Frescobaldi writes this path in any (log) file? Alternatively, is
there any way to make Frescobaldi/lilypond writing the compile result in a
file as well as in the lilypond log window?

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


Re: Replacing a certain character sequence in lyrics

2018-04-20 Thread Thomas Morley
2018-04-20 17:53 GMT+02:00 Simon Albrecht :
> Hello everybody,
>
> I have a favour to ask from any LilyPond-Guile crack on the list, because I
> couldn’t quite figure it out myself: (technical requirement here, rationale
> in PS.)
>
> For a scholarly edition project, I’d like to have a global boolean variable
> and a toplevel music function that goes through all lyric syllables and
> replaces (for example) two apostrophes "’’" with either a single apostrophe
> "’" or nothing, depending on the value of that global switch variable. How
> could such a music function be done?
>
> Best, Simon
>
> PS. The reason behind this is: Haydn’s „Jahreszeiten“ use a lot of
> apostrophes in the original German text; some of them seem weird to the
> modern eye and don’t help understanding, while others are perfectly normal.
> I would like to be able to easily switch between modernising spelling in
> that regard or just leaving it as is, and I figured the way to go would be
> coding the ‘weird’ ones as double apostrophes and having a
> toplevel-music-function deal with them.

Probably:

\version "2.19.81"

#(define my-replacement-alist
  '(
("foo" . "Is")
("bar" . "this")
("buzz" . "what")
("ding" . "you")
("dong" . "want?")
("’’" . "’")
   ))

tst =
#(define-music-function (mus)(ly:music?)
  (music-map
(lambda (m)
  (if (music-is-of-type? m 'lyric-event)
  (let ((txt (ly:music-property m 'text)))
(if (string? txt)
(begin
  (ly:music-set-property! m 'text
(make-replace-markup my-replacement-alist txt))
  m)
m))
  m))
mus))

\tst
<<
  \new Voice = "v" { c'4 d' e' f' g'1 }
  \new Lyrics \lyricsto "v" { ’’foo bar buzz ding dong’’ }
>>

Cheers,
  Harm

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


Replacing a certain character sequence in lyrics

2018-04-20 Thread Simon Albrecht

Hello everybody,

I have a favour to ask from any LilyPond-Guile crack on the list, 
because I couldn’t quite figure it out myself: (technical requirement 
here, rationale in PS.)


For a scholarly edition project, I’d like to have a global boolean 
variable and a toplevel music function that goes through all lyric 
syllables and replaces (for example) two apostrophes "’’" with either a 
single apostrophe "’" or nothing, depending on the value of that global 
switch variable. How could such a music function be done?


Best, Simon

PS. The reason behind this is: Haydn’s „Jahreszeiten“ use a lot of 
apostrophes in the original German text; some of them seem weird to the 
modern eye and don’t help understanding, while others are perfectly 
normal. I would like to be able to easily switch between modernising 
spelling in that regard or just leaving it as is, and I figured the way 
to go would be coding the ‘weird’ ones as double apostrophes and having 
a toplevel-music-function deal with them.



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


Re: lyluatex: cannot increase the line width

2018-04-20 Thread Federico Bruni



Il giorno ven 20 apr 2018 alle 8:55, Urs Liska  
ha scritto:



Am 20. April 2018 08:51:09 MESZ schrieb Federico Bruni 
:

Hi all

Sorry if I use this list to ask questions about lyluatex, but I hope
that other are interested on the topic.

I'm trying to increase the width of a snippet.
In LilyPond I can easily do it by changing the line-width and setting
ragged-right to false.
I've tried the following for lyluatex but nothing changes:

$ cat width.tex
\documentclass{article}
\usepackage{lyluatex}
\begin{document}

\begin{lilypond}[relative,line-width=300pt,ragged-right=false]
c'4 d e f
\end{lilypond}

\end{document}

No matter which value I put, the output is always the same.
I'm missing something?


Not sure, but please repeat with the debug option and inspect/show 
the generated .ly file from the temp directory.




Here's what is generated:

$ cat tmp-ly/eae183bb374f8506e020007e23aa7751.ly
%%File header
\version "2.18.2"


\include "lilypond-book-preamble.ly"

#(define inside-lyluatex #t)
#(set-global-staff-size 16.6667)

\header {
   copyright = ""
   tagline = ##f
}
\paper{

   two-sided = ##f
   line-width = 300.00\pt
   indent = 0\pt


}
\layout{




}

%%Follows original score
\relative c' {c'4 d e f}


Don't you have to deal with ragged-last to make a single-system score 
wider than necessary?


No, ragged-right works. I've tried the lilypond snippet before copying 
it in the .tex file.


Here's an example:

\version "2.19.81"

\paper {
 ragged-right = ##f
 line-width = 13\cm
}

{ c'2 d' }




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


Re: Dotted notes

2018-04-20 Thread foxfanfare
Thomas Morley-2 wrote
> Please post some code. so that we can debug what's wrong and why.The code
> was developed with 2.19.81 so at least the example works for me.

Actually, if I just copy/paste your exemple above, I don't get any error
message it works fine, except that when I change the Staff.DotColumn.padding
= 0.7 or DotColumn.details.dots-padding-factor = 1.3, nothing happend!But
when I re-wrote another exemple, it just worked (even if I don't understand
why it didn't in your exemple...):But in the end (3 last staves), everything
works great! dots.pdf
  
Thomas Morley-2 wrote
> Really?I still see a collision with\paper {  #(define fonts   
> (set-global-fonts  #:music "beethoven"  #:brace "beethoven" 
> #:factor (/ staff-height pt 20)))}{ d'16.. }

Okay, here's something odd, test this instead:Sometimes it works, sometime
it fails! Weird isn't it?
Thomas Morley-2 wrote
> "Difficult" doesn't scare me, Au contraire. Anything else is boring :)

:-) Yest, but presently, lilypond's default is allready challenging for me
;-)



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: [Spam] Partcombine with rests

2018-04-20 Thread Lukas-Fabian Moser

Rutger,

So: add \partcombineApart before bar 2 in either of your voices. You 
can revert in two ways:

(1) \undo \partcombineApart
(2) \partcombineAutomatic


Ah, stupid me! I only tried \once \partcombineApart which didn't work. 
(I don't understand much of Lilypond's internals so can't tell what can 
work and what can't beforehand.)


Thanks much for the hint!

Lukas

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


Re: [Spam] Partcombine with rests

2018-04-20 Thread David Kastrup
Rutger Hofman  writes:

> On 20-04-18 08:46, Lukas-Fabian Moser wrote:
>> Folks,
>>
>> in the following example
>>
>> \version "2.19.80"
>>
>> One = \relative d'' {
>>    R1
>>    r8 d4 e8 f4
>> }
>>
>> Two = \relative g' {
>>    R1
>>    r4 e4 d2
>> }
>>
>> \new Staff \partcombine \One \Two
>
> As the docs state, the decision about which partcombiner mode to
> choose (Apart, Chords, SoloI, SoloII) is hard, and can frequently
> mismatch with the user's expectations. In that case, it is OK to
> specify the mode yourself.

That's a bit of a euphemism.  The main problem is that the part combiner
is really stupid with regard to dealing with note ends (basically it
doesn't): its operation is very much focused on note starts instead.  It
also does not have much of a notion of rests.

More often than not, it's not really a question of which rendering
should be chosen for best results but rather how to give the abysmally
stupid part combiner the right hints for doing a job it should have
"obviously" done by itself in the first place.

-- 
David Kastrup

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


Re: [Spam] Partcombine with rests

2018-04-20 Thread Rutger Hofman

On 20-04-18 08:46, Lukas-Fabian Moser wrote:

Folks,

in the following example

\version "2.19.80"

One = \relative d'' {
   R1
   r8 d4 e8 f4
}

Two = \relative g' {
   R1
   r4 e4 d2
}

\new Staff \partcombine \One \Two


As the docs state, the decision about which partcombiner mode to choose 
(Apart, Chords, SoloI, SoloII) is hard, and can frequently mismatch with 
the user's expectations. In that case, it is OK to specify the mode 
yourself.


So: add \partcombineApart before bar 2 in either of your voices. You can 
revert in two ways:

(1) \undo \partcombineApart
(2) \partcombineAutomatic

HTH, Rutger

Lilypond treats the quarter note rest in the second voice as reason to 
put "Solo" and down-stem the first note of the first voice. I'm not sure 
this is reasonable behaviour since the lower voice has its own rest 
which \partCombine (reasonably) doesn't suppress, so in fact we have a 
two-voice situation for the whole bar.


I know how to get rid of the "Solo" marking, and of course I could also 
correct the stem of the upper voice's first note by \once\stemUp, 
\once\voiceOne or something similar (maybe combined with tags in order 
to still be able to create an extra part for the first voice). But 
somehow I feel that \partcombine shouldn't force me to do so.


So: Is there a way to make \partcombine recognize the lower voice's 
quarter rest as reason to automatically treat the upper voice as the 
\voiceOne ?


Best
Lukas




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


Re: Make TOC entries available to LaTeX

2018-04-20 Thread Jan-Peter Voigt

Hi Urs,

the OLY way is the way to go, but for inspiration I share my little hack 
that was doing its job quite well on short notice.


Jan-Peter

Am 19.04.2018 um 23:23 schrieb Thomas Morley:

2018-04-19 16:19 GMT+02:00 Urs Liska :

Hi all,

I'm preparing an automated edition process using LuaLaTeX, Pandoc and
LilyPond.

After some experimentation I have come to the conclusion that I'll have to
insert the multi-movement score as a single PDF created by LilyPond (but
through lyluatex to make use of caching and the layout mechanics).

I first had used lyluatex's facility to include the score's system by system
and print all the titles with LaTeX, but this didn't work out - for the
first time I realized that lilypond-book-preamble.ly makes the vertical
staff-staff spacing as tight as possible, which often makes the page layout
pretty bad. Creating the movements separately is not an option either
because not all movements will start on a new page.

So now I have included a multi-movement score in the LaTeX document and
don't know how to add TOC entries (in LaTeX) for the movements. I can see
two possible ways, but don't know if they are really possible and if so how
to approach them:

Is it possible to insert something in the PDF output that LaTeX can pick up
as TOC entries?
(actually I doubt this is possible, but since it would be the easiest way I
thought I'd ask anyway)
Can I reliably retrieve the current page number of a given score's title
block?
With that information I could write them to a log file and read that later
in LaTeX.

TIA
Urs

PS: I don't know if it matters but the file is produced using
ly:book-process etc.




Doesn't
http://lilypond.org/doc/v2.19/Documentation/usage-big-page#sharing-the-table-of-contents
do what you want?

Cheers,
   Harm

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



\version "2.19.80"

#(define-markup-command (export-toc layout props file)(string?)
   (let* ((gauge-stencil (interpret-markup layout props ""))
  (x-ext (ly:stencil-extent gauge-stencil X))
  (y-ext (ly:stencil-extent gauge-stencil Y)))

 ; produce delayed stencil
 (ly:make-stencil
  `(delay-stencil-evaluation
,(delay (ly:stencil-expr ; this will be run, when all pages are calculated
  (let ((table (ly:output-def-lookup layout 'label-page-table)))
(with-output-to-file file
  (lambda ()
(display "Seite\tTitel\r\n\r\n")
(for-each (lambda (toc-item)
(format #t "~A\t~A\r\n"
  (if (list? table) (assoc-get (car toc-item) table) "???")
  (markup->string (caddr toc-item))
  )) (toc-items))
))
empty-stencil)
  )))
  x-ext y-ext)
 ))
exportTocMarkup = #(define-scheme-function ()()
 #{
   \markup \export-toc #(format "~A.inhalt.txt" (ly:parser-output-name))
 #})


\header {
  title = \markup { Hallo Welt! \exportTocMarkup }
}
\tocItem "Hallo Welt!"
\relative { c'' }
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: lyluatex: cannot increase the line width

2018-04-20 Thread David Kastrup
Federico Bruni  writes:

> Hi all
>
> Sorry if I use this list to ask questions about lyluatex, but I hope
> that other are interested on the topic.
>
> I'm trying to increase the width of a snippet.
> In LilyPond I can easily do it by changing the line-width and setting
> ragged-right to false.
> I've tried the following for lyluatex but nothing changes:
>
> $ cat width.tex
> \documentclass{article}
> \usepackage{lyluatex}
> \begin{document}
>
> \begin{lilypond}[relative,line-width=300pt,ragged-right=false]
> c'4 d e f
> \end{lilypond}
>
> \end{document}
>
> No matter which value I put, the output is always the same.
> I'm missing something?

This would not work in LilyPond-Book either, would it?  The option is
called noragged-right I think.  But I am not sure whether you would not
need to tamper with ragged-last for single-line snippets anyway.  Is
there even such an option for the respective LaTeX embeddings?

-- 
David Kastrup

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


Re: lyluatex: cannot increase the line width

2018-04-20 Thread Urs Liska


Am 20. April 2018 08:51:09 MESZ schrieb Federico Bruni :
>Hi all
>
>Sorry if I use this list to ask questions about lyluatex, but I hope 
>that other are interested on the topic.
>
>I'm trying to increase the width of a snippet.
>In LilyPond I can easily do it by changing the line-width and setting 
>ragged-right to false.
>I've tried the following for lyluatex but nothing changes:
>
>$ cat width.tex
>\documentclass{article}
>\usepackage{lyluatex}
>\begin{document}
>
>\begin{lilypond}[relative,line-width=300pt,ragged-right=false]
>c'4 d e f
>\end{lilypond}
>
>\end{document}
>
>No matter which value I put, the output is always the same.
>I'm missing something?

Not sure, but please repeat with the debug option and inspect/show the 
generated .ly file from the temp directory.

Don't you have to deal with ragged-last to make a single-system score wider 
than necessary?

Urs

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

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


lyluatex: cannot increase the line width

2018-04-20 Thread Federico Bruni

Hi all

Sorry if I use this list to ask questions about lyluatex, but I hope 
that other are interested on the topic.


I'm trying to increase the width of a snippet.
In LilyPond I can easily do it by changing the line-width and setting 
ragged-right to false.

I've tried the following for lyluatex but nothing changes:

$ cat width.tex
\documentclass{article}
\usepackage{lyluatex}
\begin{document}

\begin{lilypond}[relative,line-width=300pt,ragged-right=false]
c'4 d e f
\end{lilypond}

\end{document}

No matter which value I put, the output is always the same.
I'm missing something?

Thanks
Federico





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


Partcombine with rests

2018-04-20 Thread Lukas-Fabian Moser

Folks,

in the following example

\version "2.19.80"

One = \relative d'' {
  R1
  r8 d4 e8 f4
}

Two = \relative g' {
  R1
  r4 e4 d2
}

\new Staff \partcombine \One \Two

Lilypond treats the quarter note rest in the second voice as reason to 
put "Solo" and down-stem the first note of the first voice. I'm not sure 
this is reasonable behaviour since the lower voice has its own rest 
which \partCombine (reasonably) doesn't suppress, so in fact we have a 
two-voice situation for the whole bar.


I know how to get rid of the "Solo" marking, and of course I could also 
correct the stem of the upper voice's first note by \once\stemUp, 
\once\voiceOne or something similar (maybe combined with tags in order 
to still be able to create an extra part for the first voice). But 
somehow I feel that \partcombine shouldn't force me to do so.


So: Is there a way to make \partcombine recognize the lower voice's 
quarter rest as reason to automatically treat the upper voice as the 
\voiceOne ?


Best
Lukas

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