Re: Alternating styles of TimeSignatures

2024-05-31 Thread Raphael Mankin

I asked a similar question a while back and  this is the answer I received:


On Thu, Feb 1, 2024 at 10:50 AM Raphael Mankin  wrote:

I have music with alternate bars in 3/4 and 6/8. The usual way to
indicate this is to  put both  time signatures at the start, but  I can
find  no way to do this.

I have tried "\time 3/4 <> \time 6/8", but I only get the last one.

Note, this  is not a compound time of 3/4+6/8, but alternating time
signatures.


I think this is what you are looking for.  I'm not sure where I found 
the code so I can't give credit to its author:


%%%
#(define ((time-alternate-time upa downa upb downb) grob)
   (grob-interpret-markup grob
 (markup #:override '(baseline-skip . 0) #:number
   (#:line (
   (#:center-column (upa downa))
   (#:center-column (upb downb)))

% and use it like this (5/8, 4/8 in this case):

  \override Score.TimeSignature.stencil =
#(time-alternate-time "5" "8" "4" "8")

%%%


--
Knute Snortum




On 31/05/2024 16:42, Federico Sarudiansky wrote:

Hello,

I'm typesetting a work and really want to preserve its notational 
idiosyncrasies. One of them is an alternating way of using time signatures.
The attached MWEish does exactly what I want. The question, for me, is 
if this could be done in a simpler way (just for learning!).


image.png
Thanks in advance!
F.



--
https://saturday-october-seven.com/



Re: General question: scores and parts

2024-05-13 Thread Raphael Mankin
Thank you, that is a neat trick, but when there are, for instance, tempo 
changes in the middle I presume I have to have lots of spacer rests in 
'structure'.



On 13/05/2024 10:04, fremoin via LilyPond user discussion wrote:


Hello,

%%%
\version "2.25.15"

structure = { \tempo 4=42 }
high = {e''1}
low = {a'1}

\score {
    \header { piece = "Score" }
    <<
   \new Devnull \structure
   \new StaffGroup <<
  \new Staff \high
  \new Staff \low
   >>
    >>
}

\score {
    \header { piece = "Part High" }
    <<
   \new Devnull \structure
   \new StaffGroup <<
  \new Staff \high
   >>
    >>
}

\score {
    \header { piece = "Part Low" }
    <<
   \new Devnull \structure
   \new StaffGroup <<
      \new Staff \low
   >>
    >>
}
%%%

hth,
Frédéric





Le 13/05/2024 à 09:29, Raphael Mankin a écrit :
When one writes a score various annotations, e.g. tempo changes, are 
attached only to the top staff. When one generates separate parts one 
want those annotations on every part.


If I attach the annotations to every part the parts are correct, but I 
get warnings in the full score but the appearance is correct.


Is there a generally accepted way of coding this?









--
https://saturday-october-seven.com/



General question: scores and parts

2024-05-13 Thread Raphael Mankin
When one writes a score various annotations, e.g. tempo changes, are 
attached only to the top staff. When one generates separate parts one 
want those annotations on every part.


If I attach the annotations to every part the parts are correct, but I 
get warnings in the full score but the appearance is correct.


Is there a generally accepted way of coding this?



Re: Spacing of chords on a chord lead sheet

2024-05-11 Thread Raphael Mankin


On 11/05/24 01:59, Kieren MacMillan wrote:

Hi Raphael,


However, the chord names are mono-spaced; they are not spaced 
according to their durations. So that if, for instance, I  have {ef2 
ef4:maj7 ef4:7} then each symbol occupies the same amount of space on 
the line. The first chord does not occupy double the space of the 
other two.


Are you sure? Are you using ragged-right = ##f to confirm/test?

For example, the code

%%%  SNIPPET BEGINS
\version "2.25.11"
\language "english"

\layout {
  indent = 0
  line-width = 4\in
  ragged-right = ##f
  \context {
    \Score
    \remove "Bar_number_engraver"
  }
  \context {
    \ChordNames
    \consists "Bar_engraver"
    \override BarLine.bar-extent = #'(-2 . 2)
  }
}

theChords = \chordmode {
  ef4 ef2:maj7 ef4:7 \break
  ef2 ef4:maj7 ef4:7
}

\new ChordNames \theChords
%%%  SNIPPET ENDS

gives me the output

and clearly there’s a difference in the spacing.

Cheers,
Kieren.


Thank you for your suggestions.

I am neither setting nor touching ragged-right.

I suspect that part of the difference that we see is that you forced 
lilypond to spread a limited amount of music over two lines. In my case 
it is jamming 49 bars into one page. After sleeping on it, what worked 
for me, in the end, is



\score {
<<*
\set Score.proportionalNotationDuration = #(ly:make-moment 1/8)
\override Score.SpacingSpanner.strict-note-spacing = ##t
*
\new ChordNames \with {
    \override ChordName.font-size = #'+3
    \override BarLine.bar-extent = #'(-2 . 2)
\   consists "Bar_engraver"
} {
    \introChords \bar "||" \break
    \chordNames \bar "|."
}
>>

\layout {
}
}

__

My work day may look different than your work day. Please do not feel 
obligated to read or respond to this email outside of your normal 
working hours.


Spacing of chords on a chord lead sheet

2024-05-09 Thread Raphael Mankin
I have  generated a chord lead sheet for a bass player with just the 
chords on it (\chordMode, no notes). After some  fiddling I got the bar 
lines and repeats printed.


However, the chord names are mono-spaced; they are not spaced according 
to their durations. So that if, for instance, I  have {ef2 ef4:maj7 
ef4:7} then each symbol occupies the same amount of space on the line. 
The first chord does not occupy double the space of the other two.


Is there a way of getting proportional spacing?

--




Re: Frescobaldi... panic alternatives?

2024-05-02 Thread Raphael Mankin
This is a much better description of Neovim than exists on any  of the 
Neovim web-sites. They all jump straight into detail without telling one 
what the whole thing is about. I struggled to work out what Neovim is, 
or why I should want to use it.


On 02/05/2024 05:33, Kenneth Flak wrote:

OK, giving it a shot... Feel free to edit as needed!

Kenneth


Neovim

https://neovim.io

Neovim is a minimal text editor and fork of vim. It is highly extensible and 
configurable through the vimscript and lua programming languages. Lilypond 
support is provided by the nvim-lilypond-suite plugin 
(https://github.com/martineausimon/nvim-lilypond-suite). The plugin supports 
playback of midi files through external programs; point-and-click when using a 
supported PDF viewer; snippets and code completion when combined with other 
plugins; in addition to the full range of tools available in the neovim 
ecosystem. For more details on how to set it up consult the plugin's github 
page. You will also want to spend some time with some of the numerous online 
tutorials for learning vim/neovim to get the most out of your editing 
experience.


Werner LEMBERG, May 02, 2024 at 05:49:



Maybe one of you two can provide some text for

https://lilypond.org/doc/v2.24/Documentation/web/easier-editing


It happens that my first contribution to the Lilypond documentation
was a rewrite of the Easier Editing section, some 14 years ago or
so.


Aaah :-)


If either or both care to send me their thoughts and comments, I'll
be glad to turn it into a patch.


This would be great!  Thanks for the offer.


 Werner








--
https://saturday-october-seven.com/



Re: score with dynamic beats

2024-04-12 Thread Raphael Mankin
I note that in one solution one uses \remove and in the other \omit to 
achieve the same thing.


Is there any prospect of  moving to a situation where only one operator 
is used to achieve a result, possibly by having a preferred and 
deprecated options first? This is a general point, not just  restricted 
to this one case.


On 12/04/2024 14:07, Kieren MacMillan wrote:

Hi Gian Paolo,


how to write a score without time signature and bars placed on request?


Just remove the Time_signature_engraver:

\version "2.25.11"

\language "english"

\layout {
   indent = 0
   ragged-right = ##f
   \context {
 \Staff
 \remove Time_signature_engraver
   }
}

{
   \key d \major
   \time 5/2
   d'2 d' cs' d'1
   \time 7/2
   b2 d' d' d' cs' d'1
   \time 9/2
   b2 d' d' d' d' e'1 ~ 1
}


I read the manual but didn't find a solution.


https://lilypond.org/doc/v2.23/Documentation/notation/visibility-of-objects#removing-the-stencil

That should have led you to the equivalent solution:

\version "2.25.11"

\language "english"

\layout {
   indent = 0
   ragged-right = ##f
}

{
   \omit Staff.TimeSignature
   \key d \major
   \time 5/2
   d'2 d' cs' d'1
   \time 7/2
   b2 d' d' d' cs' d'1
   \time 9/2
   b2 d' d' d' d' e'1 ~ 1
}

Hope that helps,
Kieren.
__

My work day may look different than your work day. Please do not feel obligated 
to read or respond to this email outside of your normal working hours.





--
https://saturday-october-seven.com/



Re: Can't compile Lilypond files

2024-03-25 Thread Raphael Mankin




On 24/03/2024 21:26, David Sumbler wrote:

On Sun, 2024-03-24 at 21:55 +0100, Lukas-Fabian Moser wrote:

[snip]


What I don't understand is why or how it always used to work, but I 
suppose there's no point in worrying about that.


I have lost count of the number of projects over the past several 
decades in which I have asked that same question.



Anyway, thanks for finding the solution!

David


--
https://saturday-october-seven.com/



Re: B.A.C.H. motif

2024-03-19 Thread Raphael Mankin

That is so silly that I love it.

On 19/03/2024 13:27, Xavier Scheuer wrote:
On Tue, 19 Mar 2024 at 13:57, Peter Mayes > wrote:

 >
 > Being relatively new to this forum, I suspect I am not the first person
 > to ask this.
 >
 > And it is more out of curiosity than necessity.
 >
 > But does anybody have lilypond code to engrave the famous B.A.C.H. motif
 > in the attached image?

Hello,

Years ago, Pierre Perol-Schneider had contributed the following code on 
the French-speaking mailing list.
https://lilypond.community/t/est-ce-possible/3672/2 



\version "2.18.2"

\markup {
   \combine
   \score {
     {
   \key f\major
   \tweak extra-offset #'(-2 . 0) bes'1
   \clef C
   \override Staff.Clef.stencil =
     #(lambda (grob) (grob-interpret-markup grob
   #{ \markup\rotate #180 \musicglyph 
#"clefs.C" #}))

   \bar ""
     }
     \layout {
   \context {
     \Staff
     \hide TimeSignature
   }
     }
   }
   \rotate #90
   \translate #'(1 . 0)
   \score {
     {
   \key f\major
   \hide bes'1
   \clef mezzosoprano
   \override Staff.Clef.stencil =
     #(lambda (grob) (grob-interpret-markup grob
   #{ \markup\rotate #180 \musicglyph 
#"clefs.C" #}))

   \bar ""
     }
     \layout {
   \context {
     \Staff
     \hide TimeSignature
     \override KeySignature.stencil =
     #(lambda (grob) (grob-interpret-markup grob
   #{ \markup\musicglyph 
#"accidentals.natural" #}))

   }
     }
   }
}

Kind regards,
Xavier



--
https://saturday-october-seven.com/



Re: Question regarding ChordNames

2024-03-13 Thread Raphael Mankin




On 13/03/2024 03:50, John Helly wrote:

Aloha.

Here's an MWE to exhibit the issue.

I have a flat note (bes) that I want to transpose down 4 half-tones to 
F#.  However, when the transpose is applied, the result is Gb.  I 
understand that a flat note was the initial value so maybe LP is 
preserving that specification?


Nonetheless, short of re-writing the whole piece in A rather than C#, is 
there a way to specify the enharmonic representation for an F# rather 
than Gb, for example?


bflat = \chordmode { bes1 }
<<
\transpose cis' a {
  \new ChordNames { \bflat  }
}
 >>

Mahalo.
J.

On 3/12/24 02:44, Kieren MacMillan wrote:

\version "2.25.11"
\language "english"

gsharp = \chordmode { gs1 }
aflat = \chordmode { af1 }

<<
  \new ChordNames { \gsharp }
  \gsharp
<<
  \new ChordNames { \aflat }
  \aflat



AS another reply has noted NR 1.1.2 is useful. It also says:


"\transpose distinguishes between enharmonic pitches: both \transpose c 
cis or \transpose c des will transpose up a semitone. The first version 
will print sharps and the notes will remain on the same scale step, the 
second version will print flats on the scale step above."




--
https://saturday-october-seven.com/



Re: snippet

2024-03-12 Thread Raphael Mankin




On 11/03/2024 16:54, Gian Paolo Renello wrote:

HI,
I searched on lilypond site a way to rewrite a SATB on 2 staves, but i 
am not able to got it...

Does any one have a clue on it?
Thanks a lot
Gian Paolo
Here is the image i got form the score.


Look at \partCombine.  I use it to generate a short score (2 staffs), 
full score (4 staffs) and separate parts.


e.g.
  <<
\new Staff \with {
  instrumentName = "Descant/Treble"
  midiInstrument = "recorder"
} <<  \tempomark
  \partCombine
  { \sopranoRecorder }
  {  \transpose c' c \altoRecorder } >>
\new Staff = "right" \with {
  instrumentName = "Tenor/Bass"
} {
  <<
\partCombine
\tenorRecorder
{ \transpose c c'  \bassRecorder }
  >>
}
  >>


--
https://saturday-october-seven.com/



Re: Control breaks in staff that I get from a variable?

2024-03-11 Thread Raphael Mankin




On 10/03/2024 12:41, Ole V. Villumsen wrote:

The classic fix is

<<
   \new Devnull { s1*5 \break }
   \staffIGot




This was exactly what I was after. It’s nice and simple and works well. Thank 
you.

I might wish for it being better documented. I see Devnull documented well in 
the Internals Reference, but I didn’t readily see it mentioned in the Notation 
Reference. Not that I know exactly where it would fit well. I needed it in the 
context of 
https://lilypond.org/doc/v2.24/Documentation/notation/different-editions-from-one-source.
 It might not be the right place.



Also a cross-reference at least in NR 4.3.1 "Line Breaking". (v2.24.3)

--
https://saturday-october-seven.com/



Re: French Horn - transposing

2024-03-10 Thread Raphael Mankin




On 10/03/2024 01:14, TJ Kolev wrote:
Thank you all for your suggestions and time. I ended up using \transpose 
which was the easiest for me to understand, and worked great it seems.


Cheers!
tjk :)


And I learned something new w.r.t \quote* operators, which I did not 
know existed.





On Sat, Mar 9, 2024 at 1:21 AM Paul Scott > wrote:


On 3/8/24 4:46 PM, TJ Kolev wrote:
 > Greetings!
 >
 > So I've been notating a piece for my son's school band (junior
high).
 > Copying the music from paper into LilyPond using Frescobaldi. And
now
 > I hit a wall. The music piece is written for french horns in E flat
 > pitch. But the band's horns are in F pitch. I need to transpose the
 > score appropriately. The band director expects staff with three
flats
 > (E flat major). I hope there's some easier way to do this than me
 > manually re-writing the score. And I am not even sure how to do
that.
 > I would appreciate any help.
 >
 > I've played piano, so I can read notes. But these crazy pitched
brass
 > instruments are an intimidating concept... :-/
 >
 > Below is the initial part of the score for the E flat french horn.
 > Seems rather big for a small example, but I'd rather have a bit more
 > context.
 >
 > Thank you!
 > TJ Kolev :)
 >
 > ==
 >
 > \version "2.24.0"
 >
 > trl = \tuplet 3/2 \etc
 >
 > rpt = #(define-music-function (cnt snip) (integer? ly:music?)
 >   #{
 >     { \repeat unfold $cnt $snip }
 >   #}
 > )
 >
 > frhornInIIA = {
 >   \sectionLabel "Intro"
 >   \key f \major
 >   | \trl {a'8( bes a)} g r | \trl {g( a g)} f[ r16 e] | g8 r f[
r16 e]
 > | d8 r r4 \break
 >
 >   \sectionLabel "Part A"
 >   \repeat volta 2 {
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] } | r 4.:8 |  a'>2:8^"" \break
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] }  | r8 4.:8 |  a'>2:8^"" \break
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] } | r 4.:8 |  a'>2:8^"" \break
 >     | \rpt 2 { r8 [ r ] } | r8 [ r ]
