Re: alternate fretboard table

2021-09-28 Thread David Kastrup
Gary Brookman  writes:

> Thank you Carl.
>
> You made it plenty clear, but I still ignored it. 

A much sought after skill for modern political debates.  I am glad that
the discussions here lean a bit more towards the old-fashioned.

-- 
David Kastrup



Re: alternate fretboard table

2021-09-28 Thread Gary Brookman
Thank you Carl.

You made it plenty clear, but I still ignored it. 

Maybe I'm on the path now.


From: Carl Sorensen 
Sent: Tuesday, September 28, 2021 3:47 PM
To: Gary Brookman ; lilypond-user@gnu.org 

Subject: Re: alternate fretboard table


Gary,



You need to uncomment one of the commented lines:


  \context FretBoards % you can use the \with syntax by uncommenting the next 
line

 % \with {predefinedDiagramTable = \swing-fretboard-table}



Or



   % or you can use the \set format by uncommenting the next line

   %\set predefinedDiagramTable = #swing-fretboard-table



I’m sorry I didn’t make that clearer.



The problem was that you never set your FretBoards context to use the new 
fretboard table you defined.







Carl




Re: alternate fretboard table

2021-09-28 Thread Carl Sorensen
Gary,

You need to uncomment one of the commented lines:

  \context FretBoards % you can use the \with syntax by uncommenting the next 
line
 % \with {predefinedDiagramTable = \swing-fretboard-table}

Or

   % or you can use the \set format by uncommenting the next line
   %\set predefinedDiagramTable = #swing-fretboard-table

I’m sorry I didn’t make that clearer.

The problem was that you never set your FretBoards context to use the new 
fretboard table you defined.






Carl




Re: alternate fretboard table

2021-09-28 Thread Gary Brookman

Thank you for the quick response.

Regarding the learning part. I'm impressed by the depth of the documentation 
and especially all the snippets/sample code. What I know about me is that 
reading an entire manual without playing with the code at each step doesn't 
work. And hopping from link to link leaves me lost.  If I ever fully grok 
Lilypond maybe I'll write a quick start guide that would work for ADD types 
like me.

With your sample code I'm seeing the same output as from mine. I typed the 
definition incorrectly, it should be:
\addChordShape #'sixthstring #guitar-tuning #"8-2;x;7-1;9-3;x;x;"
For the C chord I want to see the dots on:
string 6, fret 8,
string 4, fret 7
string 3, fret 9

but I'm seeing
string 3, fret 5
string 2, fret 5
string 1, fret 3

in fact, changing to
\addChordShape #'sixthstring #guitar-tuning #"1;2;3;4;5;6;"
or
\addChordShape #'sixthstring #guitar-tuning #"x;x;x;x;x;x;"
gives the same results.

Also, the fingerings aren't shown.

The displayed chord isn't in the fretboard table so I'm guessing this comes 
into play.
"If no predefined diagram is available for the entered notes in the active 
stringTunings, this context calculates strings and frets that can be used to 
play the notes. "

That voicing is actually a C6, so thinking that maybe notes are being validated 
I changed to
\chordmode { c:6 }
but that didn't help either.

This is what I'm running with now:
% ==
% Make a blank new fretboard table
#(define swing-fretboard-table (make-fretboard-table))

% Add a new chord shape
\addChordShape #'sixthstring #guitar-tuning #"8-2;x;7-1;9-3;x;x;"

% add a three note C6 with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
\chordmode { c:6 }
#guitar-tuning
#(chord-shape 'sixthstring guitar-tuning)

