run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich

Dear Lilypond Users,

I have been using Lilypond for a long time and am in awe of those who 
have created Lilypond and who maintain it.  It is the most wonderful and 
flexible package, with super high-quality results. I have not written to 
the Users Group before, but will have certain specialised notation 
queries in the future.


One of the key parts of Lilypond for me is Lilypond Book, and I am 
working on a major project with it.  I have used it extensively with 
Lilypond 2.18.2.


Since moving to Windows 10, I have not been able to get it to run, 
although David Wright's message to the User Group about adding the .py 
extension when invoking it got me further than I was at first.  I have 
Lilypond 2.22.1 installed.  My batch file is:


lilypond-book.py --output=out --pdf ALMdurasnumber.lytex
cd out
pdflatex ALMdurasnumber.tex
cd ..\

which is what has always worked for me in the past.


The error message I get is as follows:

C:\P3L\lpbk>ALMdurasnumber.bat

C:\P3L\lpbk>lilypond-book.py --output=out --pdf ALMdurasnumber.lytex
  File "C:\Lilypond2221\usr\bin\lilypond-book.py", line 376
    except subprocess.CalledProcessError as e:
  ^
SyntaxError: invalid syntax

C:\P3L\lpbk>cd out

C:\P3L\lpbk\out>pdflatex ALMdurasnumber.tex
'pdflatex' is not recognized as an internal or external command,
operable program or batch file.

C:\P3L\lpbk\out>cd ..\

C:\P3L\lpbk>

The message about pdflatex is a conundrum.  It has always worked before, 
but I cannot find a 'pdflatex' file in the \user\bin of version 2.18.2 
or 2.22.1.  It does not appear to be complaining about anything in my 
lytex file -- which I had previously compiled successfully with 2.18.2.


Any help will be greatly appreciated.

Archer Endrich
archer...@gmail.com




Re: run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich
Thank you Knute and David!  I have downloaded and installed MiKTeX and 
rerun my batch file (without the .py added to lilypond-book).


It appears to have called lilypond-book successfully and also pdflatex.  
However, it still reports an error in lilypond-book.ly which is 
preventing compilation.


Here is the output:

C:\P3L\lpbk>ALMdurasnumber.bat

C:\P3L\lpbk>lilypond-book --output=out --pdf ALMdurasnumber.lytex
  File "C:\Lilypond2221\usr\bin\lilypond-book.py", line 376
    except subprocess.CalledProcessError as e:
  ^
SyntaxError: invalid syntax

C:\P3L\lpbk>cd out

C:\P3L\lpbk\out>pdflatex ALMdurasnumber.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.6)
entering extended mode
! I can't find file `ALMdurasnumber.tex'.
<*> ALMdurasnumber.tex

Please type another input file name:

So it all seems to be working except for the reported error.

Regarding paths, I had renamed my lilypond directory with a version 
number, and updated my Windows path accordingly,  Lilypond itself has 
been running fine, so, as far as I can tell, the paths are OK (and it 
was happy without the .py extension in the batch file).


Perhaps someone could check out line 376 for me.  Thanks again.
Archer




Re: run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich

Hello Aaron,

Thank you for your reply.  I've checked the version of python.exe in my 
Lilyond usr\bin and it's 3.7.4, so it is puzzling that it is flagging an 
error about something not valid prior to 2.6.  I can't think where to go 
from here.


Thanks.
Archer
P.S. I hope I've replied properly to yourself and to the user-group.

On 06/08/2021 16:55, Aaron Hill wrote:

On 2021-08-06 8:46 am, Archer Endrich wrote:

[ . . . ]
C:\P3L\lpbk>lilypond-book --output=out --pdf ALMdurasnumber.lytex
  File "C:\Lilypond2221\usr\bin\lilypond-book.py", line 376
    except subprocess.CalledProcessError as e:
  ^
SyntaxError: invalid syntax
[ . . . ]
Perhaps someone could check out line 376 for me.  Thanks again.


The error message clearly indicates this is invalid syntax for the 
version of Python you are running.  In particular, "as" is not valid 
prior to 2.6 according to [1].


[1]: 
https://stackoverflow.com/questions/2535760/python-try-except-comma-vs-as-in-except#2535770



-- Aaron Hill




Re: run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich

Hello Carl,

That was a good idea.  When I enter 'python' on the top level of my C:\ 
drive, it says that the version is 3.7.4.


However, there was an earlier version in my 2.18.2 Lilypond, so I 
renamed that to disable it and added a full path to my 2.22.1 
lilypond-book in my batch file.


I can't find any other PYTHON on my system (e.g., in Program Files).  I 
haven't reinstalled any other Python since moving to Windows 10, which 
involved a completely new hard drive.


The error message about line 376 no longer appears, but the .tex file is 
not created, so pdflatex has nothing to work on.


