Re: Manipulating lyrics with a music function

2021-10-08 Thread Aaron Hill

On 2021-10-08 8:24 pm, David F. wrote:

macOS 10.14.6, Lilypond 2.22.1

The syntax for adding quotes to lyrics is a little cluttered, so I
thought I’d whip up a couple of little helper functions to tidy things
up.  Two hours later I’m reaching out to the mailing list for help.
The example below is failing in two ways.  First, I can’t figure out
how to actually interpolate the syllable that is the input to my
functions into the output.  Second, the hyphen between the first two
syllables is lost.


Your functions could accept the text as markup.  Also, you should 
strongly consider using typographer's quotes, which can be input 
directly as UTF-8 or using character shorthand neither of which requires 
messing about with escaping:



\paper { #(include-special-characters) }
\relative { \time 3/4 e'4 e4. e8 d4 e d c2. }
\addlyrics { In -- com -- pa -- ra -- ble, said she }

openQuote = #(define-scheme-function (text) (markup?) #{ \markup \concat 
{ “ #text } #})
closeQuote = #(define-scheme-function (text) (markup?) #{ \markup 
\concat { #text ” } #})

\relative { \time 3/4 e'4 e4. e8 d4 e d c2. }
\addlyrics { \openQuote In -- com -- pa --  ra -- \closeQuote ble, said 
she }




-- Aaron Hill



Re: \transpose question

2021-10-08 Thread Mark Probert
Valentin wrote:
> 
> How about this? 
>
Wow! Thank you. That really is what I was after, and now I need to 
understand what you've done!

Much appreciated

 .. mark.



Manipulating lyrics with a music function

2021-10-08 Thread David F.
macOS 10.14.6, Lilypond 2.22.1

The syntax for adding quotes to lyrics is a little cluttered, so I thought I’d 
whip up a couple of little helper functions to tidy things up.  Two hours later 
I’m reaching out to the mailing list for help.  The example below is failing in 
two ways.  First, I can’t figure out how to actually interpolate the syllable 
that is the input to my functions into the output.  Second, the hyphen between 
the first two syllables is lost.

Help?

David F.

\version "2.22"

\layout {
\context {
\Lyrics
\override LyricHyphen.minimum-distance = #1.0
}
}

openQuote = #(define-music-function (syllable) (ly:music?)
  #{ \lyricmode { "\"In" } #}
  )

closeQuote = #(define-music-function (syllable) (ly:music?)
  #{ \lyricmode { "ble,\"" } #}
  )

\relative { \time 3/4 e'4 e4. e8 d4 e d c2. }
\addlyrics { \openQuote In -- com -- pa --  ra -- \closeQuote ble, said she }




Re: \transpose question

2021-10-08 Thread Flaming Hakama by Elaine
>
>
> -- Forwarded message --
> From: Mark Probert 
> To: Lily Pond 
> Cc:
> Bcc:
> Date: Fri, 8 Oct 2021 10:36:37 +1100
> Subject: \transpose question
>
> Hi.
>
> A question on transpose: I understand that "\transpose distinguishes
> between enharmonic pitches," however is there anyway to force a
> particular behaviour? For example, in the snippet below, when I have a
> movement from C to C# in the original key, and then go up a tone with
> "\transpose c d," I get "D and D#" (which is correct based on the
> provided notes and chords), however I want "D and Eb" (the other
> enharmonic).
>
> Is there a way to do this?
>
> Thanks .. mark.
>
> --
> \version "2.22"
>
> melody = \relative c' {
>   \clef treble
>   c8 d ees f g4 r4 \bar "||"
>   cis,8 dis e fis gis4 r4 \bar "||"
> }
>
> harmony = \chordmode {
>   c1:m7 cis1:m7
> }
>
> song = {
>   <<
> \new ChordNames \harmony
> \new Staff  \melody
>   >>
> }
>
> trans = {
>   \transpose c c { \song }
>   \transpose c d { \song }
> }
>
> \score {
>   \trans
> }
>

Since you are choosing to spell chords differently in terms of #1 vs b2,
you are not just trying to do a transposition.

Rather, you are choosing to respell the harmony.

Well, you are doing both--for some keys you will just be transposing.  For
the others, you are changing the harmonic spelling, and transposing.

Basically, you will have to have more than one source.
But you will probably only need 2, one spelled as #1 and the other as b2.

Your organization was a little confusing, as it created extra staves.
Here is how I would demo it


\version "2.19.83"

melodySharpOne = \relative c' {
  \clef treble
  c8 d ees f g4 r4
  cis,8 dis e fis gis4 r4 \bar "||"
}
melodyFlatTwo = \relative c' {
  \clef treble
  c8 d ees f g4 r4
  des8 ees fes ges aes4 r4 \bar "||"
}

harmonySharpOne = \chordmode {
  c1:m7 cis1:m7
}
harmonyFlatTwo = \chordmode {
  c1:m7 des1:m7
}

<<
  \new ChordNames {
\transpose c c \harmonySharpOne
\transpose c cis \harmonyFlatTwo
\transpose c d \harmonyFlatTwo
\transpose c dis \harmonyFlatTwo
\transpose c ees \harmonySharpOne
  }
  \new Staff {
\transpose c c \melodySharpOne
\transpose c cis \melodyFlatTwo
\transpose c d \melodyFlatTwo
\transpose c dis \melodyFlatTwo
\transpose c ees \melodySharpOne
  }
>>


HTH,

Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Re: Applying rhythms

2021-10-08 Thread Mats Bengtsson
Often I find it even more useful to do the same with simple substitution 
functions, where you easily can apply not only a rhythmic pattern but 
also articulations and repeated notes, for example. Here's a simple example


pattern = #(define-music-function (p1 p2 p3)
    (ly:pitch? ly:pitch? ly:pitch?)
    #{ $p1 2 $p1 8 ( $p2 -.) $p1 -. $p3 -. #} )

\score{
  \new Voice \fixed c' {
    \pattern c b, e |
    \pattern d e f |
    \pattern d' e' g |
    c'1 }
}

In the above example, I intentionally used \fixed instead of \relative 
mode, since otherwise you would get some surprises if one of the pitches 
that's repeated in the pattern is specified with a ' or , in relative 
mode. If you want to use \relative mode (which I, for example, often 
find most convenient) you have to extend the definition of the 
substitution function with slightly more Scheme code:


pattern = #(define-music-function (p1 p2 p3)
           (ly:pitch? ly:pitch? ly:pitch?)
           (make-relative (p1 p2 p3)
            (make-event-chord (list p1 p2 p3))
            #{ $p1 2 $p1 8 ( $p2 -.) $p1 -. $p3 -. #} ))

\score{
  \new Voice \relative c' {
    \pattern c b e |
    \pattern d e f |
    \pattern d' e g, |
    c1 }
  }

The main disadvantage of this approach to abbreviate repeated patterns 
of music is that you only specify the pitch as the argument, which means 
that you for example want to add a dynamic indication or similarly to a 
note in one of the measures, you cannot do it with

\pattern d e \p f

If, instead, you define a substitution function that takes music instead 
of pitches as argument, then you can easily handle such a situation, but 
then the note comes not only with pitch (and possible dynamic), but also 
with the already specified duration, and you would need more advanced 
functions to apply a rhythmic pattern. For completeness, here's anyway 
an example of a very simple substitution function that takes music 
instead of pitches as argument.


pat = #(define-music-function (m1 m2) (ly:music? ly:music?)
    #{ $m1 ( $m2 )  $m1 -. #} )

\score{
  \new Voice \fixed c' {
    \time 6/8
    \pat c8 b, \pat d e \p |
    \pat d'4 e' |
    g2. }
}