% add a three-note d with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
\chordmode { d:6 }
#guitar-tuning
#(offset-fret 2
   (chord-shape 'sixthstring guitar-tuning))

% add a three-note b with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
\chordmode { b:6 }
#guitar-tuning
#(offset-fret -2
   (chord-shape 'sixthstring guitar-tuning))

mychords = \chordmode
{
  c:6 c':6 c'':6 d:6 b:6
}
<<
  \context ChordNames
  {
\mychords
  }

  \context FretBoards % you can use the \with syntax by uncommenting the next 
line
 % \with {predefinedDiagramTable = \swing-fretboard-table}

  {
   % Set the new fretboard table to be the default table
   % or you can use the \set format by uncommenting the next line
   %\set predefinedDiagramTable = #swing-fretboard-table
\mychords
  }
>>


From: Carl Sorensen 
Sent: Tuesday, September 28, 2021 12:47 PM
To: Gary Brookman ; lilypond-user@gnu.org 

Subject: Re: alternate fretboard table






From: lilypond-user  
on behalf of Gary Brookman 
Date: Tuesday, September 28, 2021 at 8:40 AM
To: "lilypond-user@gnu.org" 
Subject: alternate fretboard table



I'm a complete Lilypond neophyte, so please excuse me if I'm missing the basics.



Welcome!  We love to have new people getting into LilyPond!  And as one who was 
responsible for much of the fretboard architecture and implementation, I’m 
always happy to see others using this work.





I am learning to play rhythm to jazz standards. A friend is an expert on 
voicings used in big band and swing settings, and none of these are in the 
predefined fretboard table. After some reading, what makes sense to me is to 
create an alternative fretboard table with just the voicings I want. To that 
end I tried:

% Make a blank new fretboard table

#(define swing-fretboard-table (make-fretboard-table))



% Add a new chord shape

\addChordShape #'sixthstring #guitar-tuning #"8-2;7-1;9-3;x;x;x;"





% add a three note c with root on the sixth string

\storePredefinedDiagram #swing-fretboard-table

\chordmode { c }

#guitar-tuning

#(chord-shape 'sixthstring guitar-tuning)



mychords = \chordmode

{

  c c' c''

}



<<

  \context ChordNames

  {

\mychords

  }

  \context FretBoards

  {

\mychords

  }

>>



Not successful.

1.  is this a good approach to the problem?

This is a good general approach, but the specifics aren’t right.

2.  Even if not, why doesn't this approach work for this one chord?

3.  What's the best way to get up to speed on LilyPond?

The best way to get up to speed, in my opinion, is to do the following:

  1.  READ the Learning Manual.  The Learning Manual introduces the basics in a 
way that will help you to learn them.  They build on one 

Re: Removing Unwanted Span Bar

2021-09-28 Thread Ernie Braganza
Thanks! That worked. I removed it in the RhythmicStaff context.

On Tue, Sep 28, 2021 at 2:03 PM Jean Abou Samra  wrote:

> Le 28/09/2021 à 19:38, Ernie Braganza a écrit :
> > I want to have a RhythmicStaff and I see an unwanted span bar. Here's
> > the smallest code sample I could think of as an example. I tried
> > \remove "Span_bar_engraver" but that didn't work. I've also attached a
> > screenshot.
> >
> > I am running Lilypond 2.22.1 on Debian Linux.
> >
> > Thanks for your help!
> >
> > […]
> >
> > \override StaffSymbol.line-count = #0
>
> This overrides makes the StaffSymbol invisible, but
> does not remove it. As a consequence, LilyPond groups
> the staves with a system start delimiter. Try replacing
> it with
>
>\remove Staff_symbol_engraver
>
> Best,
> Jean
>
>
>


Re: More complex preprocessing with scheme

2021-09-28 Thread Jean Abou Samra

Le 27/09/2021 à 17:05, Andrew Zah a écrit :

Hi all,

Is it possible to do something like have lilypond evaluate a Scheme 
file in order to do more complicated preprocessing of song files?


Ultimately I'd like to have a template and then include files like so, 
based on some logic:


% ...
\bookpart {
 \tocItem \markup "$SONG"
 \include "$FILE"
 % etc.
}
% ...

I know it's possible to achieve this with external tools, but I'd like 
to be able to simply run `lilypond` with some flags to change the output.


Thanks,
Andrew



Hi Andrew,

What you expect is not 100% clear to me.
This file structure can be achieved with
just variables, for example included1.ly
defining

  song = "LilyPond song"

and main.ly having

  \tocItem \markup \song

or any kind of Scheme code:

  \tocItem \markup #(string-upcase song)

To include a file of which the name is in
a variable, use

file = "/path/to/file.ly"

#(ly:parser-include-string
   (string-append "\\include \"" file "\""))

To read environement variables, use Guile's
getenv function.

https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/Runtime-Environment.html#Runtime-Environment

In general, you can read parameters set from the
command line with the -e option. See

https://lilypond.org/doc/v2.22/Documentation/usage/command_002dline-usage#basic-command-line-options-for-lilypond

The typical way to construct or preprocess input would
be to define a syntax function as described at

https://lilypond.org/doc/v2.22/Documentation/extending/scheme-functions

With this approach, you're not compiling a central
.ly file anymore. You define the function in
included.ly as

  myFunc =
  #(define-scheme-function (...) (...)
 ...)

and you call it in an file you want:

  \include "included.ly"
  \myFunc ...

Best,
Jean