When I run the batch files, Windows keeps asking me "How do you want to 
open this py file?" but does not give be a Browse option. Notice the 
"access is denied" message in the command line display after running.  
(I haven't actually been able to specify that I want LilyPond to run it.


This is the display:

C:\P3L\lpbk>ALMdurasnumber.bat

C:\P3L\lpbk>C:\Lilypond2221\usr\bin\lilypond-book --output=out --pdf 
ALMdurasnumber.lytex

Access is denied.

C:\P3L\lpbk>cd out

C:\P3L\lpbk\out>pdflatex ALMdurasnumber.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.7)
entering extended mode
! I can't find file `ALMdurasnumber.tex'.
<*> ALMdurasnumber.tex

Please type another input file name:
! Emergency stop.
<*> ALMdurasnumber.tex

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
Terminate batch job (Y/N)? y

C:\P3L\lpbk\out>cd ..

Maybe David Wright's suggestion was correct, namely that "Something 
looks odd about C:\Lilypond2221\usr\bin\lilypond-book.py

in that I would expect either C:\Lilypond2221\bin\lilypond-book
or C:\Lilypond2221\LILYPOND\usr\bin\lilypond-book where LILYPOND
is either lowercase or camelcase (I have seen both). "

Perhaps lilypond-book needs that path -- but my normal LilyPond notation 
works OK with my 'odd' path.


So I'm still puzzled.
Archer

On 06/08/2021 17:34, Carl Sorensen wrote:

You might check the following:

Is there a python.exe that is somewhere in the path ahead of Lilypond's python?

What is your system python version?

The method you used to run lilypond-book does not include an explicit call to 
the lilypond's python; IIUC you're just using the .py extension to allow 
Windows to choose the application for that extenstion, and it may be another 
python somewhere in your system.

HTH,

Carl


On 8/6/21, 10:22 AM, "lilypond-user on behalf of Archer Endrich" 
 wrote:

 Hello Aaron,
 
 Thank you for your reply.  I've checked the version of python.exe in my

 Lilyond usr\bin and it's 3.7.4, so it is puzzling that it is flagging an
 error about something not valid prior to 2.6.  I can't think where to go
 from here.
 
 Thanks.

 Archer
 P.S. I hope I've replied properly to yourself and to the user-group.
 
 On 06/08/2021 16:55, Aaron Hill wrote:

 > On 2021-08-06 8:46 am, Archer Endrich wrote:
 >> [ . . . ]
 >> C:\P3L\lpbk>lilypond-book --output=out --pdf ALMdurasnumber.lytex
 >>   File "C:\Lilypond2221\usr\bin\lilypond-book.py", line 376
 >> except subprocess.CalledProcessError as e:
 >>   ^
 >> SyntaxError: invalid syntax
 >> [ . . . ]
 >> Perhaps someone could check out line 376 for me.  Thanks again.
 >
 > The error message clearly indicates this is invalid syntax for the
 > version of Python you are running.  In particular, "as" is not valid
 > prior to 2.6 according to [1].
 >
 > [1]:
 > 
https://stackoverflow.com/questions/2535760/python-try-except-comma-vs-as-in-except#2535770
 >
 >
 > -- Aaron Hill
 
 





Re: run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich

On 06/08/2021 18:32, Knute Snortum wrote:

On Fri, Aug 6, 2021 at 9:35 AM Carl Sorensen  wrote:

You might check the following:

Is there a python.exe that is somewhere in the path ahead of Lilypond's python?

This can be checked using the Windows "where" command:

C:\> where python

--
Knute Snortum



Thanks.  I did this:
C:\>where python
C:\Lilypond2221\usr\bin\python.exe
C:\Users\Archer\AppData\Local\Microsoft\WindowsApps\python.exe
(I ran this this Python from the command line and it said it was version 
3.6)


I also downloaded and installed Python3.9.  This time when I ran my 
batch file, Windows asked if I wanted to open the .ly file with 
Python3.9.  I said OK.  I wonder if it tried to run Python directly.  
Anyway, something happened, and then I was back to:


C:\P3L\lpbk>C:\Lilypond2221\usr\bin\lilypond-book --output=out --pdf 
ALMdurasnumber.lytex


C:\P3L\lpbk>cd out

C:\P3L\lpbk\out>pdflatex ALMdurasnumber.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (MiKTeX 21.7)
entering extended mode
! I can't find file `ALMdurasnumber.tex'.
<*> ALMdurasnumber.tex

Please type another input file name:
! Emergency stop.
<*> ALMdurasnumber.tex

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
Terminate batch job (Y/N)? y

with no complaint about "can't access".  Maybe my OK re opening with 
Python was incorrect.


Still struggling, but very grateful for your help.
Archer




Re: run error Lilypond-book on Windows 10

2021-08-06 Thread Archer Endrich

Dear David, Carl and Knute,

Thank you for all your replies and information.  I'll work on the 
file-association suggestion tomorrow and let you know if the problem is 
solved.


Thanks again,

Archer





success with lilypond-book

2021-08-07 Thread Archer Endrich

To David, Knute and Carl,

I am happy to report success with running lilypond-book on Windows 10.  
For users' info, these are the steps I took, as guided by David, Knute 
and Carl.  It is hard to tell at this point whether it would have worked 
if one or the other of these steps had been omitted.