I think it's a pity that we don't have any example like these in the 
Learning manual or the Notation reference, since they are so useful and 
still simple to use.


    /Mats

On 2021-10-07 12:47, Calvin Ransom wrote:


Hi everyone,

I found some code previously made in the mailing list that works for 
separating pitch and rhythm.


It still works after 9 years but it cannot print tuplet numbers. Does 
anyone know how to do this or create a workaround?


Re: Separating pitch and rhythm (mail-archive.com) 



All help appreciated,

Calvin Ransom


--
=
Mats Bengtsson, Prof.
Information Science and Engineering
School of Electrical Engin. and Comp. Science
Royal Institute of Technology (KTH)
SE-100 44  STOCKHOLM
Sweden
Phone: (+46) 8 790 8463 
Email: mats.bengts...@ee.kth.se
WWW: https://www.kth.se/profile/matben/
=




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt



> Am 08.10.2021 um 12:04 schrieb David Kastrup :
> 
> Jan-Peter Voigt  writes:
> 
>> Hi all,
>> 
>> probably what I am writing now is not new to most of you. About a year
>> ago there was a discussion regarding the license of Lilypond, triggered
>> by Urs' question about the future of OLL. Again and again the
>> documentation was referred to, which says that Lilypond is a compiler
>> that translates the source code into a PDF. For God's sake, I don't want
>> to discuss the licensing consequences again, but I want to point out
>> that this representation is not exactly complete. In fact, each source
>> file is translated into a Lilypond internal executable, the execution of
>> which then generates the PDF.
> 
> Uh, no?  Calling LilyPond's internal representation of music an
> "executable" is nonsensical since it does not imply any actions but is a
> structural representation of music.
Ok, my designation as internal executable is certainly not a good picture.
My point is that this process is not a pure translation language A to language 
B.
Whatsoever, this is not the topic I want to discuss.
> There never is any linear
> representation being "executed", and source files are interpreted rather
> than compiled, with no file-level representation ever being explicit.
Well at least a (Scheme) Engraver can be used to instruct that a note head be
painted red if it is the third moment in the measure. Alternatively, this 
information
can be given to each affected notehead via override. The source file is 
interpreted,
as you write, and not compiled, as written in the documentation.
(https://lilypond.org/windows.html, https://lilypond.org/macos-x.html, 
https://lilypond.org/unix.html: "Compiling a file")
> That's not an academic difference since it is a non-trivial question
> just what the structure of a MusicXML file is supposed to represent from
> a given LilyPond input file.
Yes, that is essentially what I wanted to say.

Jan-Peter




Re: Relative mode

2021-10-08 Thread Leo Correia de Verdier
By minimal we mean a piece of code that compiles clean, shows the behavior you 
want to show and is as short as possible, in this case it could be more like 

\version "2.22.1"
{ a'1 \break a'1 }

And a solution could look like

\version "2.22.1"
{ a'1 \break a'1 }
\layout { indent = #0 }

A hint about the code:
If you do not want to keep them separate for some reason I find the code easier 
to read, understand and find and correct errors in if there is only one paper 
and layout block at each place and level, you could combine them, like:

\paper {
  top-margin = 10
  right-margin = 10
  left-margin = 10
  #(define fonts
 (set-global-fonts
  #:roman "Times New Roman"
  #:sans "Nimbus Sans,Nimbus Sans L"
  #:typewriter "Luxi Mono"
  #:factor (/ staff-height pt 18)
  ))
}

\layout {
  \context {
\Score
\remove "Bar_number_engraver"
defaultBarType = ”" 
 }
  \context {
\Staff
\remove "Time_signature_engraver"
  }
  ragged-last = ##f
  line-width = 190
  \set includeGraceNotes = ##t
}

> 7 okt. 2021 kl. 17:28 skrev Mahanidhi :
> 
> To speak the truth I tried to have the music all together with /break command 
> but what was happening is that the first line was starting not aligned with 
> the other ones.
> 
> Here a minimal example:
> 
> \version "2.22.1"
> \language "english"
> 
> global = {
> \key gf \major
>  \time 4/4
>  \override Glissando.style = #'trill
>  \override Score.SpacingSpanner.base-shortest-duration = #(ly:make-moment 
> 1/128)
>  \set includeGraceNotes = ##t
>  \override Score.GraceSpacing.common-shortest-duration = #(ly:make-moment 
> 1/132)
> }
> \paper {
> top-margin = 10
> right-margin = 10
> left-margin = 10
> }
> 
> \paper {
>  #(define fonts
>(set-global-fonts
> #:roman "Times New Roman"
> #:sans "Nimbus Sans,Nimbus Sans L"
> #:typewriter "Luxi Mono"
> #:factor (/ staff-height pt 18)
>))
> }
> \layout {
>  \context {
>\Score
>\remove "Bar_number_engraver"
> defaultBarType = "" }}
> 
> \layout {
>  \context {
> \Staff
>  \remove "Time_signature_engraver"
> }}
> 
> \layout {
>  ragged-last = ##f
>  line-width = 190
> }
> \layout {
>  \set includeGraceNotes = ##t
> }
> 
> \relative c'
> {\global
> \tempo "Moderate-slow" 4 = 80
> df8 df ef [ef] ef4 ef8 ff ff [ef] df4\bar "|"
> \break ef8 ef \glissando gf gf4 af8 gf2.\glissando  \hideNotes c,4^" 
> fine"  \unHideNotes \bar "||"  ff8  [ \melisma ef  df] \melismaEnd df 
> \melisma gf \melismaEnd ff  [ef]ef2.\bar "|"
> }
> 
> \addlyrics {To -- mār  __ _ kri -- pār cha -- ran -- (a) ta -- le
> \break ā -- mār __ _ ā -- mi  -- re __ _ hā -- rā -- bo bā -- le
>  }
> 
> 
> 
> 
> 
> 
> 
> 
> ‐‐‐ Original Message ‐‐‐
> 
> Il giovedì 7 ottobre 2021 14:29, David Kastrup  ha scritto:
> 
>> Leo Correia de Verdier leo.correia.de.verd...@gmail.com writes:
>> 
>>> The ”command global=” is defining a variable with a series of property
>>> 
>>> settings (mostly), \relative is not a property, it’s a function that
>>> 
>>> is preformed on the music inside the brackets following it.
>>> 
>>> The manual is quite long, but you will eventually need to go through
>>> 
>>> much of it to get what is what in lilyponds syntax and understand what
>>> 
>>> the lines in the code actually mean.
>> 
>> If everything is a score, you can just call relative on it. Something
>> 
>> like
>> 
>> toplevel-music-functions=#(cons relative toplevel-music-functions)
>> 
>> { c g e c }
>> 
>> { g' f g' c }
>> 
>> Mind you, I am not saying that this is a good idea (in fact, I consider
>> 
>> it marvelously bad, not least of all because all helpful editing and
>> 
>> conversion tools as well as human readers will likely have no clue what
>> 
>> you are doing here and will refuse helping you with it).
>> 
>> But it's not like LilyPond has built-in barriers against bad ideas, and
>> 
>> it will give you all the help you need shooting yourself in the foot.
>> 
>> The manuals and the community will lean towards moving you more in the
>> 
>> direction of sustainable best practice.
>> 
>> It's a bit similar with music education: when self-learned musicians
>> 
>> accumulate technical skills of their own design from which they create
>> 
>> their working procedures at an ultimately comparatively high level, they
>> 
>> will have a hard time getting help overcoming any roadblocks because
>> 
>> they'll find no teachers interested in investing the kind of work
>> 
>> upfront required to sort the good from the bad in the idiosyncratic
>> 
>> technique, and then design strategies for ditching or even ameliorating
>> 
>> the bad without sacrificing the good.
>> 
>> 

Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread David Kastrup
Jan-Peter Voigt  writes:

> Hi all,
>
> probably what I am writing now is not new to most of you. About a year
> ago there was a discussion regarding the license of Lilypond, triggered
> by Urs' question about the future of OLL. Again and again the
> documentation was referred to, which says that Lilypond is a compiler
> that translates the source code into a PDF. For God's sake, I don't want
> to discuss the licensing consequences again, but I want to point out
> that this representation is not exactly complete. In fact, each source
> file is translated into a Lilypond internal executable, the execution of
> which then generates the PDF.

Uh, no?  Calling LilyPond's internal representation of music an
"executable" is nonsensical since it does not imply any actions but is a
structural representation of music.  There never is any linear
representation being "executed", and source files are interpreted rather
than compiled, with no file-level representation ever being explicit.

That's not an academic difference since it is a non-trivial question
just what the structure of a MusicXML file is supposed to represent from
a given LilyPond input file.

-- 
David Kastrup



Re: Horizontal line between hymn verses

2021-10-08 Thread Valentin Petzel
Hello Kira,

Aarons version uses the stencil of the stanza number, which means that it only 
works if there is a linenumber present (thus it won’t display after a line 
break. I’ve come up with a way to instead use a context that missuses the Clef 
stencil, which will print in every line and can force lines within a system by 
setting LineSep.forceClef = ##t

Cheers,
Valentin#(define dashlength 10)
#(define dashindent 2)
#(define dashthickness 0.17)


\layout {
  \context {
\type "Engraver_group"
\name "LineSep"

\consists "Bar_engraver"
\consists "Clef_engraver"
\consists "Axis_group_engraver"

\defaultchild "NullVoice"
\accepts "CueVoice"
\accepts "NullVoice"
\accepts "Voice"

\override VerticalAxisGroup.staff-affinity = #CENTER
clefPosition = 4.8
\override Clef.X-offset = #dashindent
\override Clef.X-extent = #'(0 . 0)
\override Clef.stencil = #(lambda (grob) (make-line-stencil dashthickness 0 0 dashlength 0))
\override VerticalAxisGroup.nonstaff-nonstaff-spacing = #'((basic-distance . 0)
   (minimum-distance . 0)
   (padding . 0.5))
  }
  \context {
\Score
\accepts LineSep
  }
}