Re: Removing Unwanted Span Bar

2021-09-28 Thread Jean Abou Samra

Le 28/09/2021 à 19:38, Ernie Braganza a écrit :
I want to have a RhythmicStaff and I see an unwanted span bar. Here's 
the smallest code sample I could think of as an example. I tried  
\remove "Span_bar_engraver" but that didn't work. I've also attached a 
screenshot.


I am running Lilypond 2.22.1 on Debian Linux.

Thanks for your help!

[…]

        \override StaffSymbol.line-count = #0


This overrides makes the StaffSymbol invisible, but
does not remove it. As a consequence, LilyPond groups
the staves with a system start delimiter. Try replacing
it with

  \remove Staff_symbol_engraver

Best,
Jean





Re: Removing Unwanted Span Bar

2021-09-28 Thread Ernie Braganza
Missing attachment for SpanBar iasasue

On Tue, Sep 28, 2021 at 1:38 PM Ernie Braganza 
wrote:

> I want to have a RhythmicStaff and I see an unwanted span bar. Here's
> the smallest code sample I could think of as an example. I tried  \remove
> "Span_bar_engraver" but that didn't work. I've also attached a screenshot.
>
> I am running Lilypond 2.22.1 on Debian Linux.
>
> Thanks for your help!
>
> \version "2.22.1"
> strum =  {
>   c4 c4 c4 c4  |
> }
> chord = \chordmode {
>   c1
> }
> melody = {
>   \time 4/4
> R1|
> }
>   \score {
> <<
>   \new RhythmicStaff {
> \override NoteHead.style = #'slash
> \override NoteHead.font-size = #-4 \strum
>   }
>   \new ChordNames \chord
>   \new Staff \melody
> >>
> \layout{
>   \context {
> \StaffGroup
> \remove "Span_bar_engraver"  %I thought this would work
>   }
>   \context {
> \RhythmicStaff
> \remove "Time_signature_engraver"
> \remove "Clef_engraver"
> \override BarLine.transparent = ##t
> \override StaffSymbol.line-count = #0
>   }
> }
>   }
>


Removing Unwanted Span Bar

2021-09-28 Thread Ernie Braganza
I want to have a RhythmicStaff and I see an unwanted span bar. Here's
the smallest code sample I could think of as an example. I tried  \remove
"Span_bar_engraver" but that didn't work. I've also attached a screenshot.

I am running Lilypond 2.22.1 on Debian Linux.

Thanks for your help!

\version "2.22.1"
strum =  {
  c4 c4 c4 c4  |
}
chord = \chordmode {
  c1
}
melody = {
  \time 4/4
R1|
}
  \score {
<<
  \new RhythmicStaff {
\override NoteHead.style = #'slash
\override NoteHead.font-size = #-4 \strum
  }
  \new ChordNames \chord
  \new Staff \melody
>>
\layout{
  \context {
\StaffGroup
\remove "Span_bar_engraver"  %I thought this would work
  }
  \context {
\RhythmicStaff
\remove "Time_signature_engraver"
\remove "Clef_engraver"
\override BarLine.transparent = ##t
\override StaffSymbol.line-count = #0
  }
}
  }


Re: alternate fretboard table

2021-09-28 Thread Carl Sorensen


From: lilypond-user  
on behalf of Gary Brookman 
Date: Tuesday, September 28, 2021 at 8:40 AM
To: "lilypond-user@gnu.org" 
Subject: alternate fretboard table

I'm a complete Lilypond neophyte, so please excuse me if I'm missing the basics.

Welcome!  We love to have new people getting into LilyPond!  And as one who was 
responsible for much of the fretboard architecture and implementation, I’m 
always happy to see others using this work.


I am learning to play rhythm to jazz standards. A friend is an expert on 
voicings used in big band and swing settings, and none of these are in the 
predefined fretboard table. After some reading, what makes sense to me is to 
create an alternative fretboard table with just the voicings I want. To that 
end I tried:
% Make a blank new fretboard table
#(define swing-fretboard-table (make-fretboard-table))

% Add a new chord shape
\addChordShape #'sixthstring #guitar-tuning #"8-2;7-1;9-3;x;x;x;"


% add a three note c with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
\chordmode { c }
#guitar-tuning
#(chord-shape 'sixthstring guitar-tuning)

mychords = \chordmode
{
  c c' c''
}

<<
  \context ChordNames
  {
\mychords
  }
  \context FretBoards
  {
\mychords
  }
>>