a) downloaded and installed Python version 3.9 (although 3.6 seemed to 
be on the system already)
b) downloaded and installed MiKTeX  (i.e., pdflatex now on my Windows 10 
computer)
c) rearranged the LilyPond files to be inside a folder named LilyPond;  
thus the file arrangement became: C:\Lilypond2221\LilyPond\user\bin;  
then edited the system path accordingly.  My full system path now looks 
like this:


C:\P3L\lpbk>path
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Lilypond2221\LilyPond\usr\bin;C:\cdpr71ae\_cdp\_cdprogs;C:\Users\Archer\AppData\Local\Microsoft\WindowsApps;C:\MiKTeX\miktex\bin\x64\

d) associated Python with lilypond-book.py - The link Knute sent about 
this was very helpful: 
https://www.digitaltrends.com/computing/how-to-change-file-associations/



I first ran lilypond-book manually direct from the command line like this:
>python C:\Lilypond2221\LilyPond\user\bin\lilypond-book.py --output=out 
-- pdf ALMdurasnumber.lytex

[msg:  compiling ALMdurasnumber.lytex ... writing ALMdurasnumber.tex]
>cd out
>pdflatex ALMdurasnumber.tex
[msg:  output written on ALMdurasnumber.pdf]

I then tried running from a batch file in various ways:
Trial 1:
C:\Lilypond2221\LilyPond\user\bin\lilypond-book.py --output=out -- pdf 
ALMdurasnumber.lytex

cd out
pdflatex ALMdurasnumber.tex
cd ..\
This was successful.

Trial 2: the same, but without the .py extension on lilypond-book
This was successful.

Trial 3: the same, but without the explicit path to lilypond-book
This was also successful.

So I'm up and running with lilypond-book (with my batchfile as I had 
been writing it on Windows 7) thanks to all the various help/clues that 
were contributed.  The final batch file is:


C:\lilypond-book --output=out --pdf ALMdurasnumber.lytex
cd out
pdflatex ALMdurasnumber.tex
cd ..\


I hope this information helps others who might find themselves in a 
situation similar to mine.


Huge thanks!
Archer




Re: is this a slashed grace?

2022-09-16 Thread Archer Endrich

Hello Ken,

I have a workaround for this problem, namely to create an oblique line 
and move it onto the beam.  I did not use \acciaccatura but rather 
smaller notes because I wanted to control the spacing of the notes.


See the attached slashedacciaccworkaround.pdf and .ly.

I hope this may be of use.

Archer


On 16/09/2022 06:07, David Wright wrote:

Kenneth Wolcott wrote:

   I asked this question regarding a different piece that I was engraving.  It 
looks like the slashed grace as shown in the Lilypond documentation is not the 
same as what I have engraved (there is no slash).
   Now another piece has come up with the same question.
   Maybe these aren't slashed grace notes?  Maybe (as usual) I'm doing 
something wrong?
   My input, my engraving and the origin I'm reading from are attached.

Mark Stephen Mrotek wrote:

Are you referring to the ornaments is measures 3, 11, and 25?

Kenneth Wolcott wrote:

That's correct.

https://lilypond.org/doc/v2.22/Documentation/notation/special-rhythmic-concerns

Scroll down to:

   Known issues and warnings

   A multi-note beamed acciaccatura is printed without a slash,
   and looks exactly the same as a multi-note beamed appoggiatura.

Cheers,
David.


slashedacciaccworkaround.pdf
Description: Adobe PDF document
%slashedacciaccworkaround.ly

\version "2.22.1"

% WORKAROUND FOR A SLASHED ACCIACCATURA
% Uses (mostly) 7/4 virtual bars (invisible bar lines in the ly file)

\score {
\new PianoStaff 

<<
  \new Staff = "up" \with { 
 \remove "Time_signature_engraver"
 \override TupletBracket.bracket-visibility = ##t
 \clef treble
 midiInstrument = #"acoustic grand"
  }

  {  
% Bar 9 (7/4) - big problem with 'keep-alive' -- see LH part
1\p s8
% 7-note Change staff passage
\override NoteHead.font-size = #-3
\once \override Beam.positions = #'(-4.0 . -4.0)
\once \override TextScript.extra-offset = #'(-0.5 . -2.5)
\stemDown fis''!8_\markup{\dynamic f \italic{secco}}[  
\change Staff = "down" \stemUp c''8 
\change Staff = "up" \stemDown e'' 
\change Staff = "down" \stemUp f' 
\change Staff = "up" \stemDown b'' 
\change Staff = "down" \stemUp a'
\change Staff = "up" \stemDown g''] ~ g''4 \bar ""
 
% Bar 10
\revert NoteHead.font-size
\stemNeutral
  }
  
  %LOWER STAFF
  \new Staff = "down" \with {
 \remove "Time_signature_engraver"
 \override TupletBracket.bracket-visibility = ##t
  }
   
  {
\set Staff.pedalSustainStyle = #'mixed
% Bar 9 (2/4 + s8 + 5/4)
<< { g'1 \once \override TextScript.extra-offset = #'(2.5 . 4.0) s8^\markup{\draw-line #'(-2.5 . 4.0)}} 
\\
{des'8\sustainOn_( bes4 des'8 ~ des'8[ bes] ~ bes4_) s8\sustainOff}
>>
s2. s8 r4
\bar ""
  }
 >>
 }
 

Re: Separate a tuplet from the rest under a common beam

2022-12-14 Thread Archer Endrich

Hello,

I often have varied groupings under one beam and have used the solution 
given by Michael Werner.  However, I have also created the following to 
simplify entering the commands and the look of the score file:


bcLnone = \set stemLeftBeamCount = #0
bcRone = \set stemRightBeamCount = #1
bcLone = \set stemLeftBeamCount = #1
bcRtwo = \set stemRightBeamCount = #2
bcLtwo = \set stemLeftBeamCount = #2

Such as in:

\times 2/3 {f'16([ b, \bcRone f' ~} \bcLone f16 b,] ~ b16[ \bcRone f' ~ 
\bcLone f32-- b,16.] f'32[ b, ~ b8 f'16] ~ \times 4/6 {f16 b, \bcRone f' 
~ \bcLone f b, f'] ~} | \times 2/3 {f16[ b, \bcRone f' ~} \bcLone f32 b, 
f' b,] f'32[ b,32 ~ b8]) r16 fis'32([ b, ~ b8 fis'16] ~ \times 4/6 { 
fis16[ b, \bcRone fis' ~ \bcLone fis b, fis'])} |