| r8
 > 4.:8 \break
 >     | r8 [ r ] | r8 [ r ] | r8 [
 > r ]
 >   }
 >   \alternative {
 >     {  r r4 \break }
 >     { 8 r 4 }
 >   }
 > } % A part
 >
 >
 > frhornIIInIVA = {
 >   \sectionLabel "Intro"
 >   \key f \major
 >   | \trl {a'8( bes a)} g r | \trl {g( a g)} f[ r16 e] | g8 r f[
r16 e]
 > | d8 r r4 \break
 >
 >   \sectionLabel "Part A"
 >   \repeat volta 2 {
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] } | r 4.:8 |  a,>2:8^"" \break
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] }  | r8 4.:8 |  a,>2:8^"" \break
 >     | \rpt 4 { r8 [ r ] } \break
 >     | \rpt 2 { r8 [ r ] } | r 4.:8 |  a,>2:8^"" \break
 >     | \rpt 2 { r8 [ r ] } | r8 [ r ]
| r8
 > 4.:8 \break
 >     | r8 [ r ] | r8 [ r ] | r8 [ r
]
 >   }
 >   \alternative {
 >     {  r r4 \break }
 >     { 8 r 4 }
 >   }
 > } % A part
 >
 >
 > frhornInIINotes = {
 >   \time 2/4
 >   \relative c' {
 >     \frhornInIIA %{
 >     \frhornInIIB
 >     \frhornInIIC
 >     \frhornInIID
 >     \frhornInIIE
 >     \frhornInIIF %}
 >   }
 > }
 >
 >
 > frhornIIInIVNotes = {
 >   \time 2/4
 >   \relative c' {
 >     \frhornIIInIVA %{
 >     \frhornIIInIVB
 >     \frhornIIInIVC
 >     \frhornIIInIVD
 >     \frhornIIInIVE
 >     \frhornIIInIVF %}
 >   }
 > }
 >
 > sgFrenchHorn = \new StaffGroup <<
 >   \new Staff \with {
 >     instrumentName = \markup { \column { \line { French Horn E\flat}
 > \line {"I & II"} } }
 >     shortInstrumentName = \markup \teeny { \column { \line {"fhorn"}
 > \line {"I,II"} } }
 >   }
 >   \frhornInIINotes
 >
 >   \new Staff \with {
 >     instrumentName = \markup { \column { \line { French Horn E\flat}
 > \line {"III & IV"} } }
 >     shortInstrumentName = \markup \teeny { \column { \line {"fhorn"}
 > \line {"III,IV"} } }
 >   }
 >   \frhornIIInIVNotes
 > >>
 >
 > \score {
 >   \sgFrenchHorn
 > }
 >