Not successful.
1.  is this a good approach to the problem?
This is a good general approach, but the specifics aren’t right.
2.  Even if not, why doesn't this approach work for this one chord?
3.  What's the best way to get up to speed on LilyPond?
The best way to get up to speed, in my opinion, is to do the following:

  1.  READ the Learning Manual.  The Learning Manual introduces the basics in a 
way that will help you to learn them.  They build on one another.  If you don’t 
understand the basics, you won’t be able to use the rest of the materials.  
It’s annoying to have to read a whole book, rather than just grab some 
snippets.  But it’s really important.
  2.  Use the Notation Reference.  Pay attention to the SeeAlso parts of the 
Notation Reference.  Use the Snippets that are linked from the Notation 
Reference.
In this particular case, going to the Notation Reference fretted strings 
section, and following the links from the See Also got me to this snippet:
https://lilypond.org/doc/v2.22/Documentation/snippets/fretted-strings#fretted-strings-fretboards-alternate-tables
This shows how to add a new fretboard table and use it.
\include "predefined-guitar-fretboards.ly"

% Make a blank new fretboard table
#(define custom-fretboard-table-one
   (make-fretboard-table))

% Make a new fretboard table as a copy of default-fret-table
#(define custom-fretboard-table-two
   (make-fretboard-table default-fret-table))

% Add a chord to custom-fretboard-table-one
\storePredefinedDiagram #custom-fretboard-table-one
\chordmode {c}
#guitar-tuning
"3-(;3;5;5;5;3-);"

% Add a chord to custom-fretboard-table-two
\storePredefinedDiagram #custom-fretboard-table-two
\chordmode {c}
#guitar-tuning
"x;3;5;5;5;o;"

<<
  \chords {
c1 | d1 |
c1 | d1 |
c1 | d1 |
  }
  \new FretBoards {
\chordmode {
  \set predefinedDiagramTable = #default-fret-table
  c1 | d1 |
  \set predefinedDiagramTable = #custom-fretboard-table-one
  c1 | d1 |
  \set predefinedDiagramTable = #custom-fretboard-table-two
  c1 | d1 |
}
  }
  \new Staff {
\clef "treble_8"
<<
  \chordmode {
c1 | d1 |
c1 | d1 |
c1 | d1 |
  }
  {
s1_\markup "Default table" | s1 |
s1_\markup \column {"New table" "from empty"} | s1 |
s1_\markup \column {"New table" "from default"} | s1 |
  }
>>
  }
>>
I know #3 isn't necessarily straight forward, but this is what I've experienced 
so far. There is a wealth of information available, but not in a form I'm used 
to digesting. I'm a retired programmer and late in my career I picked up 
python. I could search for any aspect of the language and find all sorts of 
help. I'm not finding that with Lilypond. For instance, the learning manual and 
Youtube videos show the syntax for only the most basic of use cases. But when I 
see I need addChordShape and search for it I find the definition:
\addChordShape [void] - key-symbol (symbol) tuning (pair) shape-definition 
(string or pair)
and a use case:
\addChordShape #'powerf #guitar-tuning "1-1;3-3;3-4;x;x;x;"
But what does symbol refer to? what's the # and ' for?
Symbol is a Scheme variable.  The # puts you from lilypond mode into Scheme 
mode.  The ' is how you get the name of the symbol, rather than evaluating the 
symbol, in Scheme.  These are discussed in the Learning Manual.  (# is 
discussed at 
http://lilypond.org/doc/v2.22/Documentation/learning/tweaking-methods#the-override-command
 ; ' is discussed at 

alternate fretboard table

2021-09-28 Thread Gary Brookman
I'm a complete Lilypond neophyte, so please excuse me if I'm missing the basics.

I am learning to play rhythm to jazz standards. A friend is an expert on 
voicings used in big band and swing settings, and none of these are in the 
predefined fretboard table. After some reading, what makes sense to me is to 
create an alternative fretboard table with just the voicings I want. To that 
end I tried:
% Make a blank new fretboard table
#(define swing-fretboard-table (make-fretboard-table))

% Add a new chord shape
\addChordShape #'sixthstring #guitar-tuning #"8-2;7-1;9-3;x;x;x;"

% add a three note c with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
\chordmode { c }
#guitar-tuning
#(chord-shape 'sixthstring guitar-tuning)

mychords = \chordmode
{
  c c' c''
}

<<
  \context ChordNames
  {
\mychords
  }
  \context FretBoards
  {
\mychords
  }
>>

Not successful.

  1.  is this a good approach to the problem?
  2.  Even if not, why doesn't this approach work for this one chord?
  3.  What's the best way to get up to speed on LilyPond?

I know #3 isn't necessarily straight forward, but this is what I've experienced 
so far. There is a wealth of information available, but not in a form I'm used 
to digesting. I'm a retired programmer and late in my career I picked up 
python. I could search for any aspect of the language and find all sorts of 
help. I'm not finding that with Lilypond. For instance, the learning manual and 
Youtube videos show the syntax for only the most basic of use cases. But when I 
see I need addChordShape and search for it I find the definition:
\addChordShape [void] - key-symbol (symbol) tuning (pair) shape-definition 
(string or pair)
and a use case:
\addChordShape #'powerf #guitar-tuning "1-1;3-3;3-4;x;x;x;"
But what does symbol refer to? what's the # and ' for?

I think I know now, but that's from tons of searching and reading. I would 
expect that to be an introduction article. I'm sure it's out there and I just 
missed it. Is there a tutorial or article that provides the glue that ties 
together all the components that comprise this environment and how they 
interface?

Thanks.



Re: Moving tuplet brackets

2021-09-28 Thread Paul Hodges
On 28/09/2021 10:18:30, "Lukas-Fabian Moser"  wrote:

>Please try and give an example of your LilyPond code, if possible. This 
>enables people to help with your concrete situation.
I understand that; but I wanted to see clean-page suggestions, as I felt 
the code I already had was way over the top - which your response and 
Leo's have confirmed.

For your interest, this is where I found the (way too complex for my 
case!) code I was using for horizontal tuplet brackets:
https://lilypond-user.gnu.narkive.com/pekwMXTV/angle-of-a-tuplet-bracket
The complexity was because it's the answer to a different problem 
(setting an angle for the bracket) adapted to set an angle of zero.

Thanks,
Paul



Re: Single incipit bar for a staff group of two instruments

2021-09-28 Thread Marcin Damianiak
Hi,

Thank you so much, it works superb! And also thanks a million for your
adjustments of my code - it looks just terrific.

Best,
Marcin

wt., 28 wrz 2021 o 00:10 Thomas Morley 
napisał(a):

> Am Sa., 25. Sept. 2021 um 17:39 Uhr schrieb Marcin Damianiak
> :
> >
> > Dear All,
> >
> > I'd like to ask for a little bit of help with the following matter:
> >
> > What I'm trying to achieve is to make single centered incipit bar for
> the staff group of two instruments. As for now, my code produces three
> incipits; I tried omitting particular Staff.InstrumentName but it also
> removes the shortInstrumentName, which is unwanted.
> >
> > Here's my code:
> >
> > \version "2.22.1"
> >
> > incipit =
> > #(define-music-function (parser location incipit-music) (ly:music?)
> >   #{
> > \once \override Staff.InstrumentName.self-alignment-X = #RIGHT
> > \once \override Staff.InstrumentName.self-alignment-Y = ##f
> > \once \override Staff.InstrumentName.padding = #1
> > \once \override Staff.InstrumentName.stencil =
> >   #(lambda (grob)
> > (let* ((instrument-name (ly:grob-property grob 'long-text)))
> >   (set! (ly:grob-property grob 'long-text)
> > #{ \markup
> >  \score
> > {
> >   { \context Staff \with {
> > } $incipit-music
> >   }
> >   \layout { $(ly:grob-layout grob)
> > line-width = \indent
> > indent =
> > #(primitive-eval
> >'(or (false-if-exception (-
> indent incipit-width))
> >(* 0.5 indent)))
> > ragged-right = ##f
> > ragged-last = ##f
> > system-count = #1
> >   }
> > }
> >  #})
> >(system-start-text::print grob)))
> >   #})
> >
> > IandII.Incipit = <<
> >   \new Voice = "IandII.Incipit" <<
> > {
> >   \set Staff.instrumentName = #"I and II"
> >   \clef G
> >   \time 4/4
> >   1 \bar ""
> > }
> >   >>
> > >>
> >
> > scoreI = \relative c'' {
> >   c1 \break c
> > }
> >
> > scoreII = \relative c'' {
> >   g1 \break g
> >
> > }
> >
> > scoreIPart = \new Staff \with {
> >   %\omit Staff.InstrumentName
> >   shortInstrumentName = "I"
> > } \scoreI
> >
> > scoreIIPart = \new Staff \with {
> >   %\omit Staff.InstrumentName
> >   shortInstrumentName = "II"
> > } \scoreII
> >
> > \score {
> > \new StaffGroup \with {
> > instrumentName = ""
> > \incipit \IandII.Incipit
> > }
> > { <<
> > \scoreIPart
> > \scoreIIPart
> >   >> }
> >
> >   \layout {
> >   indent = 6\cm
> >   incipit-width = 3\cm
> >   }
> > }
> >
> > Could you give me a hint how to get it right? Any help would be greatly
> appreciated!
> >
> > Best,
> > Marcin
>
> The override for InstrumentName.stencil applied at StaffGroup-level
> will work on all child-Staffs as well.
>
> Iiuc, you don't want InstrumentName.long-text for those children, as a
> workaround you could simply omit the stencil of the first grob of the
> broken InstrumentName.
> How about below (with several other adjustments of your code-example)?
>
>
> \version "2.22.1"
>
> %% from property-init.ly,
> %% slightly modified (making the printed context-type optional)
> incipit =
> #(define-music-function (context-type incipit-music)
>   ((string? "MensuralStaff") ly:music?)
>   (_i "Output @var{incipit-music} before the main staff as an indication of
> its appearance in the original music.  Optional @var{context-type}
> determines
> the type of it, defaulting to MensuralStaff.")
>   #{
> \once \override Staff.InstrumentName.stencil =
>   #(lambda (grob)
> (let* ((instrument-name (ly:grob-property grob 'long-text))
>(align-x (ly:grob-property grob 'self-alignment-X 0))
>(align-y (ly:grob-property grob 'self-alignment-Y 0)))
> (set! (ly:grob-property grob 'long-text)
>   #{ \markup {
> \score
> {
>   \new $context-type \with {
> \override InstrumentName.self-alignment-X = #align-x
> \override InstrumentName.self-alignment-Y = #align-y
> instrumentName = #instrument-name
>   }
>   {
> $incipit-music
>   }
>   \layout {
> $(ly:grob-layout grob)
> indent-incipit-default = 15\mm
> line-width = #(primitive-eval
>   '(or (false-if-exception indent)
> indent-incipit-default))
> indent = #(primitive-eval
>'(or (false-if-exception
> (- line-width incipit-width))
> (* 0.5 line-width)))
> ragged-right = ##f
> ragged-last = ##f
> system-count = 1
> \context {
>   \Score
>   \remove "Default_bar_line_engraver"
> }
> 

Re: Moving tuplet brackets

2021-09-28 Thread Lukas-Fabian Moser





In this case, I'm not sure what Harm did to ensure horizontal position 
of tuplet brackets. In the following solution, I'm doing a bit of a 
hack: I ask LilyPond to place the tuplet bracket outside everything 
else (that's the value of outside-staff-priority), and then I force 
them to be horizontal by letting LilyPond calculate the "usual" slope 
and afterwards forcing left and right y-position to the average value:


Oh, I'm sorry, I didn't realise that the outside-staff-priority 
overrides the manual setting of positions. Then of course it's much easier:


\version "2.22"

\relative {
  \tupletUp
  \override TupletBracket.bracket-visibility = ##t
  \override TupletBracket.outside-staff-priority = 2000
  \override TupletBracket.positions = #'(0 . 0)

  \tuplet 3/2 4 { b''8[(-> c) r] g[(-> fis) r] }
}

Lukas




Re: CHanging the = sign in a metronome mark

2021-09-28 Thread Peter Toye
Paul,


Thanks - I hadn't realised this. Now I see it's in NR.

Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Tuesday, September 28, 2021, 10:18:20 AM, Paul Hodges wrote:

> On 28/09/2021 10:02:24, "Peter Toye"  wrote:

>> I want to change the "=" to "~" or "ca." in a metronome mark but I can't see 
>> how to do it. There's a 'stencil' property but I assume that refers to the 
>> entire MM and not the equals sign. Can someone please help?

> You can use arbitrary markup in a \tempo directive.  For instance, in my 
> current work I have this (because I wanted no brackets and a smaller note 
> symbol):

>   \tempo \markup {\bold "Leggero "
>                   \teeny \general-align #Y #DOWN \note {4.} #1
>                   \medium "= 126"}

> Change the literal = to ~ and you're there.

> Paul

Re: CHanging the = sign in a metronome mark

2021-09-28 Thread Paul Hodges


On 28/09/2021 10:02:24, "Peter Toye"  wrote:

>I want to change the "=" to "~" or "ca." in a metronome mark but I 
>can't see how to do it. There's a 'stencil' property but I assume that 
>refers to the entire MM and not the equals sign. Can someone please 
>help?
You can use arbitrary markup in a \tempo directive.  For instance, in my 
current work I have this (because I wanted no brackets and a smaller 
note symbol):

   \tempo \markup {\bold "Leggero "
   \teeny \general-align #Y #DOWN \note {4.} #1
   \medium "= 126"}

Change the literal = to ~ and you're there.

Paul

Re: Moving tuplet brackets

2021-09-28 Thread Leo Correia de Verdier
I can’t tell for sure without seeing the code, but I think you may not need 
very advanced code to force the brackets horizontal in your case, and that 
something like this is what you’re after:


\version "2.22.1"
\fixed c'' {
  \override TupletBracket.direction = #UP
  \override TupletBracket.bracket-visibility = ##t
  \override TupletBracket.avoid-scripts = ##t
  \override TupletBracket.positions = #'( 0 . 0 )
  \override TupletBracket.outside-staff-priority = #750
  \override TupletBracket.avoid-slur = #'outside
  
  \tuplet 3/2 { c'8( r c, } 
  \tuplet 3/2 {\stemUp g a b^>)}
  \tuplet 3/2 { \stemDown \slurUp d,( c^_ e } 
  \tuplet 3/2 {\stemNeutral f--\upbow g--\downbow a-_)}
}



Some of the values might need to be adjusted to suit your needs.

HTH
/Leo


> 28 sep. 2021 kl. 10:46 skrev Paul Hodges :
> 
> I am at present being asked to put a lot of tuplet brackets on the same 
> side of the staff (above) as slurs, and this is leading to a lot of 
> collisions.  I could deal with them individually (a lot of work), but is 
> there something I can do to to force tuplet brackets away from slurs 
> (outside them) globally?  I've not been able to find anything that suits 
> yet.
> 
> This is probably complicated by the fact that I am already using code to 
> force the brackets horizontal (code by Harm I think, from a mail about 
> ten years ago).
> 
> Here is a sample of what I currently have:
> and here is a sample of another piece as the publisher wants it:
> 
> Thanks,
> Paul



Re: Moving tuplet brackets

2021-09-28 Thread Lukas-Fabian Moser

Hi Paul,

Am 28.09.21 um 10:46 schrieb Paul Hodges:

I am at present being asked to put a lot of tuplet brackets on the same
side of the staff (above) as slurs, and this is leading to a lot of
collisions.  I could deal with them individually (a lot of work), but is
there something I can do to to force tuplet brackets away from slurs
(outside them) globally?  I've not been able to find anything that suits
yet.

This is probably complicated by the fact that I am already using code to
force the brackets horizontal (code by Harm I think, from a mail about
ten years ago).

Here is a sample of what I currently have:
and here is a sample of another piece as the publisher wants it:


Please try and give an example of your LilyPond code, if possible. This 
enables people to help with your concrete situation.


In this case, I'm not sure what Harm did to ensure horizontal position 
of tuplet brackets. In the following solution, I'm doing a bit of a 
hack: I ask LilyPond to place the tuplet bracket outside everything else 
(that's the value of outside-staff-priority), and then I force them to 
be horizontal by letting LilyPond calculate the "usual" slope and 
afterwards forcing left and right y-position to the average value:


\version "2.22"

\relative {
  \tupletUp
  \override TupletBracket.bracket-visibility = ##t
  \override TupletBracket.outside-staff-priority = 2000
  \override TupletBracket.positions =
  #(grob-transformer
    'positions (lambda (grob default)
 (let ((middle-y (average (car default) (cdr default
   (cons middle-y middle-y

  \tuplet 3/2 4 { b''8[(-> c) r] g[(-> fis) r] }
}

I expect this will often look good and fail horribly in some special 
situations where LilyPond normally would create a tuplet bracket with a 
large slope.


Lukas




Re: Beams over rests

2021-09-28 Thread N. Andrew Walsh
Hi Paul,

I'm sure you know of the override pair:

\override Stem.stemlet-length = #0.5
\override Stem.details.beamed-lengths = #'(4.75)
( music with beamed rests here )
\revert Stem.stemlet-length
\revert Stem.details.beamed-lengths

I'm not aware of any way to set this globally. Well, the first one can be
set once. You'll still have to use "[" and "]" to force beaming, and you
should, for the sake of Best Practices™, set the stemlet length manually
for each one.

But this is the way I've had to do it; and while it's tedious to do that
for every affected beam, it ensures that they look good and work properly.

Cheers,

A

On Tue, Sep 28, 2021 at 11:08 AM Paul Hodges  wrote:

> The composer I'm working on is very fond of having beams over rests -
> and indeed it helps a lot in reading his more complex rhythms.  However,
> LilyPond is treating rests differently from notes, in that beam
> positions are adjusted to suit the notes, whereas rests are then
> adjusted to suit the beams.  So I get this kind of layout:
> However, the publisher wants rests to remain in their standard position,
> like this:
>
> with occasional compromises to this extent:
>
>
> I can obviously force this in individual cases, but again, is there a
> global adjustment I can make to get nearer to what I'm being asked for?
>
> Thanks,
> Paul


Beams over rests

2021-09-28 Thread Paul Hodges
The composer I'm working on is very fond of having beams over rests - 
and indeed it helps a lot in reading his more complex rhythms.  However, 
LilyPond is treating rests differently from notes, in that beam 
positions are adjusted to suit the notes, whereas rests are then 
adjusted to suit the beams.  So I get this kind of layout:
However, the publisher wants rests to remain in their standard position, 
like this:

with occasional compromises to this extent:


I can obviously force this in individual cases, but again, is there a 
global adjustment I can make to get nearer to what I'm being asked for?

Thanks,
Paul

CHanging the = sign in a metronome mark

2021-09-28 Thread Peter Toye
I want to change the "=" to "~" or "ca." in a metronome mark but I can't see 
how to do it. There's a 'stencil' property but I assume that refers to the 
entire MM and not the equals sign. Can someone please help?
 
Thanks in advance

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

Moving tuplet brackets

2021-09-28 Thread Paul Hodges
I am at present being asked to put a lot of tuplet brackets on the same 
side of the staff (above) as slurs, and this is leading to a lot of 
collisions.  I could deal with them individually (a lot of work), but is 
there something I can do to to force tuplet brackets away from slurs 
(outside them) globally?  I've not been able to find anything that suits 
yet.

This is probably complicated by the fact that I am already using code to 
force the brackets horizontal (code by Harm I think, from a mail about 
ten years ago).

Here is a sample of what I currently have:
and here is a sample of another piece as the publisher wants it:

Thanks,
Paul

Re: musicXML: 2 staves, piano

2021-09-28 Thread Jacques Menu
Le 28 sept. 2021 à 07:53, Ivanov Dmitry  a écrit :What kind of programmed scores handling are you aiming at?Standard piano score with 2 staves and 4 voices: 2 voices per staff.OK, but you mentioned reading/manipulating music with programs, or did I get it wrong?Stangely enough, opening hello2.xml with MuseScore, which displays the score alright, and then exporting it to MusicXML gives the attached hello2_FROM_MUSE_SCORE.xml  which, compiled with musicxml2ly, produces hello2_FROM_MUSE_SCORE.ly. And the latter looks fine once compiled with LilyPond… The only real difference are the extra  elements, which shouldn’t matter.That beats me...JM

hello2_FROM_MUSE_SCORE.xml
Description: XML document


hello2_FROM_MUSE_SCORE.ly
Description: Binary data


hello2_FROM_MUSE_SCORE.pdf
Description: Adobe PDF document


Re: --bigpdf

2021-09-28 Thread Erik Ronström
I finally got it working!

For future reference, the problem was that I could not make ghostscript use the 
exported font files from lilypond. I got it working by symlinking from one of 
the hardcoded font search paths (/usr/local/share/ghostscript) into the font 
export directory.

Also I use pdfcrop in my chain and for the files produced with 
--pspdfopt=TeX-GS, pdfcrop doesn’t work correctly. pdfcrop uses gs with 
-sDEVICE=bbox to get the bounding box of the pdf but it runs gs with -dSAFER 
which prevents gs from loading the exported font files. I suspect it is because 
they are not the actual font files but only wrappers linking to the real font 
files.

The only way I could resolve that was to either patch pdfcrop to remove -dSAFER 
or to ”manually” point gs to the actual font files by placing their path in the 
environment before calling pdfcrop:

GS_FONTPATH=/Library/Fonts/:/Applications/LilyPond.app/Contents/Resources/share/lilypond/current/fonts/otf/
 pdfcrop myscore.pdf


If anyone has a cleaner solution I would be glad to hear about it!

Erik



> 27 sep. 2021 kl. 20:47 skrev Erik Ronström :
> 
>> That option was removed again, but as far as I understand [1] you can
>> get similar tunings with "--pspdfopt=".