<<
 \new Staff \new Voice="s" { a' a' a' a' | \break a' a' a' a' }
 \new Lyrics \lyricsto "s" {\set stanza = #"1." He -- re is some text, bla bla bla }
 \new Lyrics \with { % this with block is important for the spacing between the upper lyrics to the line
   \override VerticalAxisGroup.nonstaff-nonstaff-spacing = #'((basic-distance . 0)
  (minimum-distance . 0)
  (padding . 0.5))
 } \lyricsto "s" {\set stanza = #"2." He -- re is some text, bla bla bla }
 \new LineSep { s1 s2 \set LineSep.forceClef = ##t  s2 }
 \new Lyrics \with { \override LyricText.font-shape = #'italic } \lyricsto "s" {\set stanza = #"3." He -- re is some text, bla bla bla }
>>

signature.asc
Description: This is a digitally signed message part.


Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt
Hi all,

probably what I am writing now is not new to most of you. About a year
ago there was a discussion regarding the license of Lilypond, triggered
by Urs' question about the future of OLL. Again and again the
documentation was referred to, which says that Lilypond is a compiler
that translates the source code into a PDF. For God's sake, I don't want
to discuss the licensing consequences again, but I want to point out
that this representation is not exactly complete. In fact, each source
file is translated into a Lilypond internal executable, the execution of
which then generates the PDF. This architecture is representable in XML,
if it is possible at all, only with extensions to MEI or MusicXML. So
the goal should only be to implement the graphical representation
accordingly.
But this also means that structures that serve a better organization of
the lilypond source code will most likely be lost during export and
re-import.

Several solutions for the export have now been mentioned. Behind these
are three concepts, all of which have their justification:
1. convert source-based (python-ly accessible through frescobaldi).
2. lilypond internal generation of an intermediate code
3. scheme based generation of an intermediate code

If the sources comply, i.e. do not contain Scheme, then the python-ly
solution is quite charming, fast and batchable. But I would find the
internal generation of an intermediate code, as envisioned and developed
by Jacques, the nicest. The Scheme based solution I started from the
pragmatic consideration that if it works, it can be quickly adapted and
deployed in different environments.

I'm very glad to see this discussion revisited. Maybe something more can
be developed together in this direction. For this reason, I am also
pushing the discussion to the devel list. ;-)

I'll be on the road for the next week, but I plan to get back to the
topic after that.

Cheers,

Jan-Peter


Am 07.10.21 um 22:51 schrieb Thomas Morley:
> Am Do., 7. Okt. 2021 um 13:32 Uhr schrieb Jean Abou Samra 
> :
>>
>> Harm,
>>
>> Le 07/10/2021 à 11:46, Thomas Morley a écrit :
>>> Not sure Jan-Peter's approach is the best method ...
>>
>> What makes you think so?
>>
>> Best,
>> Jean
>
> Maybe my wording was misleading.
>
> I tested ly->musicxml with
> (1) openlilylib, i.e. Jan-Peter
> (2) python-ly
> (3) Frescobaldi
> (4) https://github.com/de-wolff/lilypond.git
>
> Then tried reimporting the resulting xml-file via
> (a) musicxml2ly
> (b) xml2ly
>
> All results were terrible. Here I stopped frustrated.
> I did not look into any code, thus I simply don't know which one is
> the most promising approach.
>
> Cheers,
>   Harm
>




Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jan-Peter Voigt
Hello Peter, and all,

I spotted the problem with the OLL export-solution in 2.22+:
In api.scm ll. 278,279 the call to ly:grob-properties fails. In that
acknowledger block the stem direction is recorded. I'll look how to fix
that later. If you like to try it out, you can temporarily just delete
or comment that block (ll. 274-281).

Cheers,

Jan-Peter

Am 07.10.21 um 11:49 schrieb Jan-Peter Voigt:
> Hello Peter,
>
> yes, I still receive the messages from the list, but since I have
> changed jobs, my commitment to Lilypond has fallen behind a bit.
> But I hope to curate and update my code soon so that it can serve as a
> starting point for further development. Of course, Jacque's work should
> not be lost sight of, as native support would be nice. But maybe the
> scheme-engraver based solution can push the issue a bit.
> This topic has been on my mind for quite some time. Since Lilypond does
> not offer XML export, its use is problematic in many areas. If I want to
> offer something to a publisher, I can't get anywhere with Lilypond in
> most cases. If I want to archive the notes in a structured way, I can
> come up with 1001 solutions in Scheme that fill a database. But if I
> have curated data in MEI format (or MusicXML), I can systematically feed
> a database (e.g. eXist) with it and provide a REST API afterwards to
> build fancy Webapps.
>
> Best regards,
>
> Jan-Peter
>
>
>
> Am 07.10.21 um 11:30 schrieb Peter Toye:
>> The potential need has gone away now - my Sibelius user has told me that
>> he uses ScoreMuse to export the PDF into a suitable format for Sibelius.
>> Looks to me like an expensive way of doing it, but if he can afford
>> Sibelius he can probably afford ScoreMuse as well.
>>
>>  
>>
>> I agree that exchanging music information between different engravers is
>> an extremely complex problem and I don't underestimate the difficulty.
>>
>>  
>>
>> I tried Jan-Peter's code on Github, but it seems to be broken on recent
>> versions of LilyPond. I'm told it works on 19.0  but I don't have
>> that version any more. And I don't have a contact for him to ask - is he
>> on this mailing list?
>>
>>
>> Best regards,
>>
>>
>> Peter
>>
>> mailto:lilyp...@ptoye.com 
>>
>> www.ptoye.com 
>>
>>
>> -
>>
>> Wednesday, October 6, 2021, 8:05:12 PM, Jean Abou Samra wrote:
>>
>>
>> Le 05/10/2021 à 13:08, Peter Toye a écrit :
>>
>>
>> Sorry - edited subject to get the linking correct
>>
>>
>>  Harm,
>>
>>
>> 
>> https://music.stackexchange.com/questions/42315/lilypond-to-musicxml-to-sibelius#73706
>> 
>> 
>>  >
>> 
>> > 
>> >
>>  has
>> > a discussion about this as well. I've started looking at >
>> the OpenLilyLib solution at the bottom of the thread but it
>> doesn't > work on later versions of LilyPond.
>>
>>
>> It would seem to me that using LP's parsing mechanisms is the
>> right > way to go about it, and I'd offer to help if my health
>> allowed. Is > there anyone on this mailing list who knows about it?
>>
>>
>>
>>
>> About the parsing? Certainly, but the potentiel
>> project spans many different areas of LilyPond.
>> And he design space is vast.
>>
>>
>> With Jacques Menu, we some had private discussions
>> about this. It may be feasible to implement XML export
>> by utilizing Jacque's musicformats library (see
>> his post). So far I only have rough ideas about
>> the LilyPond part, and it is not my current priority.
>>
>>
>> I think the most advanced solution so far is Jan-Peter's
>> https://github.com/openlilylib/lilypond-export
>> 
>> https://lists.gnu.org/archive/html/lilypond-devel/2018-10/msg00068.html
>> 
>> (CCing him). One could start off from that.
>>
>>
>> It's something I will probably need soon.
>>
>>
>>
>>
>> By do means do try to help out, but don't
>> hold your breathe for it. It is a large
>> endeavor.
>>
>>
>> Best,
>> Jean
>>
>
>




Re: Change text size within " "?

2021-10-08 Thread Valentin Petzel
Hello Kira,

Everything within the quotation marks is one markup atom, so there is no way 
to include font-sizes. But is there anything against
title = \markup { something \smaller something}
?

Cheers,
Valentin

signature.asc
Description: This is a digitally signed message part.


Re: \transpose question

2021-10-08 Thread Valentin Petzel
Hi Mark,

How about this? Here we basically pass along a list of numbers for each key. 
This contains informations about the enharmonic correctness: If the value is 0 
the part is kept as is, if it is positive it is corrected upwards, if it is 
negative it is corrected downwards.

Cheers,
Valentin\version "2.22"

test={ c'8 d' ees' f' g'4 r \bar "||" }
harms=\chordmode { c1 }

rectify=
#(define-music-function (n music) (number? ly:music?)
 (if (> n 0)
 #{ \transpose #(ly:make-pitch 0 0 (/ n 2)) #(ly:make-pitch 0 1 (/ (- n 2) 2)) #music #}
 (if (< n 0)
 #{ \transpose #(ly:make-pitch 0 1 (/ n 2)) #(ly:make-pitch 0 0 (/ (+ n 2) 2)) #music #}
 music)))

notes=
#(define-music-function (l)
   (list?)
   (define (L n)
 (if (< n (length l))
 (list-ref l n)
 0))
   #{
 \rectify #(L 0) \test
 \rectify #(L 1) \transpose c cis \test
 \rectify #(L 2) \transpose c d \test
 \rectify #(L 3) \transpose c ees \test
 \rectify #(L 4) \transpose c e \test
 \rectify #(L 5) \transpose c f \test
 \rectify #(L 6) \transpose c fis \test
 \rectify #(L 7) \transpose c g \test
 \rectify #(L 8) \transpose c gis \test
 \rectify #(L 9) \transpose c a \test
 \rectify #(L 10) \transpose c bes \test
 \rectify #(L 11) \transpose c b \test
   #})

harmonics=
#(define-music-function (l)
   (list?)
   (define (L n)
 (if (< n (length l))
 (list-ref l n)
 0))
   #{
 \rectify #(L 0) \harms
 \rectify #(L 1) \transpose c cis \harms
 \rectify #(L 2) \transpose c d \harms
 \rectify #(L 3) \transpose c ees \harms
 \rectify #(L 4) \transpose c e \harms
 \rectify #(L 5) \transpose c f \harms
 \rectify #(L 6) \transpose c fis \harms
 \rectify #(L 7) \transpose c g \harms
 \rectify #(L 8) \transpose c gis \harms
 \rectify #(L 9) \transpose c a \harms
 \rectify #(L 10) \transpose c bes \harms
 \rectify #(L 11) \transpose c b \harms
   #})

combined=
#(define-music-function (p l) (ly:pitch? list?)
   #{
 \transpose c #p
 <<
   \new ChordNames \harmonics #l
   \new Staff \notes #l
 >> \bar "|."
   #})
   
\score {
   \combined c #'()
  \layout { }
}

\score {
   \combined d #'(0 1 0 0 0 0 1 0 1 0 0 0)
  \layout { }
}

\score {
   \combined a #'(0 1 0 0 0 0 1 0 1 0 0 1)
  \layout { }
}

signature.asc
Description: This is a digitally signed message part.


Re: Export from LilyPond to MusicXML (Thomas Morley)

2021-10-08 Thread Jacques Menu
Hello Thomas,

> Le 7 oct. 2021 à 22:51, Thomas Morley  a écrit :
> 
> Am Do., 7. Okt. 2021 um 13:32 Uhr schrieb Jean Abou Samra 
> :
>> 
>> Harm,
>> 
>> Le 07/10/2021 à 11:46, Thomas Morley a écrit :
>>> Not sure Jan-Peter's approach is the best method ...
>> 
>> What makes you think so?
>> 
>> Best,
>> Jean
> 
> Maybe my wording was misleading.
> 
> I tested ly->musicxml with
> (1) openlilylib, i.e. Jan-Peter
> (2) python-ly
> (3) Frescobaldi
> (4) https://github.com/de-wolff/lilypond.git
> 
> Then tried reimporting the resulting xml-file via
> (a) musicxml2ly
> (b) xml2ly
> 
> All results were terrible. Here I stopped frustrated.
> I did not look into any code, thus I simply don't know which one is
> the most promising approach.

Were the bad results due to 1-4 essentially, or were a and b part of the 
quality problem?

JM




Re: Horizontal line between hymn verses

2021-10-08 Thread Jacques Menu
Thanks Aaron, very useful!

JM

> Le 8 oct. 2021 à 03:24, Aaron Hill  a écrit :
> 
> On 2021-10-07 5:46 pm, Kira Garvie wrote:
>> Hello all!
>> I can't figure out how to get that horizontal line dividing the
>> spanish from the english verses... any tips?
>> Thank you!
>> Kira
> 
> Here is an excerpt of what I have done in the past:
> 
> 
> \version "2.20.0"
> 
> separatorLineBelow = \with {
>  \override StanzaNumber.stencil =
>  #(grob-transformer 'stencil
>(lambda (grob orig)
> (grob-interpret-markup grob
>  #{ \markup \overlay { \stencil $orig
> \with-dimensions #'(0 . 0) #'(0 . 0)
> \translate #'(-1 . -1.25)
> \override #'(thickness . 2)
> \draw-line #'(6 . 0)} #} )))
>  \override VerticalAxisGroup.nonstaff-nonstaff-spacing =
>#'( (basic-distance . 0) (minimum-distance . 4.0)
>(padding . 0.0) (stretchability . 0) )
> }
> 
> \layout { \context { \Lyrics
>  \override VerticalAxisGroup.nonstaff-nonstaff-spacing =
>#'( (basic-distance . 0) (minimum-distance . 3.5)
>(padding . 0.0) (stretchability . 0) )
> } }
> 
> << \new Voice = melody \fixed c' { \time 3/4 a4 g b | a2. }
>   \new Lyrics \lyricsto melody { \set stanza = "1." Lo -- rem ips -- um. }
>   \new Lyrics \with \separatorLineBelow
>   \lyricsto melody { \set stanza = "2." Lo -- rem ips -- um. }
>   \new Lyrics \lyricsto melody { \set stanza = "3." Lo -- rem ips -- um. }
>   \new Lyrics \with \separatorLineBelow
>   \lyricsto melody { \set stanza = "4." Lo -- rem ips -- um. }
>   \new Lyrics \lyricsto melody { \set stanza = "5." Lo -- rem ips -- um. }
>   \new Lyrics \lyricsto melody { \set stanza = "6." Lo -- rem ips -- um. } >>
> 
> 
> The principle is simply to hack the StanzaNumber and then increase the 
> spacing between two Lyrics lines.
> 
> 
> -- Aaron Hill
>