Showing fingerings in front of slurs

2024-05-09 Thread Paul McKay
Hi
I want to show fingerings in front of slurs in a manner very like that
demonstrated in the "Using the whiteout property" snippet

This is what I've tried:
\version "2.24.0"
\language "english"

\relative {
\override Staff.Fingering.layer = 2 % fingering should overwrite
slurs
 \override Staff.Fingering.whiteout = ##t
r4 r8 -1-3( 16-2-4 -1-5-2-4-3-5)
}

but the fingerings still avoid the slurs. I want them to appear just where
they would if the Slurs weren't there at all.
What am I missing?
Thanks
Paul McKay


Showing fingering on top of slurs

2024-05-09 Thread Paul McKay
Hi
I want to show the fingering in front of the slurs. This should keep the
fingerings evenly spaced vertically over the notes.  I have tried the
following :

\version "2.24.0"
\language "english"

\relative {
\override Staff.Fingering.layer = 2 % fingering should overwrite
slurs
r4 r8 -1-3( 16-2-4 -1-5-2-4-3-5) }

Fingerings still avoid the slurs.
What am I missing?
Thanks
Paul McKay


keep a \book in a Variable

2024-01-22 Thread Paul McKay
Hi

I’m producing scores on multiple page sizes. The basic technique is to
create a new book for each size. Like this:

music = {

\new PianoStaff  <<

\new Staff = "right"

<< \clef treble \new Voice\soprano >>

\new Staff = "left"

<< \clef bass \new Voice \tenor \new Voice \bass >>

>>

}

"A4book" = \book {

\include "Output for A4.ily"

\bookOutputName "JS Bach - Book2-05 BWV 874 1-Praeludium D (A4)"



\score {

\keepWithTag #'pc \music

\layout { }

}

}

\”A4book”

The last line can be commented out so I don’t have to wait to generate all
possible page sizes during development. I just invoke the books I want to
work on.



But now I have a score which, at a particular page size, is on 3 pages. The
first page is repeated, and the last 2 pages are too. I want a blank page
at the start.



I’m trying to use bookParts. The following works:

\version "2.24.0"

\language "english"

hdr = \header {

title = "Praeludium 5"

subtitle = "BWV 874/1"

}



%testBook =

\book {

\bookOutputName "Booktest"

\bookpart { \markup \null }

\bookpart {

\hdr

\score {

\relative {  c'4 c c c }

\layout {  }

}

}

}

%\testBook

If I remove the comment markers, I think it should still work, but I get
the following instead:

Parsing...ERROR: In procedure ly:book-process:

Wrong type (expecting real number): #

Exited with return code 1.

What am I doing wrong?

Thanks in advance

Paul McKay


Re: How to make a blank page

2023-06-13 Thread Paul McKay
Hi
Many thanks to you all for your help. I thought you might like to know that
I found Simon's solution the best one.
Perhaps my minimal example was a little too pared down. In reality, I use
headers and footers on my music as well. So my minimal example begins:

Jean Abou's suggestion

\version "2.24.0"
\language "english"

\header {title = "Praeludium" }

myScore = \score { \relative { c'4 d e f g }}

\markup ""
\pageBreak
\myScore

puts the header on the first page and the music on the second page.

With Simon's trick I can use a variable to push the header after the
initial page break thus:

\version "2.24.0"
\language "english"
hdr = \header {title = "Praeludium" }
myScore = \score { \relative { c'4 d e f g }}
\bookpart { \markup \null }
\bookpart { \hdr  \myScore }

I guess my concept of how \pageBreak should work was gleaned from having to
use Microsoft Word. There you get a page break wherever you ask for one,
even if it makes no sense. (Followed by space above the first paragaph on
the page which is execrable. Don't get me started … )

On Mon, 12 Jun 2023 at 10:46, Valentin Petzel  wrote:

> Hello Silvain,
>
> it might help to understand that \pageBreak is not an instruction to
> insert a
> pageBreak. Think of \noPageBreak: This is a token that prevents a
> pageBreak to
> happen at the given place. Similarly \pageBreak is a token that enforces a
> pageBreak to happen at the given place (in other words the token must not
> happen within one page).
>
> Now, if you have
>
> [ page1 ]
> \pageBreak
> [ page2 ]
>
> and [page1] and [page2] are already two different pages the \pageBreak
> will not
> do anything, as there already is a pageBreak. This is similar to how
> adding
> \break at a line break will not cause an empty line. I’d suggest you do
>
> \pageBreak
> \markup\null
> \pageBreak
>
> The first \pageBreak will ensure that a new page is started, the second
> guarantees that the follwing content starts on a new page. All in all this
> will create an empty page, no matter where you insert it. You can even do
> a
> function for this:
>
> emptyPage =
> #(define-scheme-function () ()
>(collect-music-aux add-score #{ \pageBreak #})
>(add-text (markup #:null))
>(collect-music-aux add-score #{ \pageBreak #}))
>
> \emptyPage
> \markup "a"
> \emptyPage
> \markup "b"
>
> Cheers,
> Valentin
>
> Am Montag, 12. Juni 2023, 08:28:36 CEST schrieb Silvain Dupertuis:
> > I tried this trick, which seems to work :
> >
> > \markup " "
> > \pageBreak
> >
> > produces a blank page
> >
> > It seems that there must be something on the page for \pageBreak to
> produce
> > a page.
> >
> > Of course, there is also possibilities to add blank pages to a PDF
> document.
> > Le 11.06.23 à 15:41, Paul McKay a écrit :
> > > \version "2.24.0"
> > > \language "en"
> > > myScore = \score { \relative { c'4 d e f g }}
> > > \pageBreak
> > > \myScore
>
>


How to make a blank page

2023-06-11 Thread Paul McKay
Hi
I'm engraving a piece in two sections. The first section fits on one page
and the second one is rather longer and requires 2 pages. I would like the
pdf to have a blank page at the start because I often view pdf's with 2
pages side by side. All my searches have not helped. My minimum not-working
example is:

\version "2.24.0"
\language "en"
myScore = \score { \relative { c'4 d e f g }}
\pageBreak
\myScore

My understanding of the documentation says that this ought to produce an
initial blank page. It doesn't. A solution which would also allow me to
insert a blank space between scores (so I could begin a 2nd movement on an
even-numbered page) would be good, but my current request is just for an
initial one.
Thanks in advance for your help
Paul McKay


Re: How to color dynamics

2022-12-24 Thread Paul McKay
Awesome, thanks!

On Fri, 23 Dec 2022, 20:06 Jean Abou Samra,  wrote:

>
>
> Le 23 déc. 2022 à 20:56, Paul McKay  a écrit :
>
> 
> Hi
> I'm making a setting of some music with repeated melodies. The dynamics on
> the second repeat are slightly different in that some appear to have been
> omitted from the first time. I'd like to use the same code, but to show the
> "possibly omitted" dynamic marks in a different color. I have tried the
> following: the color of the dynamic marks is not altered. What do I need to
> do?
>
>
>
> You need to use the right grob. DynamicText is for \p, \f and the like,
> DynamicTextSpanner is for \cresc and \decresc, while DynamicLineSpanner is
> an invisible grob that aligns consecutive dynamics vertically. The grob
> printed by \< is a Hairpin. You can also use \tweak if you put it at the
> right place:
>
> 2\tweak color red\<
>
>
> For what it’s worth, one noteworthy change in version 2.24 is that the
> Internals Reference now has a description of each grob. For example, you
> can learn here what a DynamicLineSpanner is:
> https://lilypond.org/doc/v2.24/Documentation/internals/dynamiclinespanner
>
> Regards,
> Jean
>
>


How to color dynamics

2022-12-23 Thread Paul McKay
Hi
I'm making a setting of some music with repeated melodies. The dynamics on
the second repeat are slightly different in that some appear to have been
omitted from the first time. I'd like to use the same code, but to show the
"possibly omitted" dynamic marks in a different color. I have tried the
following: the color of the dynamic marks is not altered. What do I need to
do?
Thanks
Paul McKay

\version "2.24.0"

nn = \relative { \repeat unfold 16 e'4 }
dyn = { 4 2\<
\override DynamicLineSpanner.color = #red
\override DynamicText.color = #red
\override DynamicTextSpanner.color = #red
\tweak color #red
2\< 2\< 4\! }
<< \nn\new Dynamics \dyn >>


Re: How to enlarge the entire Lilypond output (pdf)

2022-09-16 Thread Paul McKay
Hi
I have several devices to show the music on. Rather than try to adjust the
size, I measure the visible area on the screen and tell LilyPond to use
that as its paper size.  I have a 27" screen, so for that, I set the paper
size to half the width and get my PDF viewer to show two pages at once. On
screens I see little point in margins so I use and include file "Output for
BENQ" which says:
\paper {
paper-height = 324 \mm paper-width = 295\mm
top-margin = 1 bottom-margin = 1 left-margin = 5 right-margin = 5
}
and then at the end of the .ly file I have:
music = {
\new PianoStaff \with {
...
} }
"A4book" =\book {
\include "Output for A4.ily"
\bookOutputName  "Grieg - (A4) Wedding day at Troldhaugen (Lyric piece
53)"
\score {
\music
\layout { #(layout-set-staff-size 16) }
%\midi { \tempo 4=80 }
}
}

tabletBook = \book {
\include "Output for Tablet.ily"
\bookOutputName  "Grieg - (tablet) Wedding day at Troldhaugen (Lyric
piece 53)"
\score {
\music
\layout { #(layout-set-staff-size 16)  }
}
}

PCBook = \book {
\include "Output for BenQ.ily"
\bookOutputName  "Grieg - (PC) Wedding day at Troldhaugen (Lyric piece
53)"
\score {
\music
\layout { #(layout-set-staff-size 16)  }
}
}
%\"A4book"
\PCBook

I am pleasantly surprised by how seldom I need to insert \tag's in the
music to control the manual pagebreaks to get repeats to show at nice
locations.

Hope this helps
Paul McKay

On Fri, 16 Sept 2022 at 16:02, Knute Snortum  wrote:

> On Thu, Sep 15, 2022 at 11:29 PM Eef Weenink 
> wrote:
> >
> > I use the crop function to minimize the white around the music.
>
> If you want, you can do this inside LilyPond in a paper block:
>
>   top-margin = 5\mm
>   bottom-margin = 6\mm
>   left-margin = 10\mm
>   right-margin = 10\mm
>
> --
> Knute Snortum
>
>


How to get .ly from .pdf

2022-09-07 Thread Paul McKay
Hi
I'm planning to learn Chopin's Prelude Op28 No4. I looked on Imslp and
found that Mr Snortum has already turned it into .ly. That was going to be
my next move because I need to add my own fingering and dynamics. On the
IMSLP page Knute says that the .ly files are included. (I have spotted that
exporting the lilypond source when making a PDF is an option in
Frescobaldi.) All the searches I have done just talk about how LilyPond
exports to PDF. Can someone please tell me how to retrieve such the .ly
from the .pdf.
Many thanks in advance
Paul


Re: More efficient way to code some fingering?

2022-09-01 Thread Paul McKay
And if you don't really need the '-' in "4-5" you can reduce
c^\finger "2" ^\finger "5-4"
to
c^2^54
because LilyPond interprets any list of numbers as a fingering.
HTH
Paul

On Wed, 31 Aug 2022 at 21:02, Valentin Petzel  wrote:

> Hello Joseph,
>
> \finger is only really necessary for using a markup as fingering
> indication
> (like in \finger "5-4"). For simple numeric fingerings you can always use
> ^/-/_
> with a number. So instead of fs^\finger "2" ^\finger "5" simply do ^2^5.
>
> Cheers,
> Valentin
>
> Am Mittwoch, 31. August 2022, 20:48:29 CEST schrieb Joseph Srednicki:
> > The example below shows some fingerings as I would like them to appear.
> > Is there a better and more efficient way to code this music and achieve
> the
> > same result without using multiple \finger commands for the same note? (I
> > am placing the fingerings above the notes to indicate clearly that they
> > pertain to right hand. In some places, the left hand must strike some
> notes
> > in the second or lower voice. My score places any fingering pertaining to
> > the left hand below the notes in the second voice. Therefore, I do not
> want
> > to place any right-hand fingerings below the notes of the second voice.)
> If
> > the Lilypond documentation or snippets provide a good example of a better
> > way to do what I am trying to achieve and I missed it, please point me to
> > appropriate references. Thanks for any advice.
> > Joe Srednicki
> > *
> > \version "2.22.2"\language "english"
> > global = {  \key c \major  \numericTimeSignature  \time 2/4}
> > rightOne = \relative c'' {  \global  e4^5 fs^\finger "2" ^\finger "5" | }
> > rightTwo = \relative c'' {  \globalc16 b c^\finger "2" ^\finger
> "5-4" d
> > c e d c | } \score {  \new PianoStaff  <<\new Staff = "right" <<
> > \rightOne \\ \rightTwo >>  >>}
>
>


Combining part-files into full scores

2022-05-26 Thread Paul McKay
Hi Ponders

Hi

I’m feel sure this question must have been addressed before, but I can’t
find any hints in the documentation which don’t involve editing lots of
files.



I’m inputting Scottish dance music for the accordion. It has my own
preferences about chord naming and positioning and also fingering on the
notes themselves. Each one has a shape like this:

\include “Dance.ily”

%{ titles etc }%

tuneSetup = { \key g \major   \time 2/2 \partial 4 }

tuneChords = \chordmode {  s4 g1 }

pianoChords = \chordmode {  s4 g2 e:m7 }

tuneMelody = { a b c d }

mainScore = score = {

<<

\new ChordNames { \tuneSetup \transpose c' c {\tuneChords } }

\new Staff \with { midiInstrument = "Accordion" } \tuneMelody

>>

\layout { indent = 0 }

}

\mainScore

When I am working on a piece, this is fine. It produces an independent copy
of the tune.



But I would like to combine these pieces in groups and to be able to use
the individual elements *without* having to edit all the individual tune
files. I have tried this:

\set Score.skipTypesetting = ##t

\include “Tune 1.ly”

% etc

\set Score.skipTypesetting = ##f

\mainScore

But, of course, I can’t \set Score.skipTypesetting at the top level. Tags
also only operate on musical expressions rather than scores.



I think this is exactly equivalent to writing a set of orchestral parts
where the individual instruments need editions which include cues but the
full score only needs the instrumental notes.



I have looked in
https://lilypond.org/doc/v2.22/Documentation/notation/different-editions-from-one-source#using-global-settings

But this only points me to editing each individual file – and it would make
more sense to copy and paste them into big file. I have been brought up to
prefer \include’s over multiple possibly identical copies. Just need to
know how to ask LilyPond to do it.





Thanks in advance

Paul McKay


Re: Wide screen Windows question

2022-02-12 Thread Paul McKay
Hi Valentin
Yes, I realized once I sent the message that I should have said I'm using
Windows 10. I will try it out.
Many thanks
Paul

On Sat, 12 Feb 2022 at 11:19, Valentin Petzel  wrote:

> Hello Paul,
>
> it would help to know what system you are on. I know for sure that KDEs
> Okular can do this, so supposing you are on either on Linux or Windows 10+
> this might be an option. This then looks as in the appended file (yes,
> having four pages next to each other makes little sense on a 17 inch
> screen, but well ... what should I do?).
>
> Cheers,
> Valentin
>
> 12.02.2022 11:30:27 Paul McKay :
>
> Hi
> Apologies that only half this question is Lilypond, but I'm sure someone
> in this group will have shared my frustration.
> I am very tempted to buy a nice wide monitor. I currently play from the
> screen of my laptop which sits on top of my grand piano. It's a real pain
> if I have to rotate the screen and the laptop to play from an A4 page at
> more or less full size. If I got a nice big monitor, the laptop could sit
> beside the piano and everything would be lovely …
>
> … except … any PDF reader will display 2 pages side by side. On a monitor
> with a 4:1 aspect ratio, this means that half of it is unused. Despite
> searching for a week, I haven't found any PDF reader which even thinks that
> wasting 50% of the display area is a bad idea. Does anyone know of any PDF
> reader which will display more than 2 pages at once? This is the best
> solution I have so far thought of. Other suggestions would be very welcome.
>
> On the other hand, I spend a huge percentage of my time playing music I've
> typed into LilyPond. It would be very easy to make a PDF file where pages
> were 4:1 and landscape. But rather than have a single line of music 80cm
> long, it would be good to have the page divided into four 20cm panels.
> Could someone tell me how to ask LilyPond to put music into columns? So
> far, I've only been able to find out about how to ask LilyPond to put words
> into columns.
>
> Many thanks in advance
> Paul McKay
>
>


Wide screen Windows question

2022-02-12 Thread Paul McKay
Hi
Apologies that only half this question is Lilypond, but I'm sure someone in
this group will have shared my frustration.
I am very tempted to buy a nice wide monitor. I currently play from the
screen of my laptop which sits on top of my grand piano. It's a real pain
if I have to rotate the screen and the laptop to play from an A4 page at
more or less full size. If I got a nice big monitor, the laptop could sit
beside the piano and everything would be lovely …

… except … any PDF reader will display 2 pages side by side. On a monitor
with a 4:1 aspect ratio, this means that half of it is unused. Despite
searching for a week, I haven't found any PDF reader which even thinks that
wasting 50% of the display area is a bad idea. Does anyone know of any PDF
reader which will display more than 2 pages at once? This is the best
solution I have so far thought of. Other suggestions would be very welcome.

On the other hand, I spend a huge percentage of my time playing music I've
typed into LilyPond. It would be very easy to make a PDF file where pages
were 4:1 and landscape. But rather than have a single line of music 80cm
long, it would be good to have the page divided into four 20cm panels.
Could someone tell me how to ask LilyPond to put music into columns? So
far, I've only been able to find out about how to ask LilyPond to put words
into columns.

Many thanks in advance
Paul McKay


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Paul McKay
Hi
Speaking as someone whose eyesight isn't quite as good as it used to be,
I'd like to suggest that anything in a colour is also in bold so that there
are enough pixels for me to see what the colour is.

And this seems the appropriate place to ask why the examples are all in
fixed pitch Courier in any case. I know this is kind of  industry standard
but it's one I don't find particularly helpful. I was once adept on the
card punch machines and mechanical typewriters, but I think most of us
abandoned fixed pitch fonts long, long ago. I'd suggest a sans serif font
so that there's a clear contrast with the Georgia used as the text font in
the documentation. Helvetica, Franklin Gothic and Source Sans Pro look good
but I realize they might not be available on some platforms.

HTH
Paul McKay

On Mon, 3 Jan 2022 at 23:33, David Kastrup  wrote:

> Flaming Hakama by Elaine  writes:
>
> > In this sense, it seems like the place that has the most potential use
> > for helping people distinguish different data types is where the
> > syntax is the most complicated and dense, which is in music entry.
> >
> > The ability to quickly distinguish articulations, dynamics, notes, and
> > durations seems like it would probably be most useful to people
> > reading examples in docs, since that is the most unusual aspect of
> > lilypond syntax.
>
> I find splitting a8 into different colors about as helpful for reading
> music as coloring note stems differently would be for reading score
> sheets: there is a standard place they are attached to anyway and there
> is no particular reason to look elsewhere.
>
> It would be much more useful to highlight note lengths separated by
> space but still common to a preceding note or rest, like
>
> \drummode { bd4 r r 4. 8 }
>
> where the 4. is sucked into the second r likely unintentionally.
> Highlighting this is helpful.  When there is a general "angry fruit
> salad" flavor pervading the highlighting with lots of colors everywhere,
> there just is not a lot of attention one can draw to actually important
> things.
>
> --
> David Kastrup
>
>


Help with beaming

2021-12-17 Thread Paul McKay
Hi
Can someone show me where I'm going wrong with the following. The piece is
in 2/4. I would like the default beaming for some sections (where there are
lots of eighth notes) to group them in whole bars but in sections where
there are lots of faster notes, then a beam ought only to span a quarter
note. In this example, if I ask for the first bars to be beamed in whole
bars, an extra beam appears in the following bars which joins all the fast
notes together. I would like the latter bars to continue to appear as they
do in this example, but for the first ones to appear all joined up.

Thanks in advance
Paul McKay
 example
\version "2.22.0"
\language "english"

firstTuplet = {
\once \override TupletBracket.bracket-visibility = ##t
\once \undo \omit TupletNumber
}
global = {
\key fs \minor
\numericTimeSignature
\time 2/4 \partial 8
\override TupletBracket.bracket-visibility = ##f
\omit TupletNumber
}
leftB = \relative {
\set Score.currentBarNumber = 65
\set Timing.beamExceptions = #'()
\set Timing.baseMoment = #(ly:make-moment 1/8)
\set subdivideBeams = ##t
% If you uncomment the next line, the beaming on the first 3 bars is
correct but
% there is an extra beam in the middle of the next three bars
%\set beatStructure = #'(4)
r8
|%{65%} g'8 e'e, e |%{66%} cs cs' r4 |%{67%} c,8 a' a, a
\set Timing.beatStructure = 2,2
|%{82%}  \repeat unfold 3 { r16 a32 b cs d e f \firstTuplet \tuplet 3/2
8 { g16 fs e fs e d } }
}
\score {
{ \global \leftB }
\layout { }
}


Changing staff colour

2021-06-04 Thread Paul McKay
Hi
I am working on some Haydn piano music and want to distinguish between
urtext and my version music. (I plan to write out the variations I use when
I repeat.) A neat way to do it would be to change the colour of the staff
lines. I can't find a way that works. I can change the colour easily enough
at the beginning of the staff, but it doesn't seem possible to change it
thereafter. For what I want to achieve, it would be fine to start a new
staff but it would need to look like a continuation of a previous one. Here
is what I've tried so far. I'd like the final version to have two
contiguous bars where the staff colour matches what's indicated by the
markup.
Thanks in advance.
Paul
\version "2.22.0"

% Change staff color
musicA = {
\new PianoStaff  <<
{ \new Staff = "right"  {
\accidentalStyle modern-cautionary
\override Staff.StaffSymbol.color = #blue
{ c'1-\markup "blue" }
  } \new Staff = "rong" { % Calling this one "right" too, doesn't
change anything.
  \override Staff.StaffSymbol.color = #magenta
{ c'1-\markup "Magenta" }
}
}
>>
}
musicB = {
\new PianoStaff  <<
{ \new Staff = "right"  {
\accidentalStyle modern-cautionary
\override Staff.StaffSymbol.color = #blue
{ c'1-\markup "blue" }
  \override Staff.StaffSymbol.color = #magenta
{ c'1-\markup "Magenta" }
}
}
>>
}

\score {
{ \musicA \musicB }
 \layout { indent = #0
  \context { \Staff \RemoveEmptyStaves }
 }
}


lilypond-windows.exe does nothing

2020-10-03 Thread Paul McKay
I'm trying to upgrade from 2.19 to 2.20 on a laptop running Win 10.
Uninstalled lilypond and Frescobaldi. Reinstalled 2.20. Loaded .ly file.
Asked to engrave it. It worked but there were errors in the .ly file. Fixed
them. Asked to engrave it. Nothing happened. Repeatedly … No other files
would engrave. Uninstalled Frescobaldi. Manually deleted all references to
it from the registry. Reinstalled it. No change. Tried to run lilypond
manually. (Lilypond and Lilypond/usr/bin are in my path.) *lilypond -h* works
fine and gives me the output I expect. *lilypond-windows -h* does nothing.
I uninstalled lilypond. Manually removed most mentions in the registry.
Downloaded it again and reinstalled. It still does nothing whenever
Frescobaldi or I try run it.

Any suggestions as to what to try next would be appreciated.
Thanks
Paul McKay


Re: Breathing mark and caesura

2020-09-20 Thread Paul McKay
Aha! That will probably also explain why its staff is that of the following
note. When the voice I'm writing changes staff I'd like to tell the breathe
mark to stay in the bass staff which is the staff of the preceding note but
haven't figured out how to make it happen.
Paul McKay

On Sun, 20 Sep 2020, 20:53 Kieren MacMillan, 
wrote:

> Hi David,
>
> >> 1. I haven't investigated, but \breathe must (e.g.) be attached to a
> >> <> or something, so that it has "its own moment".
> >
> > No?
> >
> > \breathe is not a post-event.  It's a standalone event of zero duration,
> > so its moment of time is that of whatever follows, not what precedes it.
>
> Thanks for the clarification!
> All I meant to point out was that last part: \breathe's moment is not the
> one Andrew was attaching the \override to.
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: kie...@kierenmacmillan.info
>
>
>


Re: Making lyrics quicker

2020-08-11 Thread Paul McKay
Cool! Thanks

On Tue, 11 Aug 2020, 17:53 David Kastrup,  wrote:

> Paul McKay  writes:
>
> > Hi Aaron.
> > Many thanks for this. I can now write functions like this:
> > mock = #(define-music-function
> >( punct)
> >( markup?)
> >#{ \addPunct \lyricmode { He mock -- eth at us } $punct #})
>
> That one's just
>
> mock = \addPunct \lyricmode { He mock -- eth at us } \etc
>
> --
> David Kastrup
>


Re: Making lyrics quicker

2020-08-11 Thread Paul McKay
Hi Aaron.
Many thanks for this. I can now write functions like this:
mock = #(define-music-function
   ( punct)
   ( markup?)
   #{ \addPunct \lyricmode { He mock -- eth at us } $punct #})
and
sopranoVerse = \lyricmode { \mock ; \mock ! }
Ace!

On Tue, 11 Aug 2020 at 10:03, Aaron Hill  wrote:

> On 2020-08-11 1:57 am, Aaron Hill wrote:
> > On 2020-08-11 1:48 am, Aaron Hill wrote:
> >>  (last (car (take-right elts 1)))
> >
> > And in my haste to reply, I overlooked simplifying the car/take-right
> > 1 to being just a call to the SRFI-1 "last" procedure:
> >
> >>  (last (last elts))
> >
> > Though, I probably should pick a better local variable name than
> > "last".  Even though the compiler does the right thing, such usage
> > could be prone to misunderstanding.
>
> Minimally improved version here that also demonstrates that lyric
> hyphens work:
>
> 
> \version "2.20.0"
>
> #(define (lyrics? x)
>(and (ly:music? x)
> (music-is-of-type? x 'sequential-music)
> (every (music-type-predicate '(lyric-event))
>(ly:prob-property x 'elements
>
> addPunct = #(define-music-function
>(lyrics punct)
>(lyrics? markup?)
>(let* ((elts (ly:prob-property lyrics 'elements))
>   (last-elt (last elts))
>   (text (ly:prob-property last-elt 'text)))
>  (ly:prob-set-property! last-elt 'text
>#{ \markup \concat { $text $punct } #})
>  lyrics))
>
> foobarbaz = \lyricmode { foo -- bar baz }
>
> \new Voice \fixed c' { g8 fis g4 a4. b8 | c'1 }
> \addlyrics { \addPunct \foobarbaz "," \addPunct \foobarbaz "!" }
> 
>
>
> -- Aaron Hill


Making lyrics quicker

2020-08-11 Thread Paul McKay
I'm working on transcribing some movements of an oratorio. In common with
that genre, the same words (more or less) get repeated over and over again.
I'm trying to minimize both typing and errors and have come up with the
following which does most of what I want:

\version "2.20.0"

Lord = \markup \concat { "L" \smallCaps "ord" }
noSee = \lyricmode { Yet doth the \Lord see it not; }
mock = \lyricmode { He mock -- eth at us; }
curse = \lyricmode { His curse hath fal -- len down up -- on us; }

sopranoVerse = \lyricmode {
%{p20%}  \mock \noSee \mock \mock \curse
}
I still need to type in explicit lyrics for when half-phrases are repeated.
The real shortcoming is that the phrases actually tend to be followed by
different punctuation. I've hard coded semicolons in this example, but I'd
like to be able to replace them with other things without doing much
typing. Making each one a function would be fine: something like \*curse ! *No
problem putting punctuation after each one, but I'm only a beginner with
*define-music-function* and this isn't a music function.

Thanks
Paul McKay


Circles round fingerings

2020-06-24 Thread Paul McKay
Hi
I'd like to put a circle round occasional fingering marks. I have tried
*\circle*, but seem to have no control of the resulting thickness nor of
the font features. I can find no way to customize the fingering font within
the *\circle: *I always get some error message or other.

I tried \draw-circle, but that's a kludge and I can't make it overlap.

What I'd really like is to set up the fingering font attributes at the
Score level so that I don't have to reset them every time I use fingering
in a music expression. Perhaps that would encourage *\circle* to use them.
In the following example, I'd really like to see a fingering on the e which
has a bold red circle around it and properly centred. It would be good if
it could handle tweaks to the Y-offset too because the circle might collide
with other things.

Thanks
Paul McKay

Example:
\version "2.20.0"

customFingering = {
\override Fingering.font-name = "Arial Black"
\override Fingering.font-size = #-1
\override Fingering.color = #(x11-color "DarkRed")
}
tune = \relative {
\customFingering
c'4 d-2  e -\markup {   { \circle \finger  "3" } }
g-5-\tweak Y-offset 5 -\markup {\center-align \draw-circle #1 #.5 ##f }
}
\score {
<<
\time 4/4
\new Staff \tune
>>
\layout {}
}


Re: Getting started with Scheme

2020-05-26 Thread Paul McKay
Hi John
Thanks for this. It's good to know it works for someone. I'll keep on
trying.
Paul

On Sat, 23 May 2020 at 15:35, John Schlomann 
wrote:

> Paul,
>
> I'm a Windows 10 user. (I'm hoping to get my Linux system rebuilt one of
> these days.) I currently use LilyPond 2.20.0.
>
> My GUILE_LOAD_PATH is set the same as yours (C:\Program Files
> (x86)\LilyPond\usr\share\guile\1.8). It's defined under "user variables",
> if that matters.
>
> For most terminal window activities I use Git Bash, but for running Guile
> I actually prefer the built-in Windows cmd, which I get with the Windows
> key and then typing c m d. I always invoke Guile with
>
> lilypond scheme-sandbox
>
> It sounds like you’ve tried these very same things, and you say LilyPond
> itself is working OK. Have you tried starting Guile without passing it a
> file? That should bring up a guile prompt. (quit) will then exit Guile.
>
> I fear this is no help to you. I just wanted to share that it does work
> fine on Windows 10. Good luck.
>
> John
>
> > -Original Message-
>
> > From: lilypond-user [mailto:lilypond-user- 
>
> > bounces+jschlomann=wideopenwest@gnu.org] On Behalf Of Ralf
>
> > Mattes
>
> > Sent: Saturday, May 23, 2020 5:53 AM
>
> > To: Kevin Barry
>
> > Cc: Lilypond-User Mailing List; Paul McKay
>
> > Subject: Re: Getting started with Scheme
>
> >
>
> >
>
> > First off: I'm not a windows user (if I can avoid it) but I would
> strongly suggest
>
> > to use a real
>
> > terminal and _not_ cmd. The one from the Windows store is actually
> pretty
>
> > good (esp. when
>
> > compared to cmd). You can either download it for free from the app
> store or
>
> > from github
>
> > (https://github.com/microsoft/terminal/releases) - yes, that's right.
> Microsft
>
> > software
>
> > as an open-source download from github :-)
>
> >
>
> >  Cheers, RalfD
>
> >
>
> > Am Samstag, 23. Mai 2020 12:37 CEST, Kevin Barry 
>
> > schrieb:
>
> >
>
> > > Hi Paul,
>
> > >
>
> > > I'm sorry you haven't had the best experience with the scheme sandbox.
>
> > > Since development of LilyPond mostly takes place on Linux it's
> possible
>
> > > that Windows-related documentation can be neglected...
>
> > >
>
> > > On Sat, May 23, 2020 at 10:51:58AM +0100, Paul McKay wrote:
>
> > > > I have Frescobaldi 3.1.2 as well (in case that’s relevant).
>
> > >
>
> > > Well... yes you can use Frescobaldi/LilyPond as a sort of Guile IDE if
>
> > > you want.  If you put a \version statement at the top of the file and
>
> > > start each scheme expression with a '#' then it should work.
>
> > >
>
> > > > When the documentation refers to ‘opening a terminal window’ I
> assume
>
> > this
>
> > > > means a command prompt of some kind. (If so, it would be good to use
>
> > this
>
> > > > terminology. Not many of us remember the VT52 emulators.)
>
> > >
>
> > > On Linux and MacOS systems the relevant apps are all still named some
>
> > > variation of terminal (terminal, gnome-terminal, terminal.app, iterm,
>
> > > terminator - you get the picture). I'll see about adding a
> clarification
>
> > > for Windows users to refer them to cmd.
>
> > >
>
> > > > My copy of windows doesn’t have a *Start* menu: so that’s another
>
> > > > instruction that is meaningless.
>
> > >
>
> > > OK. Is there a common way to accomplish the old Start -> Run -> type
> in
>
> > > the name of a program?
>
> > >
>
> > > > At which point I’m presented with an unresponsive terminal. I exit
> via
>
> > > > Ctrl-C.
>
> > >
>
> > > If there is another Windows user on the list who has this working
>
> > > hopefully they can chime in and we can update the documentation as
>
> > > necessary.
>
> > >
>
> > > > I would be grateful for any help to get this going: or a redirection
>
> > > > to a better environment. Is there a Scheme IDE? I’ve never seen
>
> > > > anything like a comment in Scheme code. I wonder is it a write-only
>
> > > > language, the way APL was.
>
> > >
>
> > > I don't know about Scheme IDEs. An internet search suggests DrScheme
>
> > > might be suitable, but I think most people on this list use their
>
> > > LilyPond environment for working with scheme.
>
> > >
>
> > > What happens if you try running the guile program on its own (not via
>
> > > lilypond scheme-sandbox)?
>
> > >
>
> > > Kevin
>
> > >
>
> >
>
> >
>
> >
>
> > --
>
> > Ralf Mattes
>
> >
>
> > Hochschule für Musik Freiburg
>
> > Projektleitung HISinOne
>
> > Schwarzwaldstr. 141, D-79102 Freiburg
>
> > http://www.mh-freiburg.de
>
> >
>
> >
>
> >
>
>


Getting started with Scheme

2020-05-23 Thread Paul McKay
Hi

I’d like to be able to do all those funky things with Scheme functions. I
downloaded and installed the latest versions of everything (LilyPond
2.20.0) and it works fine. Then I went to
http://lilypond.org/doc/v2.20/Documentation/extending/scheme-sandbox and
got stuck. I’m running Windows 10 and accepted all the defaults on
installation. I have Frescobaldi 3.1.2 as well (in case that’s relevant).

When the documentation refers to ‘opening a terminal window’ I assume this
means a command prompt of some kind. (If so, it would be good to use this
terminology. Not many of us remember the VT52 emulators.) I have tried both
PowerShell and Command. First I set GUILE_LOAD_PATH as required (to
'C:\Program Files (x86)\LilyPond\usr\share\guile\1.8').

My copy of windows doesn’t have a *Start* menu: so that’s another
instruction that is meaningless.

I then adjusted the *PATH* variable so that it included the
*ly/usr/bin* directory and tried lilypond scheme-sandbox x.

The result was:

lilypond : GNU LilyPond 2.20.0

At line:1 char:1

+ lilypond scheme-sandbox

+ ~~~

+ CategoryInfo  : NotSpecified: (GNU LilyPond
2.20.0:String) [], RemoteException

+ FullyQualifiedErrorId : NativeCommandError

 Processing `C:/Program Files
(x86)/LilyPond/usr/share/lilypond/current/ly/scheme-sandbox.ly'

Parsing...



At which point I’m presented with an unresponsive terminal. I exit via Ctrl-C.



I would be grateful for any help to get this going: or a redirection
to a better environment. Is there a Scheme IDE? I’ve never seen
anything like a comment in Scheme code. I wonder is it a write-only
language, the way APL was.



Thanks

Paul McKay


Re: Suggestion to make sharps and flats persistent

2020-05-20 Thread Paul McKay
Hi guys

Many thanks for taking such an interest in this. I have been thinking. I
can see that using the key signature to automatically donate sharps and
flats is going to be a lot of work and cause problems.

Todays thoughts are: when you specify \language, then part of what you are
doing is setting up the parser to understand which character sequence
should indicate an f-sharp. I would like to be able to temporarily
reconfigure this so that as well as mapping ‘fs’  to f-sharp you can ask it
to map ‘F’ to f-sharp. I imagine that the parser is a finite state machine
and that at the appropriate point it looks up a list. Normally this would
say that ‘fs’ means f-sharp (or ‘fes’ means f-sharp if you were in another
language). I guess it looks up a list of pitch names to check whether the
current token is a pitch as expected and, if so, which one. If that list
might have ‘F’ added at the beginning of the search order, then the parser
would recognize the letter ‘F’ as meaning the pitch f-sharp. Later on, you
could ask to remove the ‘F’ entry from that list. Removing it would
automatically revert to the default behaviour because the list would still
contain the entry to say that ‘fs’ means f-sharp. To avoid confusion, the
request to add an item to the list would have the form (*newName,
pitchNameInOriginalLanguage)*.

I believe this would allow me to do what I originally wanted (to avoid
having to type the accidentals when I’m working with music which is
resolutely in one key) and would not raise any consequential problems.
Granted one could get a headache if you mapped  ‘e’ to mean f-sharp, but
you’d deserve it. People who like quarter-tones might also enjoy being able
to name them. This doesn’t seem to me like a big change.

Gianmaria: It might possibly be doable in Frescobaldi but I don’t think it
belongs there. One would end up with a source file which contained both
LilyPond and Frescobaldi code. This is not an insuperable problem, but I
don’t think it’s the right answer for this.

Urs: I am always encoding a pitch as it is: but am asking that I get to
give the pitch another name.

Re the discussion about minor keys, in A minor you could set G to map to
g-sharp and save keystrokes (unless you count the shift key as a keystroke
in which case you might use ‘h’.)

On Mon, 18 May 2020 at 18:24, Gianmaria Lari 
wrote:

>
> [...]. That being said…
>>
>> Are not
>>
>> \relative f'
>>
>> and
>>
>> \fixed c'''
>>
>> just "feature requests for laziness with resulting opaqueness"?  ;)
>
>  [...]
>
>>
>
> We (well… modulo me LOL) don’t get this worked up about how \relative
>> makes cut-and-paste a nightmare. Why start now?  ;)
>
>
> Some lilypond users get vaccinated against \relative issues and they are
> using it without any problem (it's not my case). So looks pretty clear you
> can live and get profit from \relative.
>
> Personally I really don't like \relative: it always cause problems to me
> but maybe there are also aesthetic reasons for my aversion.
>
> As I previously said (few months ago) \relative is another thing that in
> my opinion should be handle by the editor.
>
> Copy and paste issues with relative is only another bad things but for me
> it's not the main one.  For example I consider perfectly acceptable copy
> and paste issues with Python indention because the benefits largely
> outweigh the drawbacks imho.
> G.
>


Re: Suggestion to make sharps and flats persistent

2020-05-16 Thread Paul McKay
Hi David
I agree that searching backwards would be horrific. I was not thinking it
would be implemented that way. Suppose one could write something like the
following:

itsInDmajor = { \override Voice.pitchTweaks = #( (f fs) (c cs) )

music = { \ itsInDmajor d4 f a c d }

and implement it where *pitchTweaks* is a list property of Voice or perhaps
Score too. If missing or empty, it would do nothing. There would need to be
3 methods on this object: *addOrReplace(pitchInput, pitchOutput);
remove(pitchInput); *and *tweaked Pitch(pitchInput);*
The *tweakedPitch* method would return the *pitchInput* unless that pitch
was in the list.

As soon as the parser has recognized something as an input pitch it would
substitute the tweaked  pitch. Putting fS in the music would be syntactic
sugar for:

   - create  Voice.pitchTweaks if necessary
   - Voice.pitchTweaks.addOrReplace(f, fs)

I can't program Scheme or Python and don't know the internals of LilyPond
so I'm sure to have got some syntax errors in the above, but I hope it
explains better what I've been thinking.
Paul

On Wed, 13 May 2020 at 15:32, David Wright 
wrote:

> On Wed 13 May 2020 at 14:59:10 (+0100), Paul McKay wrote:
>
> > If I'm writing music in F, then I suggest that I be able to use *bF*  as
> a
> > pitch instead of *bf*. The *F* would indicate that all subsequent *b*s
> > would be flattened until one is encountered with a different accidental
> or
> > until the end of the current music expression. It should have the same
> > scope as \stemUp or similar.
>
> The problem with that is that to find out what any particular "b"
> represents, you have to search backwards, note-by-note, looking for
> any such modification that might have been made to a "b" earlier.
>
> Any copy-and-paste manipulations become potential nightmares.
>
> Cheers,
> David.
>


Suggestion to make sharps and flats persistent

2020-05-13 Thread Paul McKay
Hi
I can't help thinking that this has probably been suggested before, but in
case it hasn't I've set out my thoughts here. In the past I've used
Sibelius and I like the way that it applies sharps and flats from the key
signature automatically. This really doesn't seem to conform to the way
Lilypond does things, but my suggested change, I think, should do much the
same. I habitually use English as the Lilypond \language, so please bear
with me.

If I'm writing music in F, then I suggest that I be able to use *bF*  as a
pitch instead of *bf*. The *F* would indicate that all subsequent *b*s
would be flattened until one is encountered with a different accidental or
until the end of the current music expression. It should have the same
scope as \stemUp or similar.

As I see it, the changes in the parser would be small: we would need to
introduce an explicit 'natural' indication and to recognize capitalized
accidentals. (In the case of accidentals with more than one letter, then I
leave it to the implementors to decide whether all need to be capitalized
or just one.)

You will notice that although the key signature will be the most probable
reason for using this idea, I'm simply suggesting an  extension to the way
of expressing which pitches I want in a way which is independent of key
signature and in keeping with the way Lilypond does this (at least the way
I use it  ) It also means that all current scores continue to work
without modifications.

Paul McKay