My go to is \quoteDuring:

%{ Transposing Eb horn music %}

\version "2.25.13"

\include "english.ly "

EfHornNotes = \fixed c' { % or \relative or \absolute

    \set Score.quotedCueEventTypes = #'(
  note-event rest-event tie-event beam-event tuplet-span-event
  `dynamic-event slur-event articulation-event span-dynamic-event
    )

    \transposition ef
    \time 2/4
    a4( b) c( d) e( f g2)
}
\addQuote qef 

Re: Adding to a tagGroup on the fly

2024-03-02 Thread Raphael Mankin




On 02/03/2024 11:44, David Kastrup wrote:

Simon Albrecht  writes:


On 01.03.24 14:29, David Kastrup wrote:

Simon Albrecht  writes:


The downside of that is that I cannot add more tags to those groups on
the fly, and always have to add them directly to the library file.)

Suggestions for a user interface to do that?



Interesting. Would of course require naming tag groups, right?


Just naming an existing member should be enough since taggroups are
exclusive.


But unintuitive and  confusing to the reader

--
https://saturday-october-seven.com/



Re: Anyone know this ornament?

2024-02-19 Thread Raphael Mankin
The last bar of the 3rd system has it not followed by a chord. Maybe 
arpeggio or roulade as appropriate in the context.


On 19/02/2024 18:28, Engraver wrote:


This is a screenshot of the entire page.



Op 19-2-2024 om 19:25 schreef Stefan Thomas:

Dear Auke,
I don't know this ornament either but maybe it could be useful to see 
a few bars more of this music.

Best,
Stefan


Hallo, 


I'm transcribing the organ music of Josef Ferdinand Norbert Seger.
The prelude I'm currently working on, shows an ornamentation I am
not familiar with. See screenshot. I think it is probably meant as
arpeggio, but I'm not sure. Does anyone know for sure what it is? 

Regards, Auke 





--
https://saturday-october-seven.com/



Re: Alternate bars in different time signatures

2024-02-04 Thread Raphael Mankin




On 03/02/2024 23:45, Valentin Petzel wrote:

Am Freitag, 2. Februar 2024, 16:38:22 CET schrieb Lukas-Fabian Moser:

... and without any new insight, but with a healthy dose of syntactic sugar:


And with a rather simple custom engraver Lilypond will do these kinds of
things for us.



I know, but I have spent 60 years as a programmer regarding 
Lisp/Scheme/... as being (very nearly) the work of the Devil.


And thanks to all for your help.


Cheers, Valentin


--
https://saturday-october-seven.com/



Re: Alternate bars in different time signatures

2024-02-01 Thread Raphael Mankin
Thank you, that worked a treat. Though I also had to add a "\time 6/8" 
in order to get automatic bar lines inserted. "\time 3/4" produced wrong 
beaming in the 6/8 bars, and I can see that I may have to do some 
jiggery pokery to the beaming in 3/4 bars if, for example, I have 4 or 
more quavers.


On 01/02/2024 20:10, Knute Snortum wrote:
On Thu, Feb 1, 2024 at 10:50 AM Raphael Mankin <mailto:r...@mankin.org.uk>> wrote:


I have music with alternate bars in 3/4 and 6/8. The usual way to
indicate this is to  put both  time signatures at the start, but  I can
find  no way to do this.

I have tried "\time 3/4 <> \time 6/8", but I only get the last one.

Note, this  is not a compound time of 3/4+6/8, but alternating time
signatures.


I think this is what you are looking for.  I'm not sure where I found 
the code so I can't give credit to its author:


%%%
#(define ((time-alternate-time upa downa upb downb) grob)
    (grob-interpret-markup grob
      (markup #:override '(baseline-skip . 0) #:number
        (#:line (
            (#:center-column (upa downa))
            (#:center-column (upb downb)))

% and use it like this (5/8, 4/8 in this case):

   \override Score.TimeSignature.stencil =
     #(time-alternate-time "5" "8" "4" "8")

%%%


--
Knute Snortum



--
https://saturday-october-seven.com/



Alternate bars in different time signatures

2024-02-01 Thread Raphael Mankin
I have music with alternate bars in 3/4 and 6/8. The usual way to 
indicate this is to  put both  time signatures at the start, but  I can 
find  no way to do this.


I have tried "\time 3/4 <> \time 6/8", but I only get the last one.

Note, this  is not a compound time of 3/4+6/8, but alternating time 
signatures.


--
https://saturday-october-seven.com/



Re: zero-duration s to hold marks

2024-01-15 Thread Raphael Mankin
As a more general response to this thread, I feel that the reference 
manual needs to have more cross references. I frequently get a bit lost 
trying to find a suitable construct, or discovering what a construct means.


This thread has already shown that 1.2.2, 1.3.* and 1.5.* need to 
cross-reference each other.


On 12/01/2024 17:48, Mats Bengtsson wrote:


On 2024-01-12 15:58, Knute Snortum wrote:


At least section 1.2.2 of the reference manual ought to be updated to
include <> in the discussion of invisible rests.


Can you share how you would want that section changed?  Or I could 
take a stab at it, but it may not be what you want.  Also, <> can be 
used for a lot of different things that aren't rests, so maybe that 
section of the Notation manual is not the best place for it.


Agreed! In fact it's not a rest but the empty chord construct should 
rather be seen as a placeholder without any duration, to which you can 
attach things that normally are attached to notes. The question is where 
to best describe it in the manuals. If you search the full manuals for 
<>, the construct is used in several examples without any explanation, 
but there are also a few places where "empty chord" is described in 
conjunction with special cases of how to use it (see the entries for 
"chord, empty" in the Lilypond Index). In A.15 there's even a reference 
to the learning manual, 
http://lilypond.org/doc/v2.25/Documentation/learning-big-page#structure-of-a-note-entry, which unfortunately doesn't seem to explain it either, even though the construct is used in several examples also in the learning manual.


Perhaps one suitable place could be Sect. 1.3.1 of the NR "1.3.1 
Expressive marks attached to notes", but it could also be worth 
mentioning in 1.7 "Editorial annotations", for example. Technically, 
Sect. 1.5.1 "Chorded Notes" is the natural place to describe it, but 
that's probably not the most obvious place to look when you don't know 
about the construct.


    /Mats




--
Why you get crap software: testing just raises problems and makes you 
look bad.




Re: zero-duration s to hold marks

2024-01-12 Thread Raphael Mankin




On 10/01/2024 10:35, msk...@ansuz.sooke.bc.ca wrote:

On Wed, 10 Jan 2024, Raphael Mankin wrote:


That strikes me as being a programmer's response, and I speak as a programmer
for over 50 years. Using <> works, but it is unintuitive. If s0 is more
intuitive then that should be considered for future inclusion.


It's intuitive to me that s0 means a spacer rest of infinite duration,
because it's one whole note divided by zero.  And it opens the door
to using 0 as a duration denominator for other things than "s", as in "c0"
and "0", let alone constructions like "s0." which would seem to be
a spacer of one and one half times infinite duration.  I don't think it's
a good idea to open those doors.  There doesn't seem to be any way to
allow zero as the duration denominator except as a unique exception; it
cannot be done in a way that's consistent with other syntax.

I agree that 0 as a denominator would seem to indicate an infinite 
duration, and allow the rest of your argument. However <> still seems 
unintuitive.


At least section 1.2.2 of the reference manual ought to be updated to 
include <> in the discussion of invisible rests.



--
Political correctness: a kind of McCarthyite movement in reverse which,
in the name of tolerance proscribes all reference to gender, ethnicity,
color of skin, sexual preference, social provenance and even age. It has
no leaders, as far as I am aware, only terrified disciples. - John le Carre



Re: zero-duration s to hold marks

2024-01-10 Thread Raphael Mankin




On 09/01/2024 18:35, Paul Scott wrote:

On 1/9/24 11:29 AM, John Asmuth wrote:

Hi lilypond,

I have two users for a s0 (except it tells me 0 is not a duration).


<> does what I believe you want:  <>_\<

HTH,

Paul



That strikes me as being a programmer's response, and I speak as a 
programmer for over 50 years. Using <> works, but it is unintuitive. If 
s0 is more intuitive then that should be considered for future inclusion.


Intuitively, I would have expected <> to generate an empty space equal 
to the length of the preceding note, i.e. a chord that just happens to 
contain no notes.






First, I have a "\repeat unfold N {  ... }" and I want to surround the 
whole thing with a crescendo.


I could unpack the first and last item in the repeat, but I feel 
lily lilypond has some way to do an equivalent of "s0_\< \repeat 
unfold N { ... } s0_\!"


The second is for putting a mark, eg a coda, at the very end of a 
measure, over the barline (not over the last note, or the first note 
of the next measure).


Are there nice ways to do this?

Thanks!
- John







--
Political correctness: a kind of McCarthyite movement in reverse which,
in the name of tolerance proscribes all reference to gender, ethnicity,
color of skin, sexual preference, social provenance and even age. It has
no leaders, as far as I am aware, only terrified disciples. - John le Carre



Re: Output PDF to stdout

2024-01-07 Thread Raphael Mankin




On 05/01/2024 03:46, David Wright wrote:

On Thu 04 Jan 2024 at 23:34:28 (+0100), Volodymyr Prokopyuk wrote:


I know that lilypond can receive a source.ly file from the stdin by
using lilypond
-. Is it possible for lilypond to output PDF to the stdout?

My motivation behind using lilypond in a pipeline is to speed up PDF
generation by avoiding storing intermediary files on disk. The pipeline I'd
like to implement is
cat source.ly | lintLy | lilypond - | optimizePDF > score.pdf
Currently lilypond engraves PDF on disk, so a PDF optimizer has to read,
optimize, and substitute PDF on disk.


You could create a RAM disk to hold your intermediate files,
something along the lines of:

Ramdir="/dev/shm/${FUNCNAME[0]}$(printf '%(%s)T' -1)"
  $ mkdir -p "$Ramdir"

The first line (which I run in a bash function, for a quite different
purpose) creates a pseudounique but recognizable name, and the second
line creates the directory.

Cheers,
David.



Alternatively, use a fifo, e.g.

fifo=/var/tmp/ly-pdf$$
rm -rf $fifo
mknod  $fifo p
cat source.ly | lintLy | lilypond -o $fifo &
optimizePDF  < $fifo > score.pdf
wait
rm -rf $fifo

A trick I learned when doing Oracle backups. It also would not write to 
stdout.


--
Political correctness: a kind of McCarthyite movement in reverse which,
in the name of tolerance proscribes all reference to gender, ethnicity,
color of skin, sexual preference, social provenance and even age. It has
no leaders, as far as I am aware, only terrified disciples. - John le Carre



Re: Running a system command from within Lilypond [Solved]

2023-12-15 Thread Raphael Mankin




On 15/12/2023 16:23, Jean Abou Samra wrote:

I am on version Frescobaldi 3.2 and Lilypond 2.22.1 and do not appear
to have that option. At least, I have not found it. Anyway, I have
"automatic engraving" on.


It's in Edit > Preferences > LilyPond Preferences > Running LilyPond > 
Save document if possible, but I don't think it's going to auto-save 
when the engraving job is triggered by automatic engraving, unfortunately.


Ah, that one. Thank you. Now set.

--
In software design, perfection has been reached not when there
is nothing left to add, but when there is nothing left to take
away. - After RFC1925



Re: Running a system command from within Lilypond [Solved]

2023-12-15 Thread Raphael Mankin




On 15/12/2023 16:06, Jean Abou Samra wrote:
[Later] The error I am getting now is:  Processing 
`/tmp/frescobaldi-duowk0s5/tmpz726e77a/testGit.ly'   Parsing...fatal: 
not a git repository (or any of the parent directories): .git


If the path is in |/tmp/|, it means that you did not save your file 
before compiling, so Frescobaldi put the contents of the current editing 
window in a temporay file and compiled that.


If you simply remember to always save before compiling (or turn on 
save-on-compile in the preferences), Frescobaldi will compile your file 
with the directory where it's saved as the current directory. If that's 
inside a Git repository, |git| commands should work.




I am on version Frescobaldi 3.2 and Lilypond 2.22.1 and do not appear 
to have that option. At least, I have not found it. Anyway, I have 
"automatic engraving" on.


--
In software design, perfection has been reached not when there
is nothing left to add, but when there is nothing left to take
away. - After RFC1925



Re: Running a system command from within Lilypond [Solved]

2023-12-15 Thread Raphael Mankin
Thank you for the very  prompt response. I had tried popen, but with no 
luck. I will give it another go.I do not now remember what it originally 
said, if anything.


[Later] The error I am getting now is:
Processing `/tmp/frescobaldi-duowk0s5/tmpz726e77a/testGit.ly'
 Parsing...fatal: not a git repository (or any of the parent 
directories): .git


So, after a bit of faffing around for how to change the TMPDIR in the 
GUI, I changed my whisker-menu (Ubuntu/xfce4) entry to	

bash -c "TMPDIR=$HOME/src/Music/tmp frescobaldi %F"

Doing just
TMPDIR=$HOME/src/Music/tmp frescobaldi %F
did not work.

On 15/12/2023 13:25, Jean Abou Samra wrote:
I keep my Lilypond files in a git repository. I would like to 
interpolate the repo's version number in the Lilypond output by 
running a command like "git log|head -1". I can  do this from raw 
Scheme  using the system() function, but this does not seem to work in 
Lilypond.


How does it fail? It should definitely work. It will just not capture 
the output. See LSR 567  for a 
snippet that uses |open-pipe*| from |(ice-9 popen)| to achive 
essentially the same need as yours.


I realise that being able to do so opens up a massive security hole, 
but that is not a problem here.


LilyPond does not attempt to securely compile the file if it untrusted. 
(There used to exist a |-dsafe| option, but it was found to be 
irreparably broken, and got removed.)




--
In software design, perfection has been reached not when there
is nothing left to add, but when there is nothing left to take
away. - After RFC1925



Running a system command from within Lilypond

2023-12-15 Thread Raphael Mankin

Motivation:

I keep my Lilypond files in a git repository. I would like to 
interpolate the repo's version number in the Lilypond output by running 
a command like "git log|head -1". I can  do this from raw Scheme  using 
the system() function, but this does not seem to work in Lilypond.


So, now the question:

How do I run a system command from within Lilypond? I realise that being 
able to do so opens up a massive security hole, but that is not a 
problem here.


There are workarounds, like having a cron job that writes the text into 
a file at regular intervals and then including that file. But that is 
messy - and not portable to a machine that does not have that cron job.


BTW I run Lilypond from Frescobaldi.


--
In software design, perfection has been reached not when there
is nothing left to add, but when there is nothing left to take
away. - After RFC1925