beam count example
Archer


On 14/12/2022 16:24, Michael Werner wrote:

Resending to include the list ... oops.

Something like this, perhaps?

\version "2.23.82"

\relative  {
  \clef treble
  \key c \minor
  \time 2/4
  \tuplet 3/2 { g'16[( aes \set stemRightBeamCount = #1 g) } \set 
stemLeftBeamCount = #1 fis g] a8 b |

}


On Wed, Dec 14, 2022 at 10:42 AM Volodymyr Prokopyuk 
 wrote:


Hello,

*Problem*

How can I separate a \tuplet from two sixteenths using a common
eightingth beam?

*Example code*

\version "2.23.81"

\relative {
  \clef treble
  \key c \minor
  \time 2/4
  \tuplet 3/2 { g'='16[( aes g) } fis g] a8 b |
}

image.png


*Desired result*
image.png

I've tried to adjust the baseMoment, beatStructure, subdivideBeats
and strictBeatBeaming but without success.

Thank you very much,
Vlad
\version "2.22.1"
% beamcountexample.ly


%Shorthand for setting the beam count:
bcLnone = \set stemLeftBeamCount = #0
bcRone = \set stemRightBeamCount = #1
bcLone = \set stemLeftBeamCount = #1
bcRtwo = \set stemRightBeamCount = #2
bcLtwo = \set stemLeftBeamCount = #2

\score {

 \new Staff {
 \relative c {
 \clef "treble_8"
 \time 4/4
 \override TupletBracket.bracket-visibility = ##t

 \times 2/3 {f'16([ b, \bcRone f' ~} \bcLone f16 b,] ~ b16[ \bcRone f' ~ \bcLone f32-- b,16.] f'32[ b, ~ b8 f'16] ~ \times 4/6 {f16 b, \bcRone f' ~ \bcLone f b, f'] ~} | \times 2/3 {f16[ b, \bcRone f' ~} \bcLone f32 b, f' b,] f'32[ b,32 ~ b8]) r16 fis'32([ b, ~ b8 fis'16] ~ \times 4/6 { fis16[ b, \bcRone fis' ~ \bcLone fis b, fis'])} | 
 }
 }

}


Cues and Rest Collision Warning

2023-03-14 Thread Archer Endrich

Dear Lilypond User Group,

First of all, thanks for the great discussion about variables and 
Bookpart.  I had very recently come across that problem, though in 
simpler form:  just putting a variable definition directly into a file 
that used \book (for assembling several short scores). Placing the 
definition outside \book made it all work perfectly.


I have another problem with a very simple use of cues, using code as in 
the Notation Manual.  This is my example:


%CuesandRestCollisions.ly
\version "2.22.1"

\header {
  title = "Cues and Rest Collision Warning"
}

\markup \vspace  #1

\score {

  \new Staff {
    \time 4/4
    \clef treble

    g'1^\markup{Fl 1} |
  <<
  { c'1\rest }
    \new CueVoice {
    r4^"Oboe cue" \stemUp g'8->([ a'] ~ a'2) |
  }
  >>
    r2^\markup{Fl 1} bes'8->\sfz\>([ a'] ~ a'4\!\p\<) ~ |
  }

}

\layout { }

This compiles OK but gives the warning :  cannot resolve rest 
collision:  rest direction not set


The reason I used c'1\rest was so that the rest would be placed on the 
bottom line of the Staff.  I would really like a centered rest (R1) but 
this automatically places it on the 2nd line from the top, which does 
conflict with the music of the cue.


Why does it worry about a 'rest direction' (whatever that is), 
especially when it is a breve rest.  Is there a way to avoid the warning.


Cues are minimal in this piece, so I didn't want to use a separate staff.

Finally, is it common practice to include the rest (for the instrument 
playing that part) along with the cue, which is distinguished by its 
smaller notes?


Thank you,

Archer



%CuesandRestCollisions.ly
\version "2.22.1"

\header {
  title = "Cues and Rest Collision Warning"
}

\markup \vspace  #1

\score {

  \new Staff {
\time 4/4
\clef treble

g'1^\markup{Fl 1} |
  <<
  { c'1\rest }
\new CueVoice {
r4^"Oboe cue" \stemUp g'8->([ a'] ~ a'2) |
  }
  >>
r2^\markup{Fl 1} bes'8->\sfz\>([ a'] ~ a'4\!\p\<) ~ | 
  }

}

\layout { }


Re: Cues and Rest Collision Warning

2023-03-14 Thread Archer Endrich
Thank you Xavier and Jean.  The warnings have disappeared and the MMrest 
with #-6 is perfectly placed on the E line of the staff.


The revised version looks like this:

\score {

  \new Staff {
    \time 4/4
    \clef treble

    g'1^\markup{Fl 1} |
  <<
  { \voiceTwo
  \once \override MultiMeasureRest.staff-position = #-6
  R1 }
    \oneVoice \new CueVoice {
    r4^"Oboe cue" \stemUp g'8([ a'] ~ a'2) |
  }
  >>
    r2^\markup{Fl 1} bes'8->\sfz\>([ a'] ~ a'4\!\p) ~ |
  }

}

Thanks again,

Archer


On 14/03/2023 12:13, Xavier Scheuer wrote:

On Tue, 14 Mar 2023 at 12:55, Archer Endrich  wrote:
>
> The reason I used c'1\rest was so that the rest would be placed on the
> bottom line of the Staff.  I would really like a centered rest (R1) but
> this automatically places it on the 2nd line from the top, which does
> conflict with the music of the cue.

Hello,

Replace your c'1\rest with

  \voiceTwo
  R1
  \oneVoice

In case the positioning of the multi-measure rest is not satisfactory 
you can use

\once \override MultiMeasureRest.staff-position = #-6
as documented in NR 1.2.2 Writing rests > Full measure rests

Cheers,
Xavier

--
Xavier Scheuer 


Re: Cues and Rest Collision Warning

2023-03-14 Thread Archer Endrich
Thank you, Jean, for these very detailed explanations about how the 
voices are to be used -- and the alternate way to achieve the same 
result.  I hugely appreciate your input.


Archer

On 14/03/2023 19:09, Jean Abou Samra wrote:


Le mardi 14 mars 2023 à 14:36 +, Archer Endrich a écrit :

Thank you Xavier and Jean.  The warnings have disappeared and the 
MMrest with #-6 is perfectly placed on the E line of the staff.

The revised version looks like this:
\score {

|  \new Staff {     \time 4/4     \clef treble     g'1^\markup{Fl 1} 
|   <<   { \voiceTwo   \once \override 
MultiMeasureRest.staff-position = #-6   R1 }     
\oneVoice \new CueVoice {     r4^"Oboe cue" \stemUp g'8([ 
a'] ~ a'2) |   }   >>     r2^\markup{Fl 1} 
bes'8->\sfz\>([ a'] ~ a'4\!\p) ~ |   } } |


This isn't how |\voiceTwo| and |\oneVoice| are supposed to be placed. 
Your indentation with |\oneVoice| on the same line suggest you think 
|\oneVoice| is a function being applied to |\new CueVoice { ... }|, 
but it's not, it's a standalone element. You're putting |\oneVoice| in 
parallel with the |{ \voiceTwo ... }| and the |\new CueVoice { ... }|. 
It occurs at the same time as the |\voiceTwo| and in the same voice, 
effectively cancelling it.


Rather, you want to do

|\version "2.24.1" \score { \new Staff { \time 4/4 \clef treble 
g'1^\markup{Fl 1} | << { \voiceTwo % this passage is "voice two" R1 } 
\new CueVoice { \voiceOne % this new CueVoice is independent and has 
"voice one" settings r4^"Oboe cue" \stemUp g'8([ a'] ~ a'2) | } >> 
\oneVoice % this continues the passage with \voiceTwo, use \oneVoice 
to cancel it r2^\markup{Fl 1} bes'8->\sfz\>([ a'] ~ a'4\!\p) ~ | } } |


or use the shorter syntax with |\\| :

|\version "2.24.1" \score { \new Staff { \time 4/4 \clef treble 
g'1^\markup{Fl 1} | << \new CueVoice { r4^"Oboe cue" \stemUp g'8([ a'] 
~ a'2) | } \\ { R1 } >> r2^\markup{Fl 1} bes'8->\sfz\>([ a'] ~ 
a'4\!\p) ~ | } } |


As you can see, you don't need the |\override| anymore, |\voiceTwo| 
puts the multi-measure rest at the right position.


Re: String pressure notation

2024-04-16 Thread Archer Endrich

Hello Richard,

Your bow-pressure graphic looks great, and I hope your question about 
horizontal proportions can be answered soon.


Another feature of your illustration is relevant to my wish list:  the 
downward-pointing brackets with 9" in the middle.  I've been trying to 
find a way to do this for some time.  Could you forward the code for 
this feature?  Perhaps it is just something basic that I've missed.


Thanks,

Archer


On 15/04/2024 04:45, Richard Davis wrote:

Hello all,

I am new (as of today) to this mailing list, and new (as of a few months
ago) to this software, so please forgive me if I ask obvious or
poorly-worded questions.

I am looking for a way to achieve the standard graphic notation for bow
pressure on string instruments, as shown in the attached image. I asked
on reddit and was able to get a suggestion as follows:

\version "2.25.13"

#(define ((bow-pressure-stencil shape) grob)
   (let* ((lbi (ly:grob-property grob 'left-bound-info '()))
  (rbi (ly:grob-property grob 'right-bound-info '()))
  (lbx (ly:assoc-get 'X lbi 0))
  (rbx (ly:assoc-get 'X rbi 0))
  (ss (ly:staff-symbol-staff-space grob)))
 (set! shape (append '((1 . 0) (0 . 0)) shape))
 (set! shape
   (map
 (lambda (pt) (let ((x (car pt)) (y (cdr pt)))
   (cons (* x (- rbx lbx)) (* -2/3 ss y
 shape))
 (grob-interpret-markup grob
   #{ \markup \polygon #shape #})))

startBowSpan =
#(define-event-function (shape) (number-pair-list?) #{
   -\tweak stencil #(bow-pressure-stencil shape)
\startTextSpan #})
stopBowSpan = \stopTextSpan

{ b'4-\tweak to-barline ##t
   \startBowSpan #'((0 . 0.5) (0.25 . 1))
   4 2 <>\stopBowSpan \fine }

 From what I've been able to understand, this solution stretches the
shape specified by the call to \startBowSpan across the distance
specified by the ending position of \stopBowSpan. This is quite a useful
solution, but it has a few limitations, most glaringly that I have to
guess as to horizontal proportions and that those may not be the same in
parts as in the score.

Ideally I'd want to be able to anchor specific levels along this spanner
to rhythmic events, perhaps by specifying "levels" of pressure like so:

{
   c4\startBowSpan 0.0 c4\pressure 1.0 c4\pressure 0.5 c4\stopBowSpan 0.0
}

In my head, whatever implementation this requires would somehow
"collect" these levels and generate the final shape as
necessary. However, I don't know nearly enough scheme to even know where
to begin on this. The reddit contributor to the original did suggest
using DynamicLineSpanners may be more productive, but I also don't quite
understand how to go about that.

I apologize for the lengthy question; I hope it makes sense. Any help
would be greatly appreciated!

Sincerely,
Richard





Re: String pressure notation

2024-04-16 Thread Archer Endrich
Thank you, Aaron.  I'm absolutely delighted to know how to do this now 
as it occurs in several of my earlier scores that I'm re-engraving with 
Lilypond.


Archer


On 16/04/2024 12:03, Aaron Hill wrote:

On 2024-04-16 3:59 am, Aaron Hill wrote:
What you are looking for, however, can be done with 
horizontal/analysis brackets:



\version "2.25.13"

\new Voice
\with { \consists Horizontal_bracket_engraver }
{
  b'4
  -\tweak layer 0
  -\tweak direction #UP
  -\tweak bracket-flare #'(0 . 0)
  -\tweak HorizontalBracketText.Y-offset -0.5
  -\tweak HorizontalBracketText.text
    \markup \whiteout \pad-around #0.5 "9\""
  -\startGroup 4 2\stopGroup
}



Oh, and if you need the brackets to align to the measures and not 
notes, then the Measure_spanner_engraver is what you probably want.



-- Aaron Hill




Re: Feathered Beam Timing

2024-05-11 Thread Archer Endrich

Hello,

I have frequently encountered the situation where I want to have 
feathered durations within a specified duration -- e.g., a crotchet, or 
a minim, or a breve.  This is the code I've come up with:


\once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 6/8 {a'16^\markup{\small{( \note {2} #UP )}}\p\<[( g' a' b' 
c'' d'')]}

  \once \override Beam.grow-direction = #'()
  |

The use of the tuplet helps to indicate the number of notes in the 
figure.  In this case, 6 semiquaver notes are to be played with the time 
of 8 semiquavers (and feathered) to fill out a minim duration.  This 
minim is shown above the figure in parentheses using markup, to confirm 
to the player the duration to be filled.


Here is another example in which 8 notes are played in the time of 8 
semiquavers, but feathered.


 \once \override Beam.grow-direction = #RIGHT
    \featherDurations #(ly:make-moment 1/2)
    \tuplet 8/8 {a'16^\markup{\small{( \note {2} #UP )}}\p[( b' c'' b' 
c'' d'' c'' b')]}

  \once \override Beam.grow-direction = #'() |

And another, in which 8 notes are feathered within a breve (whole note) :

 \once \override Beam.grow-direction = #RIGHT
  \featherDurations #(ly:make-moment 1/2)
  \tuplet 8/16 {e''!16^\markup{\small{( \note {1} #UP )}}\p\<[( e'' 
e'' e''\!) e''\>( e'' e'' e''\!)]}

  \once \override Beam.grow-direction = #'()

The tuplet is 8/16 because it takes 16 normal semiquavers to fill four 
beats and there are only 8 notes.


This score was done with version 2.22.0 and compiles OK.  I hope this 
helps, but if anything is incorrect or could be improved, I trust the 
list to comment.


Archer


On 11/05/2024 15:06, N. Andrew Walsh wrote:

Hi Steph,

I'm not an expert with the \featherDurations interface, but this:

On Sat, May 11, 2024 at 3:53 PM Steph Phillips 
 wrote:



\once \override Beam.grow-direction = #LEFT
\featherDurations 6/4 { d16[-. d-. d-. d-. d-. d]-. } |

seems to disagree with how the tutorial describes it: 
https://lilypond.org/doc/v2.25/Documentation/notation/feathered-beams


There, that ratio (*unlike* with tuplets) describes the ratio in 
duration between the first and last value of the feathered 
group, *not* their relationship to unmodified durations. So if you 
wanted the first note to be a sixteenth and the last to be an eighth, 
you'd use "2/1". I don't know how you'd get six sixteenths to fit 
within the duration of a half note, though, as the feathered interface 
doesn't seem to account for tuplet-like durations. Or, at least, it 
doesn't seem to be documented. Maybe you'd have to nest one inside the 
other? Something like

--
\tuplet 6/8 {
\once \override Beam.grow-direction = #LEFT
\featherDurations 2/1 { d16[-. d-. d-. d-. d-. d]-. }
}
--
(the stickler in me would complain that tuplets should always indicate 
a shortening of length, and this is technically putting six sixteenths 
in the space of eight, but I guess the feathering overrules that)


Anyway, maybe that helps?

Cheers,

A




layout problem

2024-05-12 Thread Archer Endrich

Hello,

I've been given a short item to realise in Lilypond and it includes a 
layout problem that I haven't been able to solve.


Basically, it is a piano piece in which, after a bit, a part for chimes 
is added:  i.e., another staff above the piano's treble part a few bars 
in as in my MWE.  I have tried to do this as an ossia staff in 
testlayoutB.ly  but it produces the result testlayoutB.pdf which starts 
the chimes part at the beginning of the example, not where I want it to 
start.


Comments in my .ly refer to a semicolon being commented out and 
reinstated just above the piano Bass clef part.  This causes the chimes 
and piano treble second line line to begin where I want it to, but it is 
placed below the bass, with a spurious clef above the bass.


What I would really like to do is to use StaffGroup as in testlayoutA.ly 
but this fails with a fatal error: "\new StaffGroup  %Fatal error: 
'spurious expression in \score'", so Lilypond rejects this kind of 
construction.


I have a voice & piano piece of my own which changes the number of 
staves in the piano part, so I'm very keen to learn how to deal with 
changing numbers of staves in a score.


Thanks!

Archer

%testLayoutB.ly
\version  "2.24.3"

\header {
  title = "Test Layout" 
}

transparentrest = \once \override Rest.transparent = ##t
transparentMMrest = \once \override MultiMeasureRest.transparent = ##t

\score {

 \new PianoStaff 
 <<
  % TREBLE CLEF 1st system
  \new Staff  = "pluschimes" {
\time 4/4
\clef treble

\repeat unfold 2 {d'2 f'2 | g'2 bes'2 | }
\break

  % TREBLE CLEF 2nd system
R1 | \stopStaff s4 
\once \override TextScript.extra-offset = #'(0.5 . -5.0)
s2.^\markup { 
\override #'(line-width . 50 )
\wordwrap {\italic{\small{A lot more more text placed in here | s1| s1 | s1 |
\startStaff
\time 3/4 \tempo 4 = 60 r2. \bar "!" 
  } % If this } is commented out and put just above the Bass Clef (see 
%  %} there, a spurious staff and ossia staff above it appears 
%  BELOW the second system ...
   
  % OSSIA STAFF ABOVE PianoStaff FOR CHIMES (meant to start at 2nd system)
  \new Staff = "chimes"  \with {
  \remove "Time_Signature_Engraver" 
  alignAboveContext = "pluschimes"
  \context Staff
  \magnifyStaff #2/3   
  fontSize = #-2
 }
 
{ s4^\markup{\small {\column{\line{[Orchestral Chimes if} \line{ available (B\flat - C only)] \stopStaff s2. | \transparentMMrest R1 | \transparentMMrest R1 | \transparentMMrest R1 |
\once \override TextScript.extra-offset = #'(-1.0 . -7.0)
\transparentMMrest R1^\markup {
 \override #'(line-width . 20 )
 \wordwrap {\italic{\small{Some text here | 
\revert Score.TimeSignature.stencil
\startStaff \time 3/4 bes'2\mp bes'4 | 
   }
  %} % semicolon reinstated here
  
  % BASS CLEF 1st system
 \new Staff {
 \time 4/4
 \clef bass
 
 \repeat unfold 16 {g,8[ g,]} 
 \break

  % BASS CLEF 2nd system 
 \repeat unfold 16 {g,8[ g,]} 
  }
 >>
}%testLayoutA.ly
\version  "2.24.3"

\header {
  title = "Test Layout" 
}

transparentrest = \once \override Rest.transparent = ##t
transparentMMrest = \once \override MultiMeasureRest.transparent = ##t

\score {

 \new PianoStaff 
 <<
  % TREBLE CLEF
  \new Staff {
\time 4/4
\clef treble

\repeat unfold 2 {d'2 f'2 | g'2 bes'2 | }
\break
  }

  % BASS CLEF
  \new Staff {
\time 4/4
\clef bass
 
\repeat unfold 16 {g,8[ g,]} 
\break
  }
 >>
  
 \new StaffGroup  %Fatal Error:  'Spurious expression in \score'
   << 
 % EXTRA STAFF ABOVE PianoStaff FOR CHIMES
   \new Staff = "chimes"  \with {
   \magnifyStaff #2/3
   \remove "Time_Signature_Engraver" 
   fontSize = #-2
 }
   
 { s4^\markup{\small {\column{\line{[Orchestral Chimes if} \line{ available (B\flat - C only)] \stopStaff s2. | \transparentMMrest R1 | \transparentMMrest R1 | \transparentMMrest R1 |
 \once \override TextScript.extra-offset = #'(-1.0 . -7.0)
 \transparentMMrest R1^\markup {
   \override #'(line-width . 20 )
   \wordwrap {\italic{\small{Some text here | 
 \revert Score.TimeSignature.stencil
 \startStaff \time 3/4 bes'2\mp bes'4 | 
   }

  \new PianoStaff
  <<
   \new Staff {
\time 4/4
\clef treble

% TREBLE CLEF
 R1 | \stopStaff s4 
 \once \override TextScript.extra-offset = #'(0.5 . -5.0)
 s2.^\markup { 
 \override #'(line-width . 50 )
 \wordwrap {\italic{\small{A lot more more text placed in here | s1 | s1 | s1 |

 \startStaff
 \time 3/4 \tempo 4 = 60 r2. \bar "!" 
 }

 % BASS CLEF
\new Staff {
 \time 4/4
 \clef bass
 
 \repeat unfold 16 {g,8[ g,]} 
}
   >>
  >>
 }

testLayoutB.pdf
Description: Adobe PDF document


Re: layout problem

2024-05-12 Thread Archer Endrich
Thank you, Timothy, for responding so quickly and explaining the 
solution in such a clear manner.  Although I've used labelling in other 
situations before, I still hadn't understood how to apply it here --- 
and now I do.  Thanks again.


Archer


On 12/05/2024 16:37, Timothy Lanfear wrote:

On 12/05/2024 12:41, Archer Endrich wrote:

Hello,

I've been given a short item to realise in Lilypond and it includes a 
layout problem that I haven't been able to solve.


Basically, it is a piano piece in which, after a bit, a part for 
chimes is added:  i.e., another staff above the piano's treble part a 
few bars in as in my MWE.  I have tried to do this as an ossia staff 
in testlayoutB.ly  but it produces the result testlayoutB.pdf which 
starts the chimes part at the beginning of the example, not where I 
want it to start.


Label your staves and use alignAboveContext (or alignBelowContext) to 
position the new staff relative to an existing staff.


\version  "2.24.0"

\header {
  title = "Test Layout"
}

chimes = {
  \once \omit Staff.TimeSignature
  \once \omit Staff.Clef
  \stopStaff
  s1^\markup \italic "Some text here"
  \startStaff
  \clef "treble" \time 3/4 bes'2\mp 4
}

\new PianoStaff
<<
  \new Staff="RH" {
    \time 4/4
    \clef "treble"
    \repeat unfold 2 {d'2 f'2 | g'2 bes'2 | }
    <<
  { R1 \stopStaff s2.^\markup \wordwrap { \italic \small "A lot 
more more text placed in here" } }

  \new Staff \with { alignAboveContext="RH" } { \chimes }
    >>
  }

  \new Staff="LH" {
    \time 4/4
    \clef "bass"
    \repeat unfold 20 {g,8[ g,]}
    \time 3/4
    \repeat unfold 12 {g,8[ g,]}
  }
>>

--
Timothy Lanfear, Bristol, UK.




Re: layout problem - new issue

2024-05-14 Thread Archer Endrich
Thank you, Jean.  Of course!  The broader issue for me is that I hadn't 
grasped that it was actually a << {...} \\ {...} >> construction in the 
newer, simpler format.


I'm so grateful for your help.  I was going around in circles, knowing 
that the solution had to be something straightforward.


Thanks again,
Archer

On 14/05/2024 16:44, Jean Abou Samra wrote:

I've tried placing the new bar in 3 different places on the treble
staff.  In the current pdf, the first 2 are commented out and the third
-- which I expected to work -- is active: placement after the >>.
Somehow a spurious bar is inserted, but I don't know where it's coming from.

You have

 <<
   { R1 | [...] \bar "!" }
 
   \new Staff \with { alignAboveContext="RH" } { \chimes }
 
 >>

 es'4\mp es'4. es'8

but the \chimes takes one measure more than the { R1 | [...] \bar "!" }.
The duration of the << >> expression is the max of the two. Basically,
<< >> waits before *all* subexpressions are exhausted before yielding
back control.

You should simply move the line es'4\mp es'4. es'8 into the { R1 ... }.

Best,
Jean