Harp_pedal_engraver: an overengineered solution to a niche problem

2023-12-07 Thread Saul Tobin
Hello friends,

I’ve found that one of the more cumbersome tasks in Lilypond is engraving
chromatic music for concert harp. When entering markups manually for each
pedal change, it’s difficult to achieve clean and consistent formatting,
and very easy to make errors. I’d like to share my solution to this problem.

The user only needs to enter pedal settings at the beginning of a passage,
which looks like:

<>\setHarpPedals { d c b e f g a }

Harp_pedal_engraver then listens for notes and automatically prints pedal
changes when new accidentals occur. Manually entered pedal changes (using
the same function as above) are only needed if a pedal must be changed
early. Warnings are triggered if contradictory accidentals are entered.
There is support for graphical pedal diagrams with and without circles, and
the format of text pedal charts can be customized.

The engraver creates two new grobs, HarpPedalChart and HarpPedalChange,
which will typically belong to the PianoStaff or GrandStaff. I extended
side-position-interface::move-to-extremal-staff to allow for placement of
grobs below the top staff if direction is set to CENTER. The style options
and default grob positioning are based on Elaine Gould’s book and examples
I’ve seen of harpists marking up their parts.

I’ve included in the file a fairly complete set of tests and examples.

I’d welcome feedback and I’d be happy to submit this as a pull request for
either OLL or Lilypond itself if there is interest.

Some technical comments:

1. I’ve duplicated with minor changes several functions from
chord-name.scm. IMO note-name->string should be changed to accept an
integer instead of ly:pitch, to be consistent with
accidental->text-accidental-markup. I’ve also duplicated note-name->markup,
because the original implementation doesn’t allow for printing naturals,
and also because for some reason it inserts a space between the note name
and the flat sign, which IMO is quite ugly (this is a general issue I see
on both Mac and Windows when entering flat signs in markups, not just with
that function).

2. I haven’t tested localization to other language note names.

3. I would love to provide a cleaner interface for users to customize the
formatting of text pedal markings or add enclosures around graphical pedal
diagrams. For example, it would be nice to let users do something like
\override HarpPedalChart.enclosure = \markup\box\etc instead of having to
create a whole Scheme function accepting the grob as an argument. It would
also be nice to have the user be able to simply write something like
\override HarpPedalChart.format-pedal-text = #my-custom-format instead of
#(const my-custom-format). (Naturally, this relates to which logic and
properties belong to the engraver vs. the grobs – I think my choices were
sensible, but perhaps there is a better design?)

4. Right now, overrides only work with the context name specified. I’d love
to know how to make these work with just the grob name.

5. It would be nice to have the engraver ignore notes created by
\cueDuring, but as far as I can tell, these notes are indistinguishable
from ordinary notes by translation time. To workaround this, it’s necessary
to turn automatic pedal changes off during cues. Not a big deal but
slightly ugly.

6. The grob definitions are based on TextScript but I removed properties
that didn’t seem to do anything in my test examples. I have no idea if they
should be added back in or values adjusted to deal with situations my tests
didn’t cover.


harp-pedal-engraver.ily
Description: Binary data


Re: Staff switch over page break spoils vertical spacing

2023-07-08 Thread Saul Tobin
Jean, please don't apologize for the constraints on your time. You
contribute so much to the project and the community. Your efforts are
appreciated.

On Sat, Jul 8, 2023 at 8:11 PM Jean Abou Samra  wrote:

> Le samedi 08 juillet 2023 à 17:44 +1000, Vaughan McAlley a écrit :
>
> When a staff-switch line goes over a page break, the first system in the
> next page is stretched and may cover the next system. In the example here,
> it nearly touches, but in a full score the top system is stretched beyond
> the bottom of the page.
>
> In the wild, a system may stretch over the next system, like the attached
> picture.
>
>
>
> That smells like https://gitlab.com/lilypond/lilypond/-/issues/6551 .
>
> Admittedly, I'm embarrassed about this bug since it is a regression that I
> introduced. (Reverting the offending commit would be easy, but that commit
> fixed a bug too.) I know what needs to be done since I investigated two
> weeks ago, but unfortunately I likely won't have the time to actually
> prepare the patch in the coming week, sorry.
>
> Working around it would not exactly be straightforward either; sorry about
> that too.
>
> Best,
> Jean
>
>


Re: LilyPond 2.25.6

2023-06-24 Thread Saul Tobin
Hooray! I can finally compile my whole symphony draft on Windows! Thanks
devs for all the work that went into this.

On Sat, Jun 24, 2023 at 6:42 AM Jonas Hahnfeld via LilyPond user discussion
 wrote:

> We are happy to announce the release of LilyPond 2.25.6. This is termed
> a development release, but these are usually reliable for testing new
> features and recent bug fixes. However, if you require stability, we
> recommend using version 2.24.1, the current stable release.
> Please refer to the Installing section in the Learning Manual for
> instructions how to set up the provided binaries:
> https://lilypond.org/doc/v2.25/Documentation/learning/installing
>
> This release of LilyPond includes an updated version of the library for
> garbage collection that should finally address some rare crashes seen
> on Windows. If you have scores that were crashing with previous
> versions, including the stable LilyPond 2.24.1, please give this
> development version a try and report back the results. Unless problems
> are reported, we are planning to backport this update and release it as
> LilyPond 2.24.2, along with a number of other bug fixes.
>


Re: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Saul Tobin
A practical follow up question: what is currently the largest repertoire of
publicly available Lilypond scores? Ideally, something like the complete
Bach chorales or Mozart piano sonatas.

On Wed, Mar 29, 2023 at 3:43 PM Saul Tobin 
wrote:

> I've seen some examples of other people succeeding in getting ChatGPT with
> GPT4 to compose simple music in other text based music formats. I've had
> limited success getting it to output Lilypond code. It is able to correctly
> structure the code with a score block, nested contexts, and appropriately
> named variables, and bar checks at the end of each measure. It seems to
> struggle to create rhythms that fit within the time signature beyond
> extremely simple cases. It also seems to struggle a lot to understand what
> octave pitches will be in when using relative mode.
>
> It also seems to have a lot of trouble keeping track of the relationship
> between notes entered in different simultaneous expressions. Just asking it
> to repeat back which notes appear in each voice on each beat, GPT4
> frequently gives stubbornly incorrect answers about the music it generated.
> This makes it very difficult to improve its output by giving feedback.
>
> I'm curious whether anybody else has tried playing with this. I have to
> imagine that GPT4 has the potential to produce higher quality Lilypond
> output, given some of the other impressive things it can do. Perhaps it
> needs to be provided with a large volume of musical repertoire in Lilypond
> format.
>


Re: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Saul Tobin
I think you may have that impression based on GPT3.5. GPT4 is already being
used to generate working non-trivial computer programs based only on a
brief text description.

On Wed, Mar 29, 2023 at 3:58 PM Alexandre Loomis 
wrote:

> > given some of the other impressive things it can do
>
> I think that's been exaggerated. It's very good at generating
> plausible-sounding text responses to prompts, everything else looks
> cherry-picked.
>
> On Wed, Mar 29, 2023 at 3:54 PM Nate 
> wrote:
>
>> Hah yes. It once said \begn{music} and i said "are you making this up?"
>> "I'm sorry, you're correct. The start tag should be \begin{lilypond}.
>>
>> Its super handy but you have to watch it. It can be a pathological liar.
>> I asked it how to do something on the Akai Mini Play and it said to use
>> this button  On the upper left corner. when i asked for clarification
>> instead of admitting it was mistaken it said it was white and next to
>> another button. Twice it doubled down before admitting it was wrong.
>>
>> On Wed, Mar 29, 2023, 6:44 PM Saul Tobin 
>> wrote:
>>
>>> I've seen some examples of other people succeeding in getting ChatGPT
>>> with GPT4 to compose simple music in other text based music formats. I've
>>> had limited success getting it to output Lilypond code. It is able to
>>> correctly structure the code with a score block, nested contexts, and
>>> appropriately named variables, and bar checks at the end of each measure.
>>> It seems to struggle to create rhythms that fit within the time signature
>>> beyond extremely simple cases. It also seems to struggle a lot to
>>> understand what octave pitches will be in when using relative mode.
>>>
>>> It also seems to have a lot of trouble keeping track of the relationship
>>> between notes entered in different simultaneous expressions. Just asking it
>>> to repeat back which notes appear in each voice on each beat, GPT4
>>> frequently gives stubbornly incorrect answers about the music it generated.
>>> This makes it very difficult to improve its output by giving feedback.
>>>
>>> I'm curious whether anybody else has tried playing with this. I have to
>>> imagine that GPT4 has the potential to produce higher quality Lilypond
>>> output, given some of the other impressive things it can do. Perhaps it
>>> needs to be provided with a large volume of musical repertoire in Lilypond
>>> format.
>>>
>>


Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Saul Tobin
I've seen some examples of other people succeeding in getting ChatGPT with
GPT4 to compose simple music in other text based music formats. I've had
limited success getting it to output Lilypond code. It is able to correctly
structure the code with a score block, nested contexts, and appropriately
named variables, and bar checks at the end of each measure. It seems to
struggle to create rhythms that fit within the time signature beyond
extremely simple cases. It also seems to struggle a lot to understand what
octave pitches will be in when using relative mode.

It also seems to have a lot of trouble keeping track of the relationship
between notes entered in different simultaneous expressions. Just asking it
to repeat back which notes appear in each voice on each beat, GPT4
frequently gives stubbornly incorrect answers about the music it generated.
This makes it very difficult to improve its output by giving feedback.

I'm curious whether anybody else has tried playing with this. I have to
imagine that GPT4 has the potential to produce higher quality Lilypond
output, given some of the other impressive things it can do. Perhaps it
needs to be provided with a large volume of musical repertoire in Lilypond
format.


Re: Change event properties before sending to engraver

2023-03-20 Thread Saul Tobin
Is your idea to have a second engraver at the Voice level to prepare the
events? You should be able to have an engraver listen to the event and
modify it before it's listened by the Staff level engraver, as long as they
are \consist'ed in the right order.

On Mon, Mar 20, 2023, 1:40 PM Valentin Petzel  wrote:

> Hello,
>
> this is a more technical question targeted to the more experienced members
> of
> the list.
>
> One thing that is stupidly hard to do in Lilypond is getting Slurs, Ties
> and
> other spanners to work between different Voices. The general approach is
> to use
> hidden notes, which is not at all nice to do or nice to read, and will
> require
> many extra voices in more complicated cases.
>
> So one approach I’ve been trying to attempt is to move the respectable
> Engravers to a higher context (Staff or even higher) and then make use of
> Spanner ids to get the default behaviour.
>
> Basically each Voice context would be assigned a unique voice ID, and this
> ID
> is by default used as spanner id. Then
>
> <<
>   { c8( d e d) } \\ { c( b) c( b) }
> >>
>
> would still work, as these are Slurs with different spanner ids, but we
> can
> simply write
>
> <<
>   { c16\=1( d s8 } \\ { s c b\=1) }
> >>
>
> to get a Slur between these Voices.
>
> Of course this would still require some additional handling, as this will
> add
> unwanted support elements from other voices.
>
> But the point here is that while the events have to eventually be handled
> on
> the Staff level we kind of need to "prepare" them at the Voice level to
> have
> the correct spanner id.
>
> Thus I wanted to inquire if Lilypond has any mechanic that can be used for
> something like this?
>
> Alternatively one could use something like context properties to have
> engravers communicate and send events and grobs to other engravers, but
> surey
> that would be messy.
>
> Cheers,
> Valentin


Re: Variables and Bookpart

2023-03-12 Thread Saul Tobin
That really only addresses the full score, not the parts, since in the
parts multiple movements share the same bookpart.

On Sun, Mar 12, 2023 at 5:19 PM Jean Abou Samra  wrote:

> Le dimanche 12 mars 2023 à 17:06 -0700, Saul Tobin a écrit :
>
> For what it's worth my use case was that I use the same variable names for
> each instrument in a separate file for each movement of a piece. I
> therefore need to \include the music for each movement immediately before
> the \score for that movement, in order to redefine the variables with the
> music for that movement. For the full score, that doesn't require
> \parserDefine because each movement can be its own \bookpart. However, for
> printing parts, I find it helpful to have all instruments output in the
> same \book, with each instrument as a \bookpart. That means that I need to
> be able to redefine the music variables within a \bookpart.
> If I were willing to use different variable names for instruments in each
> movement this wouldn't be needed, but I just find that ugly. I want my
> violinI to always be called violinI. There might be other ways to
> accomplish a similar goal but this has worked fine for me.
>
> Why not just save the bookparts into variables as you create them and
> later assemble them in a book? (See also my reply to Mark.)
>


Re: Variables and Bookpart

2023-03-12 Thread Saul Tobin
For what it's worth my use case was that I use the same variable names for
each instrument in a separate file for each movement of a piece. I
therefore need to \include the music for each movement immediately before
the \score for that movement, in order to redefine the variables with the
music for that movement. For the full score, that doesn't require
\parserDefine because each movement can be its own \bookpart. However, for
printing parts, I find it helpful to have all instruments output in the
same \book, with each instrument as a \bookpart. That means that I need to
be able to redefine the music variables within a \bookpart.

If I were willing to use different variable names for instruments in each
movement this wouldn't be needed, but I just find that ugly. I want my
violinI to always be called violinI. There might be other ways to
accomplish a similar goal but this has worked fine for me.

On Sun, Mar 12, 2023 at 4:45 PM Jean Abou Samra  wrote:

> Le dimanche 12 mars 2023 à 16:34 -0700, Saul Tobin a écrit :
>
> A slightly nicer syntax to workaround this limitation is to use the
> function:
> parserDefine =
> #(define-void-function (name val)(symbol? scheme?)
> (ly:parser-define! name val))
>
> Then instead of var = { ... } you can write \parserDefine var { ... }.
>
> I believe this was posted on the list a few years ago.
>
> Yes. However, if you end up finding this useful, I consider it likely that
> it indicates you should refactor your code. Off the top, I can't even think
> of a case where this is the best way to proceed.
>


Re: Variables and Bookpart

2023-03-12 Thread Saul Tobin
A slightly nicer syntax to workaround this limitation is to use the
function:

parserDefine =
#(define-void-function (name val)(symbol? scheme?)
(ly:parser-define! name val))

Then instead of var = { ... } you can write \parserDefine var { ... }.

I believe this was posted on the list a few years ago.

On Sun, Mar 12, 2023 at 4:26 PM Valentin Petzel  wrote:

> If I’m thinking correctly what Mark attempts to do is to have multiple
> files
> containing scores and then to
>
> \bookpart {
>   \include ...
> }
>
> to combine these scores. The problem here is quite simple: The notation
>
> name = value
>
> is something that is evalutated by the parser and will generally evaluate
> differently depending on which context this is used in. Only on top level
> this
> will be valuated to "define a music macro". In the context of an output
> def
> such as \paper of \layout and in \header this is interpreted as "set this
> particular property". In other cases this will only be allowed in
> conjuction
> with the reserved keywords \override and \set.
>
> Anyway the point is that the parser will not allow you to do this kind of
> syntax if you are not at toplevel.
>
> But that does not mean you cannot set such values, it just means you
> cannot
> use this syntax for it. By directly setting the scheme binding we can
> still do
> this:
>
> \bookpart {
>   #(define ArightOne #{ \relative c'' { c b a b } #})
>   \score { \ArightOne }
> }
>
> (by the way this also allows us to define bindings the parser does not
> handle
> well such as e.g. \c: c = ... will not be allowed, as c is a note name,
> but
> #(define c ...) works).
>
> Cheers,
> Valentin
>
> Am Sonntag, 12. März 2023, 23:51:28 CET schrieb Hans Aikema:
> > > On 12 Mar 2023, at 20:38, Mark Stephen Mrotek 
> > > wrote:
> > >
> > > Jean Abou Samra,
> > >
> > > Thank you.
> > > Yes variables must (and are) placed before the \score in each
> individual
> > > movement. That is why each complies perfectly when done individually.
> The
> > > error appears when the code for the movement (that compiles) is copied
> > > and pasted into the \bookpart.
> > >
> > > Your kind attention is appreciated.’
> > >
> > > Mark
> >
> > […]
> >
> > Mark,
> >
> > Based on your response I think you did not get the nuances of what Jean
> > tried to tell you.
> >
> > The copying/pasting of your working score INSIDE \bookpart means that you
> > are copying your variable definition (which is already properly outside
> the
> > \score) INSIDE the \bookpart, while it should be outside both the
> \bookpart
> > and the \score
> >
> > So you should
> >
> > {copy variables to here}
> > \bookpart {
> >   {copy rest of the score here}
> > }
> >
> > When using copy/paste of your score into a file with a \bookpart
> >
> >
> > HTH
> > Hans
>
>


Re: Message size limit

2023-03-04 Thread Saul Tobin
Hard disagree on plain text emails.

I didn't really have a strong opinion re the whole discussion about message
boards vs. email, but IMO the world has moved on to rich text email with
embedded media. I think the reliance on plain text email as the standard
for this mailing list detracts significantly from the conversation.
Inlining images makes it much easier to communicate typesetting questions
and also much easier to quickly respond, especially when viewing messages
on a cell phone.

Rich text emails with embedded media should IMO be supported as first class
citizens of the mailing list.

Saul


On Sat, Mar 4, 2023 at 12:18 PM Valentin Petzel  wrote:

> Hi Jean,
>
> I think Robin is talking about embedded images that are quoted on reply,
> resulting in the same attachment being sent back and forth over and over
> again.
>
> Of course this does not matter when you send plain text emails, which
> should
> be the sensible choice ...
>
> Cheers,
> Valentin
>
> Am Samstag, 4. März 2023, 16:53:11 CET schrieb Jean Abou Samra:
> > Le samedi 04 mars 2023 à 16:45 +0100, Robin Bannister a écrit :
> > > Jean Abou Samra wrote:
> > > > Hi,
> > > >
> > > > We've been informed that the size of messages to this list containing
> > > > large attachments is occasionally clogging up the GNU list server's
> > > > mail delivery queue, causing distribution delays (not just for this
> > > > list, but for everyone on the hundreds of other gnu.org lists).
> > > >
> > > > To avoid this, your friendly list admins have configured a max
> message
> > > > size of 512KB.>
> > > Is there any specific advice for users taking screenshots?
> >
> > Not sure I understand the question. Why would they differ from other
> kinds
> > of attachments?
> > > Especially inline ones: those get copied when quoted, cf 2021-09.
> >
> > What are you referring to precisely? There are lots of messages in the
> list
> > archives for September 2021.
>
>


Re: Tips for code reusability

2023-03-01 Thread Saul Tobin
I concur on entering all music in concert pitch. You may find the
auto-transpose snippet from OpenLilyLib helpful (
https://github.com/openlilylib/oll-misc/tree/master/pitch), as you can
simply write "\transposition bf" instead of wrapping all transposed blocks
in "\transpose x y { }". This is particularly helpful if players may switch
between instruments using different transpositions.

On Wed, Mar 1, 2023 at 5:59 PM Wol  wrote:

> On 28/02/2023 22:02, TJ Kolev wrote:
> > I would appreciate any suggestions for the above issues. Or comments on
> > how I am putting together the whole score.
>
> I do a load of brass (and concert) band stuff. And because I play
> trombone I'm sensitive to transposition issues. So I always store my
> parts in variables IN CONCERT PITCH.
>
> When copying from a part, let's say it's a treble-clef trombone part, I
> always wrap it in "\transpose c' bf {}". Then if I want to print a
> treble-clef part I wrap the variable in "\transpose bf c' {}". And while
> it may seem redundant, when printing a bass-clef part I always wrap it
> in "\transpose c c {}".
>
> And I always print parts using "\clef treble_8" or whatever as appropriate.
>
> It means that I have no problem wondering what pitch the original part
> was in - my variables are always concert. I can print it out for eg Sop,
> Repiano or ordinary cornet. I can print trombone parts in bass or treble
> clef. I can shift between Eb, EEb, Bb, BBb basses. Whatever.
>
> If the conductor wants the score all in the same transposition, or in
> the instrument's transposition ...
>
> It's just knowing the internal representation is *always* concert just
> makes my mental gymnastics much simpler.
>
> Cheers,
> Wol
>
>


Re: Tips for code reusability

2023-02-28 Thread Saul Tobin
https://lilypond.org/doc/v2.24/Documentation/notation/writing-parts#quoting-other-voices
may help with the second question.

On Tue, Feb 28, 2023 at 5:08 PM TJ Kolev  wrote:

> Greetings,
>
> I've decided to notate a brass band piece from a paper copy into some
> digital format that would be easier to edit and transform Picked LilyPond
> and have been using it with Frescobaldi. So far very happy with the whole
> setup.
>
> I did a couple of instruments, and I am feeling my way through it. You can
> find what I have so far here:
> https://github.com/tjkolev/MusicScores/tree/develop/DanubeHoro
>
> I've been using the documentation a lot, and there are nice examples.
> However I have some questions I was unable to find answers for. I am hoping
> to get some ideas from this group.
>
> (1) DrumVoice
> Is there a way to define a default "note" for a drum voice? The piece has
> the bass drum and cymbal playing the same thing (with a two bar exception).
> I currently have the music duplicated, both rendering with the "bd" note.
> It would be nice if each was rendered with its separate note head. I was
> looking for something like this:
>
> \new DrumVoice *bd* { \voiceOne \stemUp   \bassncymA ... }
>> \new DrumVoice *cymc* { \voiceTwo \stemDown \bassncymA ... }
>
>
> Re:
> https://github.com/tjkolev/MusicScores/blob/develop/DanubeHoro/drums.ly#L211-L212
>
> (2) Copy music and replace bars
> Some of the instruments, for a good part of the piece, play the same
> notes. Or transposition of some notes. Except here and there for a couple
> of bars they play different music. I am looking for a way to do something
> like this:
>
> new frenchHornMusic = flugHornMusic.Transpose();
> flugHornMusic.Replace(bars(10 through 14), {  });
> flugHornMusic.Replace(bars(108 through 114), {  });
>
> I know I can combine snippets of music, but the above is easier, when only
> a few bars differ. I am OK writing some custom function, and I looked at
> the "Extending" documentation. Could not figure out how the music is
> structured and how to get to the bars (if such an object exists).
>
> I would appreciate any suggestions for the above issues. Or comments on
> how I am putting together the whole score.
>
> Cheers!
> tjk :)
>


Re: LilyPond 2.25.2

2023-02-18 Thread Saul Tobin
Surprised to see that the http versions of those pages are accessible.
Shouldn't they redirect to https?

On Sat, Feb 18, 2023 at 12:13 PM Jonas Hahnfeld via LilyPond user
discussion  wrote:

> On Sat, 2023-02-18 at 14:43 -0500, Shane Brandes wrote:
> > That is great, but where can one find a list of changes between
> > versions?
>
> The current Changes document can be found here:
> http://lilypond.org/doc/v2.25/Documentation/changes/
> In general, all manuals for the development releases are linked from
> http://lilypond.org/development.html
>
> Cheers
> Jonas
>


Re: Landscape output displays sideways

2023-02-18 Thread Saul Tobin
Channel wrap around can also occur if you assign midi channels per Voice
and instantiate more than 16 Voice contexts, for example if you have used
\new Voice at the beginning of each polyphonic passage.

On Sat, Feb 18, 2023, 7:04 AM  wrote:

> On 17 Feb 2023 at 19:11, Jean Abou Samra wrote:
>
> > I have another question. I get five of these messages:
> > warning: MIDI channel wrapped around
> > warning: remapping modulo 16
> > I am-generating a MIDI file, but the only line in the source file
> talking about MIDI is
> >   \midi {
> > \tempo 2=100
> >   }
> > in the score block. What's going on.
> > You cannot have more than 16 channels in a MIDI file, it's a limitation
> of the MIDI
> > format. Maybe you have more than 16 staves?
>
> The piece has four staves.
>
> --
> Tim Slattery
> t...@risingdove.com
>
>
>
>


Re: Documentation: Should we possibly have aliases for current stable and current devel?

2023-02-13 Thread Saul Tobin
Many users have old projects on very old versions of Lilypond, and
sometimes you just want to make a small edit, not update your whole project
to use the new version. It's important for documentation to be available.

On Mon, Feb 13, 2023, 8:41 AM Kevin Cole  wrote:

> On Mon, Feb 13, 2023 at 11:33 AM Lukas-Fabian Moser  wrote:
> >
> > Hi Kevin,
> >
> > > On the other hand, I strongly favor sticking with a distribution's
> > > package rather than starting every day with a "git pull". So, I'm
> > > always slightly behind the latest and greatest.
> >
> > Just for the record: Your description omits the (actually quite
> > convenient) middle between the two extremes: Namely, that it's quite
> > easy to keep up with current LilyPond development by downloading and
> > using the respective (unstable) builds that are released every few weeks
> > to months.
>
> The point I was trying to make was "Does there REALLY need to be
> documentation for versions 2.13 to 2.25?  Maybe 2.20 to 2.25 would
> suffice."
>
>


Re: nested \relative ?

2023-02-11 Thread Saul Tobin
This seems more or less equivalent to religiously putting
\resetRelativeOctave at the beginning of every phrase IMO.

On Sat, Feb 11, 2023 at 2:15 PM Simon Albrecht 
wrote:

> On 10/02/2023 19:22, Saul Tobin wrote:
> > What is the reasoning behind having smaller relative blocks?
>
> I agree that there are many factors in the workflow, project and
> templates that influence this decision. I want to give just one example:
> Piano score or similar with changing number and orientation of voices.
>
> One way of setting that up (other staff would work the same): (this got
> longer than I expected, sorry)
>
>
> {
>%\oneVoice
>\relative { %{ some music %} }
><<
>  \relative {
>\voiceOne
>% more music
>  }
>  \new Voice \relative {
>\voiceTwo
>% parallel music
>  }
>>>
>\oneVoice
>\relative {
>  % continue main voice without worrying about which pitch is preceding
>}
><<
>  \relative {
>% independent polyphonic part
>  }
>  \\
>  \relative {
>% can freely switch around voices during editing
>% without worrying about wrong pitches
>  }
>>>
> }
>
> Another way the same thing could be set up:
>
> <<
>\new Voice = "default" {
>  % one music expression for everything that’s oneVoice
>  \relative {
>% first section of music
>% then I choose to stay in the music expression because it
>% immediately continues
>\voiceOne
>% second section
>\oneVoice
>  }
>  % now there’s a change of register, and instead of calculating
>  % the number of octaves it is displaced, I just open a new
>  \relative {
>% third section of music
>  }
>  % fourth section of music begins afresh, so I skip in this
>  % music expression
>  s32*7
>}
>\new Voice = "voiceOne" {
>  \voiceOne
>  % skips for first through third section
>  \relative {
>% music for the fourth section, again just specify the first
>% pitch in absolute so I’m safe against future edits
>  }
>}
>\new Voice = "voiceTwo" {
>  \voiceTwo
>  % skip a bit, but then...
>  \voiceThree
>  % I realise that I forgot a couple notes in voiceThree, but they
>  % won’t influence any other pitches because of the independent
>  % relative blocks
>  \relative {
>% couple notes
>  }
>  % more skips
>  \relative {
>\voiceTwo
>% second section
>% voiceXXX command inside or outside relative is of course
>% completely irrelevant and just personal preference
>  }
>  % skips
>  {
>% fourth section is just a pedal point and doesn’t need
>% relative at all
>a,,,1~ 32.. 128 4
>  }
>}
>  >>
>
>
> Best, Simon
>
>


Re: nested \relative ?

2023-02-11 Thread Saul Tobin
The downsides seem to me like they would be very specific to a given user's
workflow.

On Sat, Feb 11, 2023 at 6:53 AM Kieren MacMillan <
kie...@kierenmacmillan.info> wrote:

> Hi Saul,
>
> > What is the reasoning behind having smaller relative blocks? Generally I
> structure my variables as a single \relative block per variable and just
> use \resetRelativeOctave at the beginning of every passage.
>
> One big downside of larger relative blocks is that cut-and-paste coding
> becomes problematic. There are many more downsides, but I’ll let others
> comment.
>
> Cheers,
> Kieren.


Re: nested \relative ?

2023-02-10 Thread Saul Tobin
What is the reasoning behind having smaller relative blocks? Generally I
structure my variables as a single \relative block per variable and just
use \resetRelativeOctave at the beginning of every passage.

On Fri, Feb 10, 2023 at 3:09 AM Simon Albrecht 
wrote:

> Hi Darren,
> On 10/02/2023 11:46, Darren Ng wrote:
>
> \ghostNoteWhichDoesNotActuallyAppear { c,,, }
>
> I think what you want here is \resetRelativeOctave.
>
> The best solution depends on many factors around your workflow and the
> setup of your project, but generally it is recommendable to split things up
> into smaller \relative {} blocks. It has taken me a long time to get better
> at this and actually do things like (silly example)
>
> someMusicVariable = {
>   \relative { c'4. e8 g4 c | a c8 a g2 }
>   R1*10
>   \relative { f'4. g8 e4 c | d2 c }
> }
>
> HTH, Simon
>


Re: Duplicate marks with removed Staves (frenched)

2023-02-09 Thread Saul Tobin
I think the reason is that the mark engravers belong to the staff grouping
context, which isn't removed along with the child staves. Structuring the
code like this avoids the duplicate marks:

\version "2.24.0"

\layout {
  \context {
\Score
\remove Bar_number_engraver
\remove Staff_collecting_engraver
\remove Mark_tracking_translator
\remove Mark_engraver
\remove Text_mark_engraver
  }
  \context {
\ChoirStaff

  }
  \context {
\Staff
\RemoveEmptyStaves
\consists Bar_number_engraver
\consists Staff_collecting_engraver
\consists Mark_tracking_translator
\consists Mark_engraver
\consists Text_mark_engraver
  }
}
marks = {
  s1
  s
  \break
  \mark\default
  s
  \textMark "here"
  s
  \break
  \mark\default
  s
  \textMark "there"
  s
}
A =  { 1 1 s1 s1 1 1 }
B =  { 1 1 1 1 1 1 }
<<
  \new ChoirStaff <<
\new Staff << \marks \A >>
  >>
  \new ChoirStaff <<
\new Staff << \marks \B >>
  >>
>>

Maybe I'm missing a way to do this while keeping the mark engravers in the
ChoirStaff context.

Saul

On Thu, Feb 9, 2023 at 1:29 AM Simon Albrecht 
wrote:

> Hi Saul,
> On 08/02/2023 22:03, Saul Tobin wrote:
>
> Is there a reason to have the marks in a child context rather than just a
> simultaneous music variable?
>
>
> You mean the Devnull? Just convenience. It works well with the way I
> assemble different ChoirStaffs for different output formats and adding
> marks to just one or multiple of them as needed.
>
> Now this morning I had an empty extra staff appear on top and I don’t know
> why, but it shouldn’t come from the Devnull.
>
> Best, Simon
>


Re: Duplicate marks with removed Staves (frenched)

2023-02-08 Thread Saul Tobin
Hi Simon,

Is there a reason to have the marks in a child context rather than just a
simultaneous music variable?

Saul

On Wed, Feb 8, 2023 at 10:24 AM Simon Albrecht 
wrote:

> Hello everyone,
>
> I am working on a large score with several ChoirStaves and want to have
> BarNumbers and Marks in the middle as well. However, when I use
> \RemoveEmptyStaves, removed Staves still have their BarNumbers etc.
>
> How can I solve this without hard-coding where the Staves are removed? Of
> course I could use manual breaks and override the stencils, but that would
> be cumbersome and inflexible.
>
> See the attached/following example—of course it has nothing actually to do
> with the ChoirStaff contexts.
>
> Best, Simon
>
> %
> \version "2.25.0"
>
> \layout {
>   \context {
> \Score
> \remove Bar_number_engraver
> \remove Staff_collecting_engraver
> \remove Mark_tracking_translator
> \remove Mark_engraver
> \remove Text_mark_engraver
>   }
>   \context {
> \ChoirStaff
> \consists Bar_number_engraver
> \consists Staff_collecting_engraver
> \consists Mark_tracking_translator
> \consists Mark_engraver
> \consists Text_mark_engraver
>   }
>   \context {
> \Staff
> \RemoveEmptyStaves
>   }
> }
> marks = \new Devnull {
>   s1
>   s
>   \break
>   \mark\default
>   s
>   \textMark "here"
>   s
>   \break
>   \mark\default
>   s
>   \textMark "there"
>   s
> }
> A = \new Staff { 1 1 s1 s1 1 1 }
> B = \new Staff { 1 1 1 1 1 1 }
> <<
>   \new ChoirStaff << \marks \A >>
>   \new ChoirStaff << \marks \B >>
> >>
>


OLL autotranspose feature release

2023-02-05 Thread Saul Tobin
Hi all,

Just want to let everyone know, auto-transpose in OpenLilyLib now has
automatically inserted key signatures.

https://github.com/openlilylib/oll-misc/tree/master/pitch/auto-transpose

Please let me know if you run into any bugs using it.

Saul


Re: Error in Extending Lilypond example

2023-02-01 Thread Saul Tobin
Oh wow really? It's the best/only documentation for several things that
aren't really covered in the official Extending docs. Maybe it should
become official? Or at least easier to find. I didn't know it existed until
you posted to the list about translations – it doesn't come up on Google
search results for Lilypond questions, at least for me.

On Wed, Feb 1, 2023 at 2:12 AM Jean Abou Samra  wrote:

> Saul,
>
>
> Le 1 févr. 2023 à 04:16, Saul Tobin  a écrit :
>
> The fourth example engraver here:
>
> https://extending-lilypond.readthedocs.io/en/latest/extending/translation.html#fourth-engraver-example
>
> Running this code in 2.24 crashes on initializing the engraver with In
> procedure ly:spanner-set-bound!: Wrong type argument in position 3
> (expecting Item): ().
>
>
>
> Thanks for the report. I suppose you did not realize that this “Extending
> LilyPond” resource is not part of the official documentation, it’s
> something I wrote up and maintain externally (unlike the official Extending
> Manual, which lives at
> https://lilypond.org/doc/v2.24/Documentation/extending/index.html). Thus,
> any feedback you have should be sent to me privately, not to the bug list.
>
> Best,
> Jean
>
>
>


Error in Extending Lilypond example

2023-01-31 Thread Saul Tobin
The fourth example engraver here:
https://extending-lilypond.readthedocs.io/en/latest/extending/translation.html#fourth-engraver-example

Running this code in 2.24 crashes on initializing the engraver with In
procedure ly:spanner-set-bound!: Wrong type argument in position 3
(expecting Item): ().


Re: \stopStaff \startStaff spacing & line continuity

2023-01-31 Thread Saul Tobin
I believe this may be a case where you need to use \applyOutput, as
documented here:
https://extending-lilypond.readthedocs.io/en/latest/extending/translation.html#tweaking-grobs-during-translation
.

On Tue, Jan 31, 2023 at 5:57 PM Ahanu Banerjee 
wrote:

> I am trying to modify the color of the ledger lines for a single note. My
> understanding is that I need to use \stopStaff and \startStaff for this.
> However, doing so causes the staff lines to be discontinuous. This rounds
> the ends of the staff lines surrounding the point at which the staff is
> stopped and causes adjacent notes to have increased horizontal spacing. How
> can this be avoided?
>
> See code below.
>
> \version "2.24.0"
> \language "english"
> { g8 \stopStaff \startStaff
>   \once \override Staff.LedgerLineSpanner.color = green
>   g \stopStaff \startStaff g g }
>
> Thanks,
> -Ahanu
>


Re: Understanding marks in 2.24

2023-01-31 Thread Saul Tobin
On Tue, Jan 31, 2023 at 1:32 PM Jean Abou Samra  wrote:

> On 31/01/2023 22:07, Saul Tobin wrote:
> > I have a few questions:
> > 1. How to achieve horizontal alignment and avoid vertical overlap of
> RehearsalMarks and MetronomeMarks at the beginning of a system, or when
> musical objects push them away from the staff as in measure 3? I have to
> say I think the default output could be improved.
>
>
> It's been requested a few times, but there is no easy way to do this
> at the moment (although you can find some hacks in the list archives).
>

The hack that I used in the past was to set extra-spacing-width to
something like #'(0 . 0) for both types of marks, but it seems like when
systems are vertically compressed, this can interfere with the spacing of
the music. Is there a way to prevent that from happening? (Or a better grob
property to use to get the marks to line up?)

Attached is an example in which the minimal output looks correct, but
essentially the same code in the context of my full score screws up the
spacing. I can achieve similar bad output in the minimal example by leaving
Staff_collecting_engraver in Score instead of moving it to MarkLine (which
I don't entirely understand).

Bizarrely, the only thing I've tried that produces correct output
everywhere I've checked is \override MetronomeMark.extra-spacing-width =
#'(0 . +inf.0), which is nonsensical and emits tons of warnings.


markline.ily
Description: Binary data


Re: Understanding marks in 2.24

2023-01-31 Thread Saul Tobin
I realized that the duplication is actually not an issue when using a
MarkLine context, since it isn't collecting the events from multiple
contexts, it's just listening to the event from the MarkLine itself. I
guess I'll just stick with this way of doing things.

\version "2.24.0"
\language "english"

\layout {
  \context {
\name "MarkLine"
\type "Engraver_group"
\consists Axis_group_engraver
\consists Mark_engraver
\consists Metronome_mark_engraver
\consists Text_mark_engraver
\override VerticalAxisGroup.staff-affinity = #DOWN
  }
  \context {
\Score
\accepts MarkLine
\remove Mark_engraver
\remove Metronome_mark_engraver
\remove Text_mark_engraver
  }
}

global = {
  \mark\default
  \tempo "foo"
  s1
  \mark\default
  \tempo "foo"
  s1
  \mark\default
  \tempo "foo"
  s1
  \textMark "foo"
  s1
}

music = \relative c'' {
  bf4 a c b
  bf4 a c b
  bf''4 a,, c b
  bf4 a c b
}

\score {
  <<
\new MarkLine \global
\new StaffGroup <<
  \new Staff << \global \music >>
  \new Staff << \global \music >>
>>
  >>
}

On Tue, Jan 31, 2023 at 1:55 PM Saul Tobin 
wrote:

> IMO deduplication wouldn't really be semantically contradictory, because
> the goal of allowing multiple simultaneous marks is to allow for multiple
> *different* marks at the same moment. And you could always have a context
> property to switch deduplication on/off.
>
> The scheme evaluation challenges seem like the bigger issue.
>
> Typically, the way I structure a score is to have a \global variable
> containing skips + all the information shared across all players, such as
> key, time, and marks. It goes a bit counter to that structure to either
> separate out \textMarks into their own variable or to use tagging to
> control where they display in the full score. Certainly doable, but IMO it
> would be worth at least clarifying in the documentation.
>
> Thanks for the detailed response!
>
> On Tue, Jan 31, 2023 at 1:48 PM Jean Abou Samra 
> wrote:
>
>> On 31/01/2023 22:33, Jean Abou Samra wrote:
>> > Uh, why did I just write this already? The latter wouldn't
>> > be a problem. assign_event_once uses "equal?" The former,
>> > with procedures, is indeed a problem.
>> >
>> > Sorry for the noise.
>>
>>
>> Looking a bit more into define-markup-commands.scm, this
>> will occur at least with
>>
>> \markup \score
>> \markup \score-lines
>> \markup \stencil
>> \markup \on-the-fly
>> \markup \with-string-transformer
>> \markup \if
>> \markup \unless
>>
>> e.g.
>>
>> <<
>>   \new Staff { \mark \markup A c' }
>>   \new Staff { \mark \markup A c' }
>> >>
>>
>> vs.
>>
>> <<
>>   \new Staff { \mark \markup \score { c' } c' }
>>   \new Staff { \mark \markup \score { c' } c' }
>> >>
>>
>>
>> Also, allowing several text marks at the same moment
>> is one of the root motivations for \textMark, so
>> deduplicating based on markup equality would feel
>> (IMHO) surprising.
>>
>>
>>


Re: Understanding marks in 2.24

2023-01-31 Thread Saul Tobin
IMO deduplication wouldn't really be semantically contradictory, because
the goal of allowing multiple simultaneous marks is to allow for multiple
*different* marks at the same moment. And you could always have a context
property to switch deduplication on/off.

The scheme evaluation challenges seem like the bigger issue.

Typically, the way I structure a score is to have a \global variable
containing skips + all the information shared across all players, such as
key, time, and marks. It goes a bit counter to that structure to either
separate out \textMarks into their own variable or to use tagging to
control where they display in the full score. Certainly doable, but IMO it
would be worth at least clarifying in the documentation.

Thanks for the detailed response!

On Tue, Jan 31, 2023 at 1:48 PM Jean Abou Samra  wrote:

> On 31/01/2023 22:33, Jean Abou Samra wrote:
> > Uh, why did I just write this already? The latter wouldn't
> > be a problem. assign_event_once uses "equal?" The former,
> > with procedures, is indeed a problem.
> >
> > Sorry for the noise.
>
>
> Looking a bit more into define-markup-commands.scm, this
> will occur at least with
>
> \markup \score
> \markup \score-lines
> \markup \stencil
> \markup \on-the-fly
> \markup \with-string-transformer
> \markup \if
> \markup \unless
>
> e.g.
>
> <<
>   \new Staff { \mark \markup A c' }
>   \new Staff { \mark \markup A c' }
> >>
>
> vs.
>
> <<
>   \new Staff { \mark \markup \score { c' } c' }
>   \new Staff { \mark \markup \score { c' } c' }
> >>
>
>
> Also, allowing several text marks at the same moment
> is one of the root motivations for \textMark, so
> deduplicating based on markup equality would feel
> (IMHO) surprising.
>
>
>


Understanding marks in 2.24

2023-01-31 Thread Saul Tobin
Hi all,

I'm in the process of updating my scores from 2.18 to 2.24 (yes I skipped a
bunch of versions), and I'm trying to understand the intended use of the
new types of marks.

Take the following small example:

\version "2.24.0"
\language "english"

markGroup = \with {
  \consists Mark_engraver
  \consists Staff_collecting_engraver
  \consists Metronome_mark_engraver
  \consists Text_mark_engraver
}

music = \relative c'' {
  \mark \default
  \tempo "foo"
  bf a c b
  \mark \default
  \tempo "foo"
  bf a c b
  \mark \default
  \tempo "foo"
  bf'' a,, c b
  \textMark "foo"
  bf a c b
}

\score {
  <<
\new StaffGroup \with {
  \markGroup
} <<
  \new Staff \music
  \new Staff \music
>>
\new StaffGroup \with {
  \markGroup
}
  <<
  \new Staff \music
  \new StaffGroup <<
\new Staff \music
\new Staff \music
  >>
>>
  >>
  \layout {
\context {
  \Score
  \remove Mark_engraver
  \remove Staff_collecting_engraver
  \remove Metronome_mark_engraver
  \remove Text_mark_engraver

}
  }
}

I have a few questions:
1. How to achieve horizontal alignment and avoid vertical overlap of
RehearsalMarks and MetronomeMarks at the beginning of a system, or when
musical objects push them away from the staff as in measure 3? I have to
say I think the default output could be improved.
2. How to prevent TextMarks from printing many identical marks at the same
point in time? The docs suggest that \textMark should be used as a drop-in
replacement for \mark \markup... but the behavior seems incompatible. The
examples given are for instructions specific to a single player. Is it
feasible to use \textMark for ensemble-wide instructions without relying on
tags to prevent duplicates in the full score?
3. I formerly used a custom MarkLine context to align all marks on the same
horizontal baseline. I see that LSR lists the snippet as deprecated since a
bug was fixed that allowed mark engravers to be moved to StaffGroups
(though it is still referenced in the 2.24 docs here:
https://lilypond.org/doc/v2.24/Documentation/snippets/contexts-and-engravers#contexts-and-engravers-using-marklines-in-a-frenched-score).
Is there another preferred method to baseline-align all marks in a system?
4. What is the difference between an AdHocMark and a RehearsalMark? I find
some references to AdHocMark in the Internals docs but I'm unclear how to
actually use them.

Thanks!

Saul


Re: Snippet: automatic reminder text for mutes/techniques

2023-01-26 Thread Saul Tobin
I assumed that if the instrument is playing continuously, no reminder text
is needed. Did you have a scenario in mind where reminders would be useful
even without measures of rest?

Or, did you mean that instead of rests you are using spacers? I think this
snippet should work fine for that use case.

On Thu, Jan 26, 2023 at 6:10 PM Andrew Bernard 
wrote:

> What if you don't have any rests?
>
>
> Andrew
>
>
> On 27/01/2023 1:00 pm, Saul Tobin wrote:
> >
> > Attached is a snippet that keeps track of these instructions and
> > automatically prints reminder text after a set number of measures of
> rest.
> >
>
>


Snippet: automatic reminder text for mutes/techniques

2023-01-26 Thread Saul Tobin
Hi all,

I have always felt one of the more annoying proofreading tasks for
instrumental music is ensuring that technique instructions such as mutes
are properly cancelled.

Attached is a snippet that keeps track of these instructions and
automatically prints reminder text after a set number of measures of rest.

Is this something you would find useful?

Saul


reminder-engraver.ly
Description: Binary data


Re: Auto-transpose engraver progress

2023-01-19 Thread Saul Tobin
Thinking about this more, the issue with simultaneous transposition and key
changes is worse than I realized, since it's pretty common to write
something like:

global = {
  s1
  \key e \major
  s1
}

music = {
  g'1
  \transposition a
  g'1
}

\new Staff \with {
  \autoTranspose
} <<
  \global \music
>>

The output is incorrect (but differently wrong) regardless of whether you
write << \global \music >> or << \music \global >>.

This is partially a bug in the original snippet, not just my version with
inserted key signatures. Solving it would seem to require the ability to
"listen ahead" or "listen behind" to all the events happening at the same
moment. Is that even possible?

On Thu, Jan 19, 2023 at 5:48 PM Saul Tobin 
wrote:

> Hi all,
>
> I managed to add functionality to the auto-transpose engraver snippet from
> OLL so that it prints key signatures at transposition changes. It also
> doesn't do so if the transposition change is only octave transposition.
>
> The one thing I'd like to fix is the behavior when an actual key change
> occurs at the same moment as a transposition change. Currently this
> triggers a warning and the output is only correct depending on whether the
> key change or transposition is written first. Not sure how to approach
> solving that.
>
> Saul
>
>


Auto-transpose engraver progress

2023-01-19 Thread Saul Tobin
Hi all,

I managed to add functionality to the auto-transpose engraver snippet from
OLL so that it prints key signatures at transposition changes. It also
doesn't do so if the transposition change is only octave transposition.

The one thing I'd like to fix is the behavior when an actual key change
occurs at the same moment as a transposition change. Currently this
triggers a warning and the output is only correct depending on whether the
key change or transposition is written first. Not sure how to approach
solving that.

Saul


auto-transpose.ily
Description: Binary data


Re: irrational meters

2023-01-17 Thread Saul Tobin
Doesn't "Night Fantasies" by Elliott Carter use an extremely obscure
structural polyrhythm? Not an actual irrational meter but similar idea.

On Tue, Jan 17, 2023 at 4:47 PM H. S. Teoh via LilyPond user discussion <
lilypond-user@gnu.org> wrote:

> On Tue, Jan 17, 2023 at 07:08:41PM -0500, David Zelinsky wrote:
> > Kieren MacMillan  writes:
> >
> > > Hi Silvain,
> > >
> > >> I wonder about the term “irrational” meter. Should not we say
> > >> “irregular” ??  as in mathematics, an irrational number is a number
> > >> which cannot be represented as a fraction...
> > >
> > > As both a published composer *and* a published number theorist, I
> > > wholeheartedly concur with your intuition — I’ve been pushing for
> > > decades against “irrational” as a descriptor for time signatures
> > > [except where it actually applies, of course, as in π/4].
> > >
> > > “Irregular” is better… but ultimately I prefer “non-dyadic” to
> > > describe any time signature where the bottom number (a.k.a.
> > > “denominator”, a label I also avoid) is not an integer power of 2.
> [...]
> > As another professional number theorist and musician (though not a
> > composer), I also find this use of "irrational" to mean "non-dyadic"
> > very grating.  But I once said as much on the Music Engraving Tips
> > facebook group, and got summarily shot down as ignorant and elitist.
> > The argument, such as it was, held that this is about *music*, not
> > *mathematics*, so there's no reason to adopt mathematicians' quirky
> > terminology.  This left me rather speechless, so I gave up.  However,
> > if I ever have reason to discuss this type of meter, will always call
> > it "non-dyadic".
> [...]
>
> This is off-topic, but it would be interesting if somebody composed a
> piece with an actually irrational meter, like π/4 or 3/π.  Only thing
> is, it would be impossible for human performers to play correctly, since
> there isn't any way to count the beats correctly (counting beats implies
> a rational fraction, since by definition it's impossible to count up to
> an irrational ratio by counting finite parts).
>
> But perhaps a more practicable approach is to use an irrational fraction
> as an endless source of diverse beat divisions that has no long-term
> patterns (because another property of an irrational number is that its
> base-n expansion does not produce a repeating sequence).  For example,
> one could take the digits of π (in whatever base one fancies) and use
> that as the number of beats to divide each bar into. In base 10, the
> first bar would be 3/4, the second bar 1/4, the third 4/4, then 1/4,
> then 5/4, etc..  Or, if one wishes, use pairs of digits for time
> signatures: 3/1, 4/1, 5/9, ... etc.. It doesn't have to be base 10, of
> course. Base 12 would yield 3/1, 8/4, 8/0, and so on (not sure how to
> interpret 8/0, but I'm sure someone could come up with something).
>
>
> T
>
> --
> "The whole problem with the world is that fools and fanatics are always so
> certain of themselves, but wiser people so full of doubts." -- Bertrand
> Russell. "How come he didn't put 'I think' at the end of it?" -- Anonymous
>
>


Re: Help understanding event listeners

2023-01-17 Thread Saul Tobin
Yeah, I played around with it a bit more and discovered the same thing. So
the autoTransposeEngraver is listening to the event, and it's transposing
the pitch-alist, but the Key_engraver is still actually engraving the
untransposed version. A slightly different problem than what I initially
thought but I'm just as confused.

On Tue, Jan 17, 2023 at 1:15 PM Jean Abou Samra  wrote:

> Le 17/01/2023 à 10:10, Saul Tobin a écrit :
> > What I can't figure out is why when my autoKeysigEngraver broadcasts a
> > KeyChangeEvent, it gets picked up by the Key_engraver but not by the
> > autoTransposeEngraver.
>
> What do you mean? If I insert ly:message calls, I see the event from
> autoKeySigEngraver being listened by autoTransposeEngraver...
>
>
>


Help understanding event listeners

2023-01-17 Thread Saul Tobin
I've been tinkering with the auto-transpose engraver from OLL, trying to
automatically print key signatures if the transposition has been changed.
In the original code it looks like the plan was to have the engraver
broadcast a KeyChangeEvent, but when I tried that it ended up in an
infinite loop of KeyChangeEvents, since the same engraver was also
listening for them.

Attached is my attempt, splitting into two engravers. What I can't figure
out is why when my autoKeysigEngraver broadcasts a KeyChangeEvent, it gets
picked up by the Key_engraver but not by the autoTransposeEngraver. I'd
love some help understanding what's going on here.

Apologies for the messy testing code.

Thanks!


auto-transpose.ily
Description: Binary data


Re: Unicode accidentals vs. Markup accidentals

2023-01-15 Thread Saul Tobin
Lilypond ships with a text font as well as a music font. I agree that I
suspect that currently Lilypond's text font does not actually define these
Unicode music characters, so it falls back on the OS to find them. Why not
just add copies of Emmentaler glyphs to the Lilypond text fonts for
characters within the Unicode spec? That seems like a pretty reasonable
suggestion to me...

I also don't think it's unreasonable to suggest that the default typography
should look good. I hope we can agree that the output on staves 1 & 2 is
significantly worse than the output on staff 3 (attached picture if it
doesn't display inline for you).
[image: image.png]
Staves 1&2 are Unicode and default markup glyphs as in my original post
(compiled on Windows). To get staff 3 the following is required:

\new Staff {
c'1^\markup\concat\vcenter { B \hspace #0.2 \fontsize #-1.5 \flat }
c'1^\markup\concat\vcenter { C \hspace #0.1 \fontsize #-2 \sharp }
c'1^\markup\concat\vcenter { D \hspace #0.2 \fontsize #-1.5 \natural }
  }

IMO Staff 3 should be the default output, not something that requires so
much tweaking.

On Sun, Jan 15, 2023 at 9:56 PM Werner LEMBERG  wrote:

>
> > IMO Lilypond should render musical Unicode characters using the same
> > font as the music itself,
>
> No, it should not.  If you select font 'foo' for text rendering,
> everything should come from that font.  If a certain character is not
> in 'foo', it is the FontConfig library rather than LilyPond that
> selects a fallback font – and it is more or less unpredictable which
> fallback is actually used due to the way how FontConfig works.  If you
> want LilyPond glyphs you have to explicitly select them.
>
> In general, I strongly suggest that you *always* select the correct
> font for text rendering to assure that your document stays portable
> and can be reliably compiled on other systems.
>
> > and the default size/alignment of the glyphs within text markup
> > should not require adjustment to look correct.
>
> How do you want to adjust the size in an automated way?  Just think of
> using Times New Roman together with Courier, as shown in the image –
> what size should the LilyPond glyphs have?  And the default
> positioning is not too bad, as demonstrated in the other image.
>
> ```
> \markup { "foo" \number "♭♯♮" "bar" }
> ```
>
>
> Werner
>


Re: Unicode accidentals vs. Markup accidentals

2023-01-15 Thread Saul Tobin
IMO Lilypond should render musical Unicode characters using the same font
as the music itself, and the default size/alignment of the glyphs within
text markup should not require adjustment to look correct.

On Sun, Jan 15, 2023 at 4:07 AM William Rehwinkel <
will...@williamrehwinkel.net> wrote:

> Dear Saul,
>
> I don't see why this would be surprising... as you said it's the
> difference of using the unicode symbol from the text font (such as
> unicode symbol https://www.compart.com/en/unicode/U+266D for a flat) for
> an accidental and pasting in the lilypond musical font symbol for that
> accidental. You can prove this by loading a different font either for
> the serif font or musical glyph font. (Sorry for probably using wrong
> terminology here)
>
> In my opinion using the lilypond font accidental in a markup block is
> probably intended for other use cases, such as putting an editorial
> accidental above or below a note instead of in its usual place.
>
> As for how it looks, I suppose that is a matter of taste. But I would
> probably use the unicode accidental symbols if the need for writing an
> accidental in a piece of text came up in the future. You could
> definitely make the text using lilypond accidentals look right by
> changing the font size of either the text or the accidental, it's just a
> matter of the size and alignment.
>
> -William
>
> On 1/15/23 01:05, Saul Tobin wrote:
> > Surprisingly, typing the Unicode characters for accidental symbols does
> > not produce the same font output as using the markup commands:
> >
> > <<
> >\new Staff {
> >  c'1^"B♭"
> >  c'1^"C♯"
> >  c'1^"D♮"
> >}
> >\new Staff {
> >  c'1^\markup { B \flat }
> >  c'1^\markup { C \sharp }
> >  c'1^\markup { D \natural }
> >}
> >  >>
> >
> > And neither looks particularly great IMO.
>
> --
> + -- +
> |William Rehwinkel - Oberlin College and |
> |   Conservatory '24 |
> |  will...@williamrehwinkel.net  |
> | PGP key:   |
> | https://williamrehwinkel.net/static/pubkey.txt |
> + -- +
>


Unicode accidentals vs. Markup accidentals

2023-01-14 Thread Saul Tobin
Surprisingly, typing the Unicode characters for accidental symbols does not
produce the same font output as using the markup commands:

<<
  \new Staff {
c'1^"B♭"
c'1^"C♯"
c'1^"D♮"
  }
  \new Staff {
c'1^\markup { B \flat }
c'1^\markup { C \sharp }
c'1^\markup { D \natural }
  }
>>

And neither looks particularly great IMO.


Re: Removing staves when using remove-layer

2023-01-09 Thread Saul Tobin
I answered my own question: create an invisible context with remove-layer =
3. For anyone curious:

\version "2.24.0"

\layout {
  \context {
\name "NullStaff"
\type "Engraver_group"
\consists Axis_group_engraver
\override VerticalAxisGroup.staff-affinity = #DOWN
  }
  \context {
\Score
\accepts NullStaff
  }
  \context {
\StaffGroup
\consists Keep_alive_together_engraver
  }
}

restsAlive = #'(stem-interface
note-head-interface
rest-interface
)

I = {
  \tag #'individual \unset Staff.keepAliveInterfaces
  e'1
  \break
  \tag #'individual \set Staff.keepAliveInterfaces = #'()
  e'1
  \break
  R1^"show rests in the combined staff for normal systems"
  \tag #'combined \set Staff.keepAliveInterfaces = #'()
  % When rests are set to "worth living" don't put these changes on the
system break
  % This is due to a bug when an MMR is before or after the break
  R1
  \break
  R1
  \break
  R1
  \tag #'combined \set Staff.keepAliveInterfaces = \restsAlive
  R1
}

II = {
  c'1
  c'1
  R1
  R1*2
  R1*2
}

<<
  \new Staff { g'1 g'1 g'1 g'1 g'1^"hide the combined staff for crowded
systems" g'1 g'1 }
  \new StaffGroup <<
\new NullStaff \with {
  \override VerticalAxisGroup.remove-layer = 3
} { s1*5 }
 \new Staff = "1+2" \with {
   instrumentName = "1 2"
   shortInstrumentName = "1 2"
   \override VerticalAxisGroup.remove-empty = ##t
   \override VerticalAxisGroup.remove-first = ##t
   \override VerticalAxisGroup.remove-layer = 2
   keepAliveInterfaces = \restsAlive
 } \removeWithTag #'individual << \partCombine \I \II >>
 \new Staff = "1" \with {
   instrumentName = "1"
   shortInstrumentName = "1"
   \override VerticalAxisGroup.remove-empty = ##t
   \override VerticalAxisGroup.remove-first = ##t
   \override VerticalAxisGroup.remove-layer = 1
   keepAliveInterfaces = #'()
 } \removeWithTag #'combined \I
 \new Staff = "2" \with {
   instrumentName = "2"
   shortInstrumentName = "2"
   \override VerticalAxisGroup.remove-empty = ##t
   \override VerticalAxisGroup.remove-first = ##t
   \override VerticalAxisGroup.remove-layer = 1
   keepAliveInterfaces = #'()
 } \removeWithTag #'combined \II
   >>
 \new Staff { \clef bass c1 c1 c1 c1 c1 c1 c1 }
>>

On Sun, Jan 8, 2023 at 5:13 PM Saul Tobin 
wrote:

> Hi all,
>
> When condensing staves using remove-layer as described here
> https://lilypond.org/doc/v2.24/Documentation/notation/modifying-single-staves#hiding-staves,
> what is the best way to temporarily hide the combined staff as well as the
> individual staves? E.g. for a particularly crowded system where both
> players have rests.
>
> Thanks for your help,
>
> Saul
>


Removing staves when using remove-layer

2023-01-08 Thread Saul Tobin
Hi all,

When condensing staves using remove-layer as described here
https://lilypond.org/doc/v2.24/Documentation/notation/modifying-single-staves#hiding-staves,
what is the best way to temporarily hide the combined staff as well as the
individual staves? E.g. for a particularly crowded system where both
players have rests.

Thanks for your help,

Saul


Re: ANN: Spontini-Editor 1.0 released

2021-10-20 Thread Saul Tobin
Got it, thanks.

This particular project is quite large and can't be updated past 2.18 due
to a change in the behavior of staff changing during part combining, which
breaks the method I use for managing wind staves. I'm not aware of a way to
accomplish comparable functionality in 2.19 or newer. I spent a few months
a couple years ago trying to write a patch but I eventually gave up.

On Tue, Oct 19, 2021, 12:15 AM Paolo Prete  wrote:

> Hello Valentin,
>
> porting the scheme/LilyPond functions used by Spontini-Editor, in its
> internal library, from 2.18 to 2.19, would not complete the compatibility.
> In fact, the editor relies on the SVG code generation too, which had
> changes during these years of LilyPond development.
> Therefore, the only way that Saul could use to accomplish what he asked,
> is to convert his score from 2.18 to >=2.19.84 and then feed
> Spontini-Editor with the converted score.
>
>
> Best,
> P
>
>
>
> On Tuesday, October 19, 2021, Valentin Petzel  wrote:
>
>> Hello Saul,
>>
>> in many cases a 2.23 ly file will be compatible with a 2.18 Lilypond.
>>
>> The only problematic cases should be when Spontini uses overrides that
>> did not exist in 2.18 (which shouldn't be that many) or if you are using
>> music function that have changes names or syntax, which can also be amended
>> by renaming the new ones to old ones or creating wrapper music functions,
>> so you can have a few definitions that can simply be removed for 2.18.
>>
>> But is there any reason for using such an old Lilypond version?
>>
>> Cheers,
>> Valentin
>>
>> 19.10.2021 01:39:59 Saul Tobin :
>>
>> > Any possibility of using this with a Lilypond 2.18 project?
>> >
>>
>>


Re: ANN: Spontini-Editor 1.0 released

2021-10-18 Thread Saul Tobin
Any possibility of using this with a Lilypond 2.18 project?

On Sun, Oct 17, 2021 at 6:21 PM Jon Arnold 
wrote:

> Looks promising. The ability to edit slurs with a mouse is huge.
>
> On Sun, Oct 17, 2021 at 2:07 PM Paolo Prete  wrote:
>
>> Hello all,
>>
>> I just drafted a new release (1.0) of Spontini-Editor, which is now
>> compatible with LilyPond 2.23.0 to 4
>>
>> https://github.com/paopre/Spontini
>>
>> Furthermore, it offers a tool that allows you to include or exclude
>> blocks from the building process of the score.
>>
>> I encourage the use of the editor, which I could test intensively,
>> because it is essentially bug-free, it works perfectly on a Raspberry PI
>> (or any similar cheap hw) and it allows you to create *very complex* piano
>> scores.
>>
>> Any feedback is greatly appreciated!
>>
>> HTH
>> P.
>>
>


How to use shapeII in 2.18 on Windows 10?

2020-02-15 Thread Saul Tobin
I want to try using shapeII in one of my projects, so I cloned the repo
into my Lilypond include folder. The usage guide requires OpenLilyLib Core
to use modules, which I've never tried before. So I cloned oll-core and
followed the documented folder structure.

Then when I try to compile the shapeII usage example, first it tells me
that 2.19.22 is required — presumably for oll-core. That's a problem for me
because my project is 2.18 and cannot be upgraded due to breaking changes.
But shapeII itself is apparently 2.18 compatible, so what am I supposed to
do here?

But even when I switch to 2.19.82 just to compile the usage example, it
tells me:

:1:10 <0>: error: cannot find file: `oll-core/internal/os-path.ily'

(search path: `C:/Program Files
(x86)/LilyPond/2.19.82/usr/share/lilypond/current/fonts/svg/;C:/Program
Files
(x86)/LilyPond/2.19.82/usr/share/lilypond/current/fonts/type1/;C:/Program
Files
(x86)/LilyPond/2.19.82/usr/share/lilypond/current/fonts/otf/;C:/Program
Files (x86)/LilyPond/2.19.82/usr/share/lilypond/current/scm;C:/Program
Files (x86)/LilyPond/2.19.82/usr/share/lilypond/current/ps;C:/Program Files
(x86)/LilyPond/2.19.82/usr/share/lilypond/current/ly;C:/Users/Saul
Tobin/.lily;')

\include

"oll-core/internal/os-path.ily"

C:/Users/Saul Tobin/.lily/openlilylib/oll-core/package.ily:57:2 <1>: error:
GUILE signaled an error for the expression beginning here

#

(if (not (defined? 'openlilylib-root))


A quick search showed me a previous thread in which a user apparently tried
and never succeeded in getting oll-core to work on Windows 10.


Can anyone shed some light on how to do this? All I want to do is include a
snippet. Even if I'm just copy and pasting, I'm fine with it, but from what
I can tell the module structure introduces complicated dependencies between
files so I can't even do that. I thought modules were supposed to make
things easier.


Thanks,


Saul


Re: Running LilyPond on Amazon Linux 2

2020-01-14 Thread Saul Tobin
I'm curious to know about your use case/workflow for running Lilypond in
AWS Lambda. Seems interesting.

Saul

On Tue, Jan 14, 2020, 6:34 AM Peter Anglea  wrote:

> I think I got it fixed… recording this here for anyone else who stumbles
> upon the same issue as I did.
>
> I downloaded an RPM containing libcrypt.so.1, extracted the file, and put
> it inside LilyPond’s /usr/lib/ directory. I made sure to include the
> LilyPond directory as part of the include path for my function. Probably
> not the best long-term fix… if I update LilyPond in the future, I’ll need
> to remember to re-add libcrypt... but for now it works and my testing has
> generated scores without issue.
>
> It should be noted that I am not a Linux pro, and am a little out of my
> depth on this one. So if there’s a more obvious fix, I’d love to hear about
> it.
>
> > On Jan 11, 2020, at 12:07 PM, Peter Anglea 
> wrote:
> >
> > I’ve been running LilyPond on AWS Lambda for some time now, but recently
> have been forced to upgrade my runtime from Node 8.x to Node 12.x due to
> Node 8.x becoming deprecated. However, in my testing, LilyPond does not
> work in either the Node 10.x or Node 12.x runtimes. I get the following
> error:
> >
> > lilypond: error while loading shared libraries: libcrypt.so.1: cannot
> open shared object file: No such file or directory
> >
> > Note: I have been using the binary for GNU/Linux 64: LilyPond 2.19.83-1
> >
> > From what I can tell, the difference is that AWS Lambda’s Node 12.x
> runtime uses the “Amazon Linux 2” distro instead of regular “Amazon Linux”
> distro used with the Node 8.x runtime. Also, my research seems to indicate
> the error is related to Amazon Linux 2 using a different version of openssl
> from before… but that’s about the limit of what I understand.
> >
> > Is anyone else successfully running LilyPond on AWS Lambda Node 12.x? Is
> there another binary better suited to that particular distro? Any other
> suggestions for overcoming the error message above?
> >
> > Thanks in advance for any help. I’m kinda stuck here, but this mailing
> list has proven helpful many times, so… fingers crossed! :)
>
>
>


Lilypond/Frescobaldi on Catalina using Docker

2019-12-27 Thread Saul Tobin
Hi all,

I've come to the conclusion that the best workaround for the lack of 64-bit
builds on Mac and Windows is to run Lilypond in a Docker container. Based
on the number of Lilypond images on Docker Hub, it would seem I'm fairly
late to this party, though if it's been discussed on the user mailing list,
I missed it.

Based on the helpful guide here
https://kylebaldw.in/posts/2019/running-lilypond-on-catalina/, I have
64-bit Lilypond working from Frescobaldi on MacOS Catalina. You can get my
scripts and Dockerfiles on Github:
https://github.com/shevvek/lilypond-docker. The images themselves are on
Docker Hub.

When I have a chance, my thought is that the same principle should also
work on Windows with suitable batch files.

I hope that official 64-bit builds for both stable and development will
become available for all platforms, but in the meantime hopefully others
will find this Docker approach helpful.

Happy holidays,

Saul


2.18 for Catalina?

2019-12-25 Thread Saul Tobin
Hi all and happy holidays

What is currently the easiest way to get a working install of Lilypond 2.18
on Catalina? I have old projects that require 2.18 and will not work on
2.19. Ideally, I'd like to have control over the install directory, since I
typically have multiple Lilypond versions coexisting.

Thanks,

Saul


Re: LSR management

2019-11-16 Thread Saul Tobin
Could LSR be functionally mirrored as a GitHub repo?

On Sat, Nov 16, 2019, 5:17 PM Andrew Bernard 
wrote:

> It may not be a good thing that nobody seems to know who runs and
> manages LSR. Should we devote any time to making this a more robust
> situation. given how much people refer to it, and what a valuable
> resource it is?
>
> Andrew
>
>


Re: flats and sharps as symbols in a lyric text

2019-11-06 Thread Saul Tobin
I haven't run into font limitations with Unicode accidentals. I use Compose
Key to make it easy to type them.

Saul

On Wed, Nov 6, 2019 at 12:22 AM Karsten Reincke  wrote:

> Thanks for your comments and discussion. Very helpful!
> @saul: Sorry, for this silly additional question: How do I insert a unicode
> character (for example U+266D) in a lyric text, if I do not have a
> corresponding
> font etc? Do you have eny example?
>
> many thanks, again
> Karsten
>
> On Tue, 2019-11-05 at 15:53 -0800, Saul Tobin wrote:
> > I usually just type the accidental signs as Unicode characters. I find
> the
> > sizing and alignment works better than with the Lilypond markup commands.
> >
> > On Tue, Nov 5, 2019, 3:32 PM Karsten Reincke 
> wrote:
> > > Dear friends;
> > >
> > > does anyone know how I could insert a (double) flat or a (double)
> sharp in a
> > > lyric
> > > text (or stanza or anywhe else) to comment a chord representation?
> > >
> > > Many thanks for your help
> > > Karsten
> > >
> > >
> --
>   Karsten Reincke/\/\   (+49|0) 170 / 927 78 57
>  Im Braungeröll 31   >oo<  mailto:k.rein...@fodina.de
> 60431 Frankfurt a.M.  \/http://www.fodina.de/kr/
>
>
>


Re: flats and sharps as symbols in a lyric text

2019-11-05 Thread Saul Tobin
On Tue, Nov 5, 2019, 5:08 PM Andrew Bernard 
wrote:

> HI Saul,
>
> What is correct? I believe this is a highly subjective matter.
>
> Andrew
>

Sure, agreed. But the default should at least be reasonable without
tweaking, right?

>
>
> On Wed, 6 Nov 2019 at 11:15, Saul Tobin 
> wrote:
>
>> It bugs me a bit that macros are needed to tweak the spacing of
>> accidental symbols in markup. Shouldn't the default markup commands for
>> accidental symbols have correct size and spacing?
>>
>>


Re: flats and sharps as symbols in a lyric text

2019-11-05 Thread Saul Tobin
The breaking-ness seems like an obstacle.

On Tue, Nov 5, 2019, 5:05 PM Kieren MacMillan 
wrote:

> Hi Saul,
>
> > It bugs me a bit that macros are needed to tweak the spacing of
> accidental symbols in markup. Shouldn't the default markup commands for
> accidental symbols have correct size and spacing?
>
> That would be easy to fix in the distro, if you wanted to submit a patch…
> but it would screw up a lot of existing scores.  =(
>
> Since the macros only have to be defined once — in a file I \include into
> all my scores by default — I don’t find it that cumbersome or bothersome.
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>


Re: flats and sharps as symbols in a lyric text

2019-11-05 Thread Saul Tobin
It bugs me a bit that macros are needed to tweak the spacing of accidental
symbols in markup. Shouldn't the default markup commands for accidental
symbols have correct size and spacing?

On Tue, Nov 5, 2019 at 4:02 PM Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Saul (et al.),
>
> > I usually just type the accidental signs as Unicode characters. I find
> the sizing and alignment works better than with the Lilypond markup
> commands.
>
> Personally, I find the Unicode symbols unattractive, so I prefer to use
> Lilypond. Sizing and alignment are easily tweaked by predefining macros:
>
> \version "2.19.83"
>
> textFlat = \markup \raise #0.4 \fontsize #-2 { \hspace #0.0875 \flat }
> textNatural = \markup \raise #0.625 \fontsize #-2 { \hspace #0.175
> \natural }
> textSharp = \markup \raise #0.75 \fontsize #-2 { \hspace #0.1 \sharp }
>
> \markup \concat { B \textFlat " is one semitone below " B \textNatural ",
> and two semitones below " B \textSharp }
>
> Hope that helps!
> Kieren.
> 
>
> Kieren MacMillan, composer (he/him/his)
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>


Re: flats and sharps as symbols in a lyric text

2019-11-05 Thread Saul Tobin
I usually just type the accidental signs as Unicode characters. I find the
sizing and alignment works better than with the Lilypond markup commands.

On Tue, Nov 5, 2019, 3:32 PM Karsten Reincke  wrote:

> Dear friends;
>
> does anyone know how I could insert a (double) flat or a (double) sharp in
> a lyric
> text (or stanza or anywhe else) to comment a chord representation?
>
> Many thanks for your help
> Karsten
>
>
> --
>   Karsten Reincke/\/\   (+49|0) 170 / 927 78 57
>  Im Braungeröll 31   >oo<  mailto:k.rein...@fodina.de
> 60431 Frankfurt a.M.  \/http://www.fodina.de/kr/
>
>
>
>


Re: Frescobaldi, improve support for audio export

2019-10-21 Thread Saul Tobin
Would the bundled VLC be redundant to an existing system install of VLC?
Would it be usable instead of a system install? Would the bundled VLC get
updates?

I normally have VLC installed anyway, but I'd rather not have to keep a
separate copy on disk just for Frescobaldi.


On Sun, Oct 20, 2019, 10:33 PM Federico Bruni  wrote:

> Il giorno ven 18 ott 2019 alle 23:14, J Martin Rushton via
> lilypond-user  ha scritto:
> > There is a VLC available through flatpack, but I've not used it (so
> > therefore cannot comment), but have seen warnings that it will pull in
> > up to 1.2 GiB of other packages including the complete KDE
> > implementation.
>
> $ flatpak info org.videolan.VLC | grep 'Installed'
>Installed: 77,7 MB
>
> $ flatpak info org.kde.Platform//5.13 | grep Installed
>Installed: 910,3 MB
>
> The KDE runtime may be used by other Qt applications installed in your
> system.
>
> You may want to read this post by the author of Flatpak:
>
> https://blogs.gnome.org/alexl/2017/10/02/on-application-sizes-and-bloat-in-flatpak/
>
> In a nutshell: Flatpak is a bundling system and as such it requires
> more disk space, but the benefits (of shipping a self-contained and
> independent application) may offset the cost for some people,
> especially today (as large disks are smaller and cheaper). The article
> explains how ostree helps in reducing the duplication between similar
> runtimes.
>
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Frescobaldi, improve support for audio export

2019-10-17 Thread Saul Tobin
On Thu, Oct 17, 2019 at 3:20 PM Urs Liska  wrote:

> 17. Oktober 2019 22:19, "Saul Tobin"  schrieb:
>
> > The biggest killer-feature for me would be the ability to playback
> multiple midi files
> > simultaneously in sync (to work around the 16 track limitation).
>
> Sounds cool, but that's obviously not on the table. I think this is the
> domain of DAWs.
>

Totally understand it's not on the table or what you're working on. I don't
agree it's the domain of DAWs, however. I'm not talking about high quality
tweakable MIDI sequencing. Literally just a quick and dirty preview, like
starting multiple instances of pmidi at the same time.

>
> >
> > Audio format-wise, I think mp3 is fine. I doubt anyone particularly
> cares about lossless quality
> > for their general midi soundfont playback.
>
> Fair point. But two comments:
> - To get mp3 the MIDI is first converted to a lossless format anyway.
> - I think many people who want audio files want them to *share* them,
> either on some sort of sharing platform or to hand them over to some
> partner for whatever purpose. And for that there may be specific
> requirements.
>
> But your comment reinforces my gut-feeling that the proper approach is not
> to provide too many formats but rather a nice, well-defined selection.
>
> Urs
>
> >
> > On Thu, Oct 17, 2019, 10:34 AM Guy Stalnaker 
> wrote:
> >
> >> Urs,
> >>
> >> I'm thinking you mean here "Frescobaldi on Linux" right (since you also
> >> say fluidsynth)? I use Frescobaldi primarily on Windows. And though one
> >> can use Cygwin, etc. to install an app like timidity, Frescobaldi does
> >> not "see" it. But I can, and to, have lame installed because I can use
> >> VirtualMidiSyth to manually convert midi to mp3.
> >>
> >> Just putting this out there so you know.
> >>
> >> Regards!
> >>
> >> On 10/17/2019 9:19 AM, Urs Liska wrote:
> >>> Hi all,
> >>>
> >>> I've just started looking into how Frescobaldi provides support for
> >>> "exporting" scores to audio.
> >>>
> >>> Until now this was hardcoded to use TiMidity (and had to be activated
> as
> >>> "experimental feature").
> >>>
> >>> I have so far created functionality that
> >>>
> >>> * checks whether timidity, fluidsynth and lame are available
> >>> * populates the filter of the file dialog with all registered file
> >>> formats for the available converters (=> if (and only if) Lame is
> >>> installed the .mp3 filter will be added). You can see a screenshot
> >>> at
> >>>
> https://github.com/frescobaldi/frescobaldi/pull/1205#issuecomment-543155209
> >>>
> >>> After clicking the Save button there will be a configuration dialog
> like
> >>> we already have for the file *import* functionality. Depending on the
> >>> chosen converter/exporter tool it will be possible to configure
> selected
> >>> settings like for example audio quality, alternative soundfont (in
> >>> fluidsynth), effects.
> >>>
> >>> However, since that's not my area of expertise I'd like to ask for
> >>> suggestions (possibly with the corresponding command line invocations)
> about
> >>>
> >>> * which audio formats Frescobaldi should support (I don't think it's
> >>> good to clutter the interface with stuff that noone needs)
> >>> * which options we should make configurable for the three converter
> tools
> >>> * if there are other converters we should consider supporting
> >>>
> >>> Best
> >>> Urs
> >>>
> >>>
> >>> ___
> >>> lilypond-user mailing list
> >>> lilypond-user@gnu.org
> >>> https://lists.gnu.org/mailman/listinfo/lilypond-user
> >>>
> >>
> >> --
> >> “Happiness is the meaning and the purpose of life, the whole aim and end
> >> of human existence.”
> >> ― Aristotle
> >>
> >> ___
> >> lilypond-user mailing list
> >> lilypond-user@gnu.org
> >> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Frescobaldi, improve support for audio export

2019-10-17 Thread Saul Tobin
The biggest killer-feature for me would be the ability to playback multiple
midi files simultaneously in sync (to work around the 16 track limitation).

Audio format-wise, I think mp3 is fine. I doubt anyone particularly cares
about lossless quality for their general midi soundfont playback.

On Thu, Oct 17, 2019, 10:34 AM Guy Stalnaker  wrote:

> Urs,
>
> I'm thinking you mean here "Frescobaldi on Linux" right (since you also
> say fluidsynth)? I use Frescobaldi primarily on Windows. And though one
> can use Cygwin, etc. to install an app like timidity, Frescobaldi does
> not "see" it. But I can, and to, have lame installed because I can use
> VirtualMidiSyth to manually convert midi to mp3.
>
> Just putting this out there so you know.
>
> Regards!
>
> On 10/17/2019 9:19 AM, Urs Liska wrote:
> > Hi all,
> >
> > I've just started looking into how Frescobaldi provides support for
> > "exporting" scores to audio.
> >
> > Until now this was hardcoded to use TiMidity (and had to be activated as
> > "experimental feature").
> >
> > I have so far created functionality that
> >
> >   * checks whether timidity, fluidsynth and lame are available
> >   * populates the filter of the file dialog with all registered file
> > formats for the available converters (=> if (and only if) Lame is
> > installed the .mp3 filter will be added). You can see a screenshot
> > at
> >
> https://github.com/frescobaldi/frescobaldi/pull/1205#issuecomment-543155209
> >
> > After clicking the Save button there will be a configuration dialog like
> > we already have for the file *import* functionality. Depending on the
> > chosen converter/exporter tool it will be possible to configure selected
> > settings like for example audio quality, alternative soundfont (in
> > fluidsynth), effects.
> >
> > However, since that's not my area of expertise I'd like to ask for
> > suggestions (possibly with the corresponding command line invocations)
> about
> >
> >   * which audio formats Frescobaldi should support (I don't think it's
> > good to clutter the interface with stuff that noone needs)
> >   * which options we should make configurable for the three converter
> tools
> >   * if there are other converters we should consider supporting
> >
> > Best
> > Urs
> >
> >
> > ___
> > lilypond-user mailing list
> > lilypond-user@gnu.org
> > https://lists.gnu.org/mailman/listinfo/lilypond-user
> >
>
> --
> “Happiness is the meaning and the purpose of life, the whole aim and end
> of human existence.”
> ― Aristotle
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \transposedQuoteDuring

2019-05-01 Thread Saul Tobin
I usually use \ottava and \omit the OttavaBracket.

On Wed, May 1, 2019, 6:54 AM Pierre-Luc Gauthier 
wrote:

> Hi there,
>
> Is there a way to transpose a quotation, say, an octave higher ?
>
> m.e.g.:
>
> \version "2.19.83"
>
> quoted = {c'4 d' e' f' g'}
> \addQuote "quoted" \quoted
>
> quoting = \quoteDuring "quoted" {s1}
>
> \new Staff \with {instrumentName = "Quoted"} \quoted
> \new Staff \with {instrumentName = "Quoting"} \quoting
>
> …
>
> \addQuote "quoted" \transpose c' c'' \quoted
> Is unacceptable because it would transpose all the quotations.
>
> This :
> \transposedQuoteDuring "quotedMusic" c'' { s1| }
> would have been perfect but this command does not exist.
>
> And :
> quoting = \quoteDuring "quoted" \transpose c' c'' {s1}
> does not work.
>
> Any hints?
> Thanks for any pointers.
> --
> Pierre-Luc Gauthier
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Automatic beaming with rest

2019-04-02 Thread Saul Tobin
I agree with this, but I can imagine the following distinct engraving
styles:

1. Beam over rests only when the beam both begins and ends with a note.
2. Also beam over initial rests.
3. Also beam over final rests.

Further, I can imagine wanting e.g. c16[ r c r], rather than c16[ r c] r,
but in the same piece preferring c8 r rather than c8[ r] at the end of a
phrase.

There would need to be a convenient way of cancelling beam over rest. What
is the opposite of c8[ r c]?

Saul

On Tue, Apr 2, 2019, 2:03 PM Flaming Hakama by Elaine <
ela...@flaminghakama.com> wrote:

>
> -- Forwarded message --
>> From: David Kastrup 
>> To: Kieren MacMillan 
>> Cc: foxfanfare , Lilypond-User Mailing List <
>> lilypond-user@gnu.org>
>> Bcc:
>> Date: Tue, 02 Apr 2019 17:33:07 +0200
>> Subject: Re: Automatic beaming with rest
>> Kieren MacMillan  writes:
>>
>> > p.s.
>> >
>> > Before you ask: Yes, it would be great to include the option/parameter
>> > to extend across *all* rests that fall within the "beat" as defined
>> > for the beam,
>>
>> What is the "beat" as defined for the beam?
>>
>> > even if they fall outside the compass of the two "boundary notes" for
>> > the auto beam.
>>
>> --
>> David Kastrup
>>
>
> I would love to have this type of option, since I often do beaming for
> certain complex rhythms.
> My suggestion would be to have a configuration option for "beam the beat":
>
> * If the beat has no notes, and only rests, there is no beam
> * If the beat has exactly one note, and no rests, then there is no beam
> * If the beat has at least one actual note, and additionally either at
> least one more note, or at least one rest, then beam over all notes/rests
> in that beat.
>
>
> While I personally hate stemlets, in the interest in accommodating others
> who do, it might be good to have another option that determines whether
> there should be stemlets.  With the default being no stemlets.
>
>
> Thanks,
>
> Elaine Alt
> 415 . 341 .4954   "*Confusion is
> highly underrated*"
> ela...@flaminghakama.com
> Producer ~ Composer ~ Instrumentalist ~ Educator
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Guile for building lilypond on Ubuntu18.10

2019-03-22 Thread Saul Tobin
My WSL runs Ubuntu, so I would have guessed the guile install directory is
the same. Either way, sorry for posting information that might be useful to
others reading the mailing list.

On Fri, Mar 22, 2019 at 6:57 PM Andrew Bernard 
wrote:

> Hi Saul,
>
> I am only referring to Ubuntu. This is not meant to be a general guide for
> all systems.
>
> Funny, when I wrote the notes on getting point and click working with gvim
> under Ubuntu 18.10 specifically, everybody immediately wanted to correct it
> for a dozen other platforms. Amusing in a way.
>
> Andrew
>
>
> On Sat, 23 Mar 2019 at 12:36, Saul Tobin 
> wrote:
>
>> I followed the process described above to compile Guile 1.8 and Lilypond
>> on Windows Subsystem for Linux. I found that it only worked when installing
>> guile to /usr, not /usr/local.
>>
>> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Guile for building lilypond on Ubuntu18.10

2019-03-22 Thread Saul Tobin
I followed the process described above to compile Guile 1.8 and Lilypond on
Windows Subsystem for Linux. I found that it only worked when installing
guile to /usr, not /usr/local.

Saul

On Fri, Mar 22, 2019, 6:24 PM David Wright 
wrote:

> On Sat 23 Mar 2019 at 11:12:29 (+1100), Andrew Bernard wrote:
> > Ubuntu now only supports guile 2 in its own repositories.
>
> AFAICT Debian stretch has the same limitation, but the lilypond
> package has guile-1.8 and its libs bundled within.
> Each of the lilypond.org versions also has guile included.
> Their identically named files have different dates and sizes.
>
> > How does on obtain the guile 1.8 needed to build lilypond for Ubuntu
> 18.10?
> > Do we have to build from the source repository? If so, what exact
> release?
>
> Perhaps you could install guile and its libs yourself. I haven't
> checked whether /usr/local/… would suffice or if they have to be
> in the main library locations.
>
> Cheers,
> David.
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Markup wrap at the end of the line

2019-03-16 Thread Saul Tobin
I agree that when a long markup stretches the measure at the end of a line,
it suggests that there may be better ways of laying out the line breaks.

Perhaps there should be a penalty for stretched measures due to markup in
Lilypond's line breaking algorithm?

Saul

On Sat, Mar 16, 2019, 6:34 PM Andrew Bernard 
wrote:

> Hi edes,
>
> Well, if absolute line breaking is not important in your score, you could
> always put a break in front of the bar with the long text. In terms of
> engraving, which to me is all about clarity for musicians to read, you
> don't see many examples of this, as it is indeed hard to read a note then
> read the next line for rest of the directive and then start the next line.
> I'd be looking at better ways of laying out. Or you could perhaps just
> stack the long instruction vertically with several lines in a column. If
> you are doing this on a page break it would not be good, I think!
>
> Sorry, not the specific answer to your question.
>
> Andrew
>
>
> On Sun, 17 Mar 2019 at 03:04, edes  wrote:
>
>>
>> a related but different question: how can i make a markup wrap at the end
>> of the line?
>>
>> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Possible bug: MMRs and keepAliveInterfaces

2019-03-11 Thread Saul Tobin
If any of the interfaces for MultiMeasureRests (e.g. rest-interface,
spanner-interface, multi-measure-rest-interface) are included in
keepAliveInterfaces (useful if you want to condense some systems in a
score, but not others), then when an MMR occurs on either side of a system
break it can cause staves to be kept alive that otherwise should be removed
due to keepAliveInterfaces = #'().

\version "2.19.82"

\layout {
  \context {
\Score
keepAliveInterfaces = #'(stem-interface
 note-head-interface
 rest-interface
 )
  }
}

% Ex 1

\new Staff \with {
  \override VerticalAxisGroup.remove-empty = ##t
  \override VerticalAxisGroup.remove-first = ##t
} {
  R1
  \set Staff.keepAliveInterfaces = #'()
  \break
  c'1
}

% Ex 2

\new Staff \with {
  \override VerticalAxisGroup.remove-empty = ##t
  \override VerticalAxisGroup.remove-first = ##t
} {
  \set Staff.keepAliveInterfaces = #'()
  c'1
  \unset Staff.keepAliveInterfaces
  \break
  R1
}

Is this a bug? Am I missing something about the intended behavior of MMRs?
Ideas for workarounds or fixes?

Thanks!

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


lilypond.org error 500

2019-03-10 Thread Saul Tobin
Currently getting Internal Server Error 500 on Lilypond.org. Also looks
like the site is only on http, no https.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Reducing top margin for a single page in a score

2019-02-04 Thread Saul Tobin
The size reduction for a single system strategy is simple to do within a
single Lilypond score using \magnifyStaff and maybe a couple additional
overrides.

On Mon, Feb 4, 2019, 8:04 AM David Wright  On Mon 04 Feb 2019 at 16:40:57 (+1100), Andrew Bernard wrote:
> > I am doing a long string quartet. The full score sits nicely in the
> middle
> > of an A4 landscape page with a generous top margin. But there's a solo
> > viola part that's very dense and the staves fill out the whole page very
> > tightly right to the bottom, and it looks clumsy because there is lots of
> > space at the top margin not able to be utilised.
> >
> > Is it possible to alter the top margin for just a single page in the
> midst
> > of a score where it is otherwise OK?
>
> I hit a problem like this in one of the first scores I ever set in LP,
> where I had extra staves carrying repeated lyrics that just overwhelmed
> one page. I took the approach taken by Britten's War Requiem full score
> (but not as dramatic) and reduced the global-staff-size a little bit.
>
> As to how I managed that, I just ran the whole document in both sizes
> (the pagination happened not to be thrown off) and then spliced the
> page from one PDF to the other with pdftk. You could to the same thing
> using a second score with different margins. (You might need a couple of
> manual pageBreak insertions if the pagination slips.)
>
> Cheers,
> David.
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Order of process-music between Contexts

2019-01-28 Thread Saul Tobin
Hi all,

I'm trying to figure out the workings of engravers and contexts. Can anyone
point me to the relevant code, or better yet explain the order in which the
process-music step happens between engravers in child vs. parent contexts?
Is this set in stone, or can it be modified? Like, suppose I have a custom
Scheme engraver in a parent context, which uses process-music to set a
property that must then be read by an engraver in child context during its
own process-music. Is that possible to do? Or am I thinking about it
wrong/is there a better way to go about it?

I'd really appreciate some pointers here. Thanks!

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Dynamic next to espressivo

2019-01-23 Thread Saul Tobin
Below is the snippet I use for dynamics with expressive text. I believe
I've posted it to the mailing list before, a few years ago maybe.

\version "2.18.2"

dynText = #(define-event-function (parser location dyn expr) (markup?
markup?)
 (let* (
 (mark #{ \markup { \dynamic $dyn \normal-text\italic
$expr } #})
 (offset (lambda (grob)
   (let* (
   (layout (ly:grob-layout grob))
   (props (ly:grob-alist-chain grob
(ly:output-def-lookup
layout 'text-font-defaults)))
   (dyn-X-extent
(ly:stencil-extent

 (ly:text-interface::interpret-markup layout props dyn)
 X))
   (width (abs
   (- (cdr dyn-X-extent) (car
dyn-X-extent
   )
 (- 1 (/ width 2))
 )
   )
   )
 )
   #{
 \tweak DynamicText.X-offset #offset
 #(make-dynamic-script mark)
   #}
   )
 )

%% Example

% \paper {
%   ragged-right = ##f
%   indent = 0\cm
% }
%
% \new Staff \with {
%   \omit TimeSignature
% } \relative c' {
%   c1\dynText "p" "sub."
%   c1\dynText "fff" "espressivo"
%   c1\dynText "p" "espressivo"
%   c1\dynText "f" "sub."
%   \break
%   c1\p
%   c1\fff
%   c1\p
%   c1\f
% }
%

On Wed, Jan 23, 2019 at 4:17 AM Andrew Bernard 
wrote:

> Hi All,
>
> Now that we have a great espressivoII function, I want to put a dynamic
> next to the espressivo, on the left, at the same level. How do we do this?
>
> This is not specific to expressivo - how does one line up a dynamic and a
> script on the same horizontal level and snugged up to each other?
>
> \version "2.19.82"
> {
>   c''4_\p_\espressivo
> }
>
> Andrew
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Organization of the piese part by part, not staff by staff

2019-01-10 Thread Saul Tobin
Fundamentally, the data model of Lilypond is horizontal, even when you
delve into the guts of how the program works (iterators, streams,
engravers). My advice is to embrace that and adapt your workflow and
thinking to take advantage of Lilypond's strengths, rather than fighting
against it.

In my experience composing with Lilypond, dividing pieces into sections
like this leads to more pain later on if I decide I want something like an
overlapping hairpin between the sections. Yeah, it's a little annoying to
count bars in each part if I decide to add a measure or change a time
signature, but it's not that big a deal if you use barchecks and one
measure per line of code.

Having a single variable for the music for each part to be extracted makes
a lot of sense, since it keeps the composer in the mindset of what each
player will be seeing.

My two cents.

On Thu, Jan 10, 2019 at 4:03 PM Valentin Villenave 
wrote:

> On 1/10/19, Павел Буданов  wrote:
> > And I will add this music to score block:
> > \refren \bar "||" \episodeA \refren \episodeB
> > Is this case possible? If so, how to implement it correctly, where is the
> > documentation written about it?
>
> Greetings Pavel,
> at its heart, LilyPond very much encourages «horizontal thinking»:
> it’s easier to enter one melodic voice, then another, then another.
>
> However, there are a few ways to enter music section by section like
> what you’re looking for. The first one is to use \context Staff (which
> can re-use an existing Staff rather than create a \new one every
> time):
>
> %%%
>
> FirstSection = <<
>   \context Staff = "voice" \relative c' {
> c2 d e1
>   }
>   \context PianoStaff = "piano" <<
> \context Staff = "right" \relative c' {
>   2  1
> }
> \context Staff = "left" \relative c {
>   \clef bass
>   e2 b c1
> }
>   >>
> >>
>
> SecondSection = <<
>   \context Staff = "voice" \relative c' {
> a'2 f4 a g1
>   }
>   \context PianoStaff = "piano" <<
> \context Staff = "right" \relative c' {
>   2   q
> }
> \context Staff = "left" \relative c {
>   \clef bass
>   f,4 g a b c2 c
> }
>   >>
> >>
>
> \score {
>   {
> \FirstSection
> \bar "||"
> \SecondSection
>   }
> }
>
> %
>
> The second trick you may be interested in learning, is \parallelMusic
> (which allows you to enter polyphonic music with every voice at once).
> Have a look at this chapter:
>
> http://lilypond.org/doc/stable/Documentation/notation/multiple-voices#writing-music-in-parallel
>
> Good luck!
>
> V.
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Attempt at divisi automating engraver

2019-01-01 Thread Saul Tobin
Still working on this...

The new version attached sets make-dead-when so that staves with fewer
parts have priority over those that they can be merged into. (Disregard
what I wrote previously about remove-layers — I got a bit confused.) The
engraver now does mainly what it is supposed to, namely provide an
intuitive UI for condensing n-parts into shared staves.

Two issues currently, which I am not yet sure how to solve:

1) The engraver is not able to push a change to keepAliveInterfaces to a
context that does not already have an event at the current moment.

2) If the status of alive/hidden staves changes on the first moment of a
system, the status from the last moment of the previous system will still
apply.

Hopefully this is of interest to at least a few others.

>


divisi_engraver.ly
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Attempt at divisi automating engraver

2018-12-30 Thread Saul Tobin
(live-ctxs (if (pair? (car groups))
   (map
(lambda (k)
(assoc-get k all-staves))
groups)
   '()))
)
  ; Set keepAliveInterfaces = '() for all
staves
  (map (lambda (kv)
 (ly:context-set-property! (cdr kv)
   'keepAliveInterfaces '()))
all-staves)
  ; Set keepAliveInterfaces to the default
for just the staves
  ; Corresponding to the current part
combinations
  (map (lambda (ctx)
 (ly:context-unset-property ctx
'keepAliveInterfaces))
live-ctxs)

  ))
   )))

\paper {
  short-indent = 0.5\cm
}

\new StaffGroup \with {
  \consists \Staff_sharing_engraver
  combineWithNext = ##t
  \override VerticalAxisGroup.remove-empty = ##t
  \override VerticalAxisGroup.remove-first = ##t
} <<
\new Staff = "1+2" \with {
sharingParts = #'(1 2)
shortInstrumentName = "1 2"
keepAliveInterfaces = #'()
  } \repeat unfold 8 {
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "1+2+3" \with {
sharingParts = #'(1 2 3)
shortInstrumentName = "1 2 3"
keepAliveInterfaces = #'()
  } \repeat unfold 8 {
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "1+2+3+4" \with {
sharingParts = #'(1 2 3 4)
shortInstrumentName = "1 2 3 4"
keepAliveInterfaces = #'()
  } {
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
c'8 8 8 8 8 8 8 8 \break
  }
  \new Staff = "1" \with {
sharingParts = #'(1)
shortInstrumentName = "1"
keepAliveInterfaces = #'()
  } {
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "2+3+4" \with {
sharingParts = #'(2 3 4)
shortInstrumentName = "2 3 4"
keepAliveInterfaces = #'()
  } \repeat unfold 8 {
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "2+3" \with {
sharingParts = #'(2 3)
shortInstrumentName = "2 3"
keepAliveInterfaces = #'()
  } \repeat unfold 8 {
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "2" \with {
sharingParts = #'(2)
shortInstrumentName = "2"
keepAliveInterfaces = #'()
  } {
c'8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##t
c'8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8 8
c'8 8 8 8 8 8 8 8
  }
\new Staff = "3+4" \with {
sharingParts = #'(3 4)
shortInstrumentName = "3 4"
keepAliveInterfaces = #'()
  } \repeat unfold 8 {
c'8 8 8 8 8 8 8 8
  }
  \new Staff = "3" \with {
sharingParts = #'(3)
shortInstrumentName = "3"
keepAliveInterfaces = #'()
  } {
c'8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##t
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##t
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##t
c'8 8 8 8 8 8 8 8
\set Staff.combineWithNext = ##f
c'8 8 8 8 8 8 8 8 8
  }
  \new Staff = "4" \with {
sharingParts = #'(4)
shortInstrumentName = "4"
keepAliveInterfaces = #'()
  } \repeat unfold 8 { c'8 8 8 8 8 8 8 8 }
>>

On Sat, Dec 29, 2018 at 5:21 PM Saul Tobin 
wrote:

> Hi all,
>
> Attached is my latest attempt to make progress toward an automatic
> mechanism for n-parts that may share a staff or not.
>
> The idea is that if the context property combineNext = ##t, then that part
> can share a staff with the next part down. The engraver is supposed to set
> keepAliveInterfaces = '() for all the staves except the ones corresponding
> to the current part grouping. Then depending on line-breaking, staves will
> be hidden according to remove-layers.
>
> I have two issues currently:
> 1) How to initialize the engraver with a list of child staff contexts?
> Grabbing them by acknowledging hara-

Attempt at divisi automating engraver

2018-12-29 Thread Saul Tobin
Hi all,

Attached is my latest attempt to make progress toward an automatic
mechanism for n-parts that may share a staff or not.

The idea is that if the context property combineNext = ##t, then that part
can share a staff with the next part down. The engraver is supposed to set
keepAliveInterfaces = '() for all the staves except the ones corresponding
to the current part grouping. Then depending on line-breaking, staves will
be hidden according to remove-layers.

I have two issues currently:
1) How to initialize the engraver with a list of child staff contexts?
Grabbing them by acknowledging hara-kiri-group-spanner grobs means this
engraver can't affect which staves display on the first system, which isn't
ideal. Is there a better way?

2) ly:context-set-property! seems to work in the sense that the changed
value gets read back correctly, but it doesn't seem like it's affecting the
music output as I'd expect. Should I be having the engraver broadcast a
property change event or something? How would one even do that? Or is this
something to do with the timing of property changes happening over line
breaks?

Apologies for the less than elegant Scheme code. I would love some
feedback/assistance on how to improve this or approach it better.

Happy new year!
\version "2.19.82"

#(debug-enable 'debug)

unfrench = #'(
   bass-figure-interface
   chord-name-interface
   cluster-beacon-interface
   fret-diagram-interface
   lyric-syllable-interface
   note-head-interface
   tab-note-head-interface
   lyric-interface
   percent-repeat-item-interface
   percent-repeat-interface
   ;; need this, as stanza numbers are items, and appear only once.
   stanza-number-interface

   multi-measure-rest-interface
   )

% From define-context-properties.scm
#(define (translator-property-description symbol type? description)
   (if (not (and
 (symbol? symbol)
 (procedure? type?)
 (string? description)))
   (throw 'init-format-error))


   (if (not (equal? #f (object-property symbol 'translation-doc)))
   (ly:error (_ "symbol ~S redefined") symbol))

   (set-object-property! symbol 'translation-type? type?)
   (set-object-property! symbol 'translation-doc description)
   (set! all-translation-properties (cons symbol all-translation-properties))
   symbol)


#(translator-property-description 'sharingParts list? "List of consecutive ints, indices of parts sharing this staff.")
#(translator-property-description 'combineNext boolean? "Is it okay for this music to share a staff with the music in the next staff?")

%% modified from lily-library.scm
#(define (split-at-predicate pred lst)
   "Split LST into two lists at the first element that returns #t for
  (PRED element).  Return the two parts as a pair.
  Example: (split-at-predicate odd? '(0 2 3 2 0)) ==> ((0 2 3) . (2 0))"
   (let ((i (and (pair? lst)
 (list-index pred
   lst
 (if i
 (call-with-values
  (lambda () (split-at lst (1+ i)))
  cons)
 (list lst

#(define (rsplit pred lst)
   (let ((splitted (split-at-predicate pred lst)))
 (if (pair? (cdr splitted))
 (cons (car splitted) (rsplit pred (cdr splitted)))
 splitted)))

% #(display (rsplit (lambda (x) (not (cdr x))) '((1 . #f) (2 . #t) (3 . #t

Staff_sharing_engraver = #(lambda (ctx)
(let* ((all-staves '())
   (solo-staves '()))
  (make-engraver
   (acknowledgers
((hara-kiri-group-spanner-interface
  engraver grob source-engraver)
 ; We need an alist of child contexts, but getting them this way
 ; means the engraver can't operate on the first measure.
 ; Not sure what the proper way to get them is?
 (let* (
 (child-ctx (ly:translator-context source-engraver))
 (child-id (ly:context-id child-ctx))
 (child-parts (ly:context-property child-ctx 'sharingParts))
 )
   (set! all-staves (assoc-set! all-staves child-parts child-ctx))

   ; Build alist of just the staves for a single part.
   (if (and (eq? 1 (length child-parts))
(not (assoc child-parts solo-staves)))
   (set! solo-staves
 (merge solo-staves
   

Re: Possible bug with tempo mark spacing

2018-12-28 Thread Saul Tobin
It's not that special of a case. Hiding a staff containing notes and using
a MarkLine are normal techniques for managing a large ensemble score.

>From property-init.ly:

markLengthOn = {
  \override Score.MetronomeMark.extra-spacing-width = #'(0 . 1.0)
  \override Score.RehearsalMark.extra-spacing-width = #'(-0.5 . 0.5)
  % Raise as much as four staff-spaces before pushing notecolumns right
  \override Score.MetronomeMark.extra-spacing-height = #'(4 . 4)
  \override Score.RehearsalMark.extra-spacing-height = #'(4 . 4)
}

So it appears the relevant difference is setting some positive
extra-spacing-height when setting extra-spacing-width. On further testing
with ledger lines and placing a staff above the MarkLine, the right setting
seems to be MetronomeMark.extra-spacing-height = #'(4 . 0), rather than
#'(4 . 4).

I still wonder if there is a bug in the interaction with hidden staves.
Staves shouldn't be affecting spacing on systems where they are dead.

On Fri, Dec 28, 2018 at 6:47 AM Malte Meyn  wrote:

>
>
> Am 28.12.18 um 04:54 schrieb Saul Tobin:
> >
> > When using a context like MarkLine for tempo marks, if the staff
> > immediately below the MarkLine is hidden but contains rhythmic activity,
> > and if BOTH Y-offset and extra-spacing-width are overridden for
> > MetronomeMark, the first rhythmic column will stretch to the width of
> > the tempo mark.
>
> That sounds like a really special case: MarkLine context AND hidden
> Staff AND this staff contains notes (why is it hidden then?) AND
> Y-offset is set AND extra-spacing-width is set …
>
> >
> > Is this a bug?
>
> I’m not sure, maybe it’s expected behaviour in many cases and only your
> case is so special that it looks buggy even if it’s consistent.
>
> Using \markLengthOn instead of \override
> MetronomeMark.extra-spacing-width = #'(0 . 0) works for me. Would that
> help in your use case?
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Possible bug with tempo mark spacing

2018-12-27 Thread Saul Tobin
Happy holidays all,

Below is a demonstration of an odd behavior I noticed.

When using a context like MarkLine for tempo marks, if the staff
immediately below the MarkLine is hidden but contains rhythmic activity,
and if BOTH Y-offset and extra-spacing-width are overridden for
MetronomeMark, the first rhythmic column will stretch to the width of the
tempo mark.

Is this a bug?

\version "2.19.82"

\layout {
  \context {
\name "MarkLine"
\type "Engraver_group"
\consists Axis_group_engraver
\override VerticalAxisGroup.staff-affinity = #DOWN
\consists Metronome_mark_engraver
%% If either of the below lines is removed, the music spaces correctly
\override MetronomeMark.extra-spacing-width = #'(0 . 0)
\override MetronomeMark.Y-offset = #0
  }
  \context {
\Score
\remove Mark_engraver
\remove Metronome_mark_engraver
\accepts MarkLine
  }
}

<<
  \new MarkLine { \tempo "Testing testing" 4=123 }
  \new Staff \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
keepAliveInterfaces = #'()
  } {
c'8 8 8 8 8 8 8 8
  }
  \new Staff {
c'8 8 8 8 8 8 8 8
  }
>>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Tuplets in Metric Modulations

2018-12-21 Thread Saul Tobin
Notice that in my example I included spacer rests in the tuplet. This allow
room for the bracket.

On Fri, Dec 21, 2018 at 2:47 PM Ld2020  wrote:

> Thank you - this is extremely helpful.
>
> One issue I am still trying to solve: how to get tuplet brackets to
> appear as part of the metronome mark.
>
> I.E. triplet eighth = eighth (triplet under the tuplet bracket with the 3.)
>
> Right now I'm doing:
> \rhythmMark "" {\tuplet 3/2 {b'8}} {b'8}
>
> I get the tuplet number but no bracket.
>
> Any leads you can offer on this would be greatly appreciated.
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Tuplets in Metric Modulations

2018-12-20 Thread Saul Tobin
I've attached the snippet I use for metric modulation markings. Hopefully
others find it useful.

To use it you would write something like:

\metricMark { \tuplet 3/2 { r8*2 c8 } } { c16 r16*3 } "Più tranquillo" #108

FYI – there are some issues with spacing if the marking is at a line break.

On Thu, Dec 20, 2018 at 2:48 PM Ld2020  wrote:

> I am notating some rhythms that use metric modulations (a.k.a. tempo
> modulations).
>
> I am indicating that a triplet quarter becomes the new quarter note.
> What I want is a single quarter note with a triplet mark over it (3
> and a bracket, spaced in such a way as to make it obvious this is one
> third of a triplet)
> = quarter note. That is hard to describe in words, so here is a link
> to a page with a graphical example of what I'm talking about:
> https://forum.makemusic.com/default.aspx?f=6=332470
>
> Currently, I can't find a way to do this in Lilypond, so am doing this
> instead:
>
> \version "2.18.2"
> \relative c {
> \new RhythmicStaff {
> \time 2/2
>  \tempo "Grandioso" 2 = 48
>
> c4 c c c |
> \tuplet 3/2 {c4 c c } c2 |
>
> \tempo \markup { \concat { (
> "triplet "
> %I want an actual triplet here, not the word triplet
> \smaller \general-align #Y #DOWN \note #"4" #1
> " = "
> \smaller \general-align #Y #DOWN \note #"4" #1 " = " 144 ) }}
> c4 c4 c4 c |
> c8 c8 c4 c2 |
> } }
>
> Any tips would be vastly appreciated.
>
> Thank you so much.
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


metric_mod.ily
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fatal error compiling large project (Win10/2.19.82)

2018-12-19 Thread Saul Tobin
I'd be happy to help test as well.

On Wed, Dec 19, 2018, 9:32 AM Michael Gerdau 
> > Indeed, it's not a real problem to compose a special command line for
> WSL Windows - if we know exactly how it should look like.
> > Testing would be a little bit awkward, though
>
> I‘d be happy to test it.
>
> Kind regards,
> Michael
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fatal error compiling large project (Win10/2.19.82)

2018-12-18 Thread Saul Tobin
Thanks so much for the confirmation. A couple questions:

1) Is there a technical obstacle or other reason preventing a Windows
64-bit build?
2) Is it possible to run Lilypond under WSL from Frescobaldi?

On Tue, Dec 18, 2018 at 8:36 PM Aaron Hill  wrote:

> On 2018-12-18 7:24 pm, Saul Tobin wrote:
> > It looks like the Fatal realloc error happens after the score finishes
> > compiling while it's being written to a temporary file. At that point,
> > the
> > Lilypond process is using ~1.8 G of RAM. Is it possible I'm running
> > into a
> > 32 bit size limitation in Guile or something like that?
>
> Very likely.  There have been a number of issues reported before
> regarding memory pressure.  The Windows build of LilyPond is 32-bit
> only.  Also, I do not believe it is "large-address aware" either, so
> that means the address space is strictly 2GiB.  When you factor in DLLs
> and other resources, 1.8GiB is probably a reasonable upper bound for the
> working set.
>
> Due to a number of factors (bit-ness being one of them), I switched to
> using the 64-bit Linux build of LilyPond, running it under the Windows
> Subsystem for Linux (WSL).  This strategy, however, is not for the faint
> of heart.  You can search the mailing list for some posts I made on the
> subject; but if you are not already using WSL, it may not make sense to
> set it up just for LilyPond.
>
> To work within the limits of the existing Windows build, you will
> ultimately have to simplify the score in some way.  Manually segmenting
> it could allow you to compile each section without running out of
> memory, leaving you with the (hopefully) trivial task of stitching
> together the individual outputs into a single result.
>
>
> -- Aaron Hill
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fatal error compiling large project (Win10/2.19.82)

2018-12-18 Thread Saul Tobin
It looks like the Fatal realloc error happens after the score finishes
compiling while it's being written to a temporary file. At that point, the
Lilypond process is using ~1.8 G of RAM. Is it possible I'm running into a
32 bit size limitation in Guile or something like that?

On Sun, Dec 16, 2018 at 4:14 PM Saul Tobin 
wrote:

> Hi Ben,
>
> I did see that thread, but I don't think it can be directly related to my
> issue, since in my case there is no single line of my code that is
> triggering the compile error. Each score compiles correctly on its own and
> in combination with any of the others, but when I compile all together it
> fails. I am also not using strftime anywhere.
>
> Saul
>
>
>
> On Sun, Dec 16, 2018 at 2:38 PM Ben  wrote:
>
>> On 12/16/2018 5:32 PM, Saul Tobin wrote:
>>
>> Hi all,
>>
>> I'm getting a fatal error when I compile all of the movements of a large
>> project on 2.19.82 on Windows 10. I can compile the movements individually
>> and in smaller combinations with no problems. There is no Lilypond error in
>> the debug output, just "FATAL: memory error in realloc."
>>
>> I had no issues with this project on 2.18.2, and the only changes between
>> versions were running convert-ly and changing a couple variable names.
>>
>> Totally stumped here. Ideas?
>>
>> Saul
>>
>>
>> Hi Saul,
>>
>> I believe it's a Windows only bug/issue/problem/headache, sorry :(
>>
>> See here for a similar problem:
>>
>> http://lilypond.1069038.n5.nabble.com/Fatal-bug-in-strftime-td145721.html
>>
>> There may be a workaround for you, aside from going through the trouble
>> of setting up a virtual machine just to compile ;)
>>
>> Do you have any concerns with file names or other things that could be
>> triggering the memory error? Any other log info?
>>
>>
>>
>> ___
>> lilypond-user mailing list
>> lilypond-user@gnu.org
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fatal error compiling large project (Win10/2.19.82)

2018-12-16 Thread Saul Tobin
Hi Ben,

I did see that thread, but I don't think it can be directly related to my
issue, since in my case there is no single line of my code that is
triggering the compile error. Each score compiles correctly on its own and
in combination with any of the others, but when I compile all together it
fails. I am also not using strftime anywhere.

Saul



On Sun, Dec 16, 2018 at 2:38 PM Ben  wrote:

> On 12/16/2018 5:32 PM, Saul Tobin wrote:
>
> Hi all,
>
> I'm getting a fatal error when I compile all of the movements of a large
> project on 2.19.82 on Windows 10. I can compile the movements individually
> and in smaller combinations with no problems. There is no Lilypond error in
> the debug output, just "FATAL: memory error in realloc."
>
> I had no issues with this project on 2.18.2, and the only changes between
> versions were running convert-ly and changing a couple variable names.
>
> Totally stumped here. Ideas?
>
> Saul
>
>
> Hi Saul,
>
> I believe it's a Windows only bug/issue/problem/headache, sorry :(
>
> See here for a similar problem:
>
> http://lilypond.1069038.n5.nabble.com/Fatal-bug-in-strftime-td145721.html
>
> There may be a workaround for you, aside from going through the trouble of
> setting up a virtual machine just to compile ;)
>
> Do you have any concerns with file names or other things that could be
> triggering the memory error? Any other log info?
>
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Fatal error compiling large project (Win10/2.19.82)

2018-12-16 Thread Saul Tobin
Hi all,

I'm getting a fatal error when I compile all of the movements of a large
project on 2.19.82 on Windows 10. I can compile the movements individually
and in smaller combinations with no problems. There is no Lilypond error in
the debug output, just "FATAL: memory error in realloc."

I had no issues with this project on 2.18.2, and the only changes between
versions were running convert-ly and changing a couple variable names.

Totally stumped here. Ideas?

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Should the LilyPond website mention financial support for contributors?

2018-11-09 Thread Saul Tobin
I support all of these suggestions.

My own two cents: I would like to contribute monthly, but I'd personally
prefer to contribute to the project as a whole or the core developers as a
group, if possible. It seems like it could be helpful to set project-level
finances up in the long run anyway, given things like web hosting expenses.

On Fri, Nov 9, 2018, 4:42 PM Karlin High   From recent thread:
>
> 
>
> I was following the LilyPond community for quite a while before
> realizing that financially supporting developers was a thing. The most
> obvious pages on the website, "Sponsoring" and "Help us" say nothing
> about it:
>
> 
>
> Lots of other websites have a "tip jar" for the site operator. How about
> putting up some PayPal.Me links...
>
> 
>
> ...for David Kastrup, Urs Liska, or other major contributors? Assuming
> the contributors are open to the idea, and it fits with the way the
> contributor and the community see their role in the project.
>
> I guess project-level donations would also be possible, but then there's
> the whole issue of managing the funds, and maybe non-profit organization
> compliance if using GNU's donation systems. Giving directly to
> contributors seems simpler.
>
> I'm thinking such website changes would go through code review just like
> anything else, giving the LilyPond community a chance to discuss what
> contributors would get listed for financial support.
> --
> Karlin High
> Missouri, USA
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Issue with make-dead-when (divisi, hara_kiri)

2018-10-28 Thread Saul Tobin
Hi all,

Not sure if this should be on the User mailing list or one of the others.

The attached code replicates a strange behavior I have encountered several
different times, where seemingly random and irrelevant musical details
cause staves to incorrectly disappear when using the divisi snippet I
posted a few months ago. I also tested this with variants of Thomas
Morley's version of the snippet, so I'm convinced it's not anything to do
with the snippet itself.

In my attached example, notice that the Oboe 2 staff disappears when it
shouldn't, but if you remove the hairpin from the flute part, the Oboe 2
staff reappears. I believe that this is caused by the Oboe 2 staff having
'make-dead-when set to the combined staff, which itself has 'make-dead-when
set to Oboe 1. Hara_kiri_group_spanner::request_suicide checks each foe
staff for is_live and request_suicide_alone, but not request_suicide (to
avoid infinite loops, I guess). So if Oboe1+2 becomes dead due to
'make-dead-when, when on its own it would have stayed alive, it may either
appear alive or dead to Oboe 2, depending on which staff happens to be
evaluated first.

To avoid this race condition, one has to avoid setting 'keep-dead-when to
point to other staves that themselves have 'keep-dead-when set. In other
words, for some staves to be masters, others to be slaves. Which is
probably a good idea anyway, but it leaves a gap in functionality when it
comes to 3+ stave divisi. For 3 staves, you have:

1+2+3:  Alive if BOTH 1 and 3 are dead
1+2: Alive if 1 is dead AND 3 is alive
2+3: Alive if 1 is alive AND 3 is dead
1: Master staff
2: Alive if BOTH 1 and 3 are alive
3: Master staff

With the semantics of the existing 'make-dead-when interface, this is
doable by making, for instance, 1+2 and 2+3 dead whenever 1+2+3 is alive,
but as I noticed, this type of inter-dependency leads to unpredictable
behavior. A better way forward would be to expand the 'make-dead-when
mechanism to support a complete variety of logical conditions, such as ALL
vs. ANY and combinations of alive and dead conditions.

Saul
\version "2.19.82"
\language "english"

remove-if-sibling = #(define-scheme-function (offsets) (list?)
   (lambda (grob)
 (let* (
 ;; The parent of a VerticalAxisGroup is a VerticalAlignment
 (parent (ly:grob-parent grob 1))
 ;; Get the children VerticalAxisGroups of the parent
 (siblings (ly:grob-object parent 'elements))
 (siblings-list
  (if (ly:grob-array? siblings)
  (ly:grob-array->list siblings)
  '()))
 ;; Find the siblings above or below me by offsets
 (my-vindex (ly:grob-get-vertical-axis-group-index grob))
 (enemy-indices (map (lambda (offset) (+ offset my-vindex)) offsets))
 (enemy-vaxis? (lambda (v) (member (ly:grob-get-vertical-axis-group-index v)
 enemy-indices)))
 (enemy-vaxes
  (filter enemy-vaxis? siblings-list))
 )
   ;; Suicide if an enemy sibling is alive
   (map
(lambda (enemy-vaxis)
  (ly:pointer-group-interface::add-grob grob 'make-dead-when enemy-vaxis))
enemy-vaxes)
   )
 )
   )

global = {
  s1
  \break
  s1*3
  \break
  s1
  \bar "||"
}

flute = {
  \clef treble
  \set Voice.midiInstrument = "flute"
  R1*3 |
  % Notice that without the hairpin, the Ob. 2 staff doesn't disappear
  c''1\< |
  c''1 <>\! |
}

oboeI = {
  \clef treble
  \set Voice.midiInstrument = "oboe"
  \context Staff = "Ob1" { \unset Staff.keepAliveInterfaces }
  R1 |
  c''1 |
  R1 |
  \context Staff = "Ob1" { \set Staff.keepAliveInterfaces = #'() }
  R1*2 |
}

oboeII = {
  \clef treble
  \set Voice.midiInstrument = "oboe"
  R1*2 |
  c'1 |
  R1*2 |
}

\score {
  <<
\new Staff = "Fl1" \with {
  instrumentName = "Flute"
  shortInstrumentName = "Fl."
} << \global \flute >>
\new StaffGroup \with {
  instrumentName = "Oboe"
  shortInstrumentName = "Ob."
  systemStartDelimiter = #'SystemStartSquare
  \override SystemStartSquare.collapse-height = #5
} <<
  \new Staff = "Ob1+2" \with {
instrumentName = \markup\right-column {"1" "2"}
shortInstrumentName = \markup\right-column {"1" "2"}
\override VerticalAxisGroup.before-line-breaking = \remove-if-sibling #'(1)
  } { <> << \global \partcombine \oboeI \oboeII >> }
  \new Staff = "Ob1" \with {
instrumentName = "1"
shortInstrumentName = "1"
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \oboeI >>
  \new Staff = "Ob2" \with {
instrumentName = "2"
shortInstrumentName = "2"

Lilypond website down?

2018-08-08 Thread Saul Tobin
Looks like Lilypond.org has been down since yesterday.
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: New snippet: remove staff if another is alive (for wind divisi)

2018-08-07 Thread Saul Tobin
Super glad to see this conversation happening! David I'm so glad you've
been working on the backend for divisi. Divisi staves have long been my
biggest headache.

Thomas, thanks for writing the improved version. I haven't had a chance to
look at the code deeply yet — I will play around with it this weekend.

One observation about the user interface: logically, if the combined 1+2
staff is hidden, both the staff for 1 and the staff for 2 should be
printed. IMO one of the design goals for a divisi user interface should be
to manage this automatically without the need to write separate
simultaneous commands to hide or unhide each staff. There are only two
possible states for a two-part divisi: combined or separate staves. Only a
single command should be needed to toggle that state. Extrapolate for 3, 4
way divisi etc.

As an aside, for what it's worth, from my perspective as a composer who
uses a lot of divisi staves, I want to minimize separation of divisi
commands from musical content, because the choice to divide or not depends
on the musical content, which I may revise frequently. I recognize that
many other Lilypond users prefer the style you used in your example, but I
just thought I'd mention it, since if this is moving towards an officially
supported interface, IMO it needs to support both styles.

Saul

On Tue, Aug 7, 2018 at 12:42 PM David Kastrup  wrote:

> Thomas Morley  writes:
>
> > 2018-08-07 20:28 GMT+02:00 David Kastrup :
> >> Thomas Morley  writes:
> >
>  Ok, let me chime in: I've basically developed some of the low-level
>  mechanisms for divisi staves.
> >>>
> >>> You mean that 'make-dead-when stuff?
> >>
> >> Well, that's the internal part of the low end.  But it's usually driven
> >> by the remove-layer property.  You are not actually using it?
> >
> > Nope.
> > I'll have a closer look at it, though.
>
> Maybe it's a failure.  It may well have problems scaling since it
> creates a single hierarchy.  I know that one tenet or inspiration for
> that kind of numerical hierarchy was that it was reasonably certain to
> avoid creating strange loops.
>
> --
> David Kastrup
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: New snippet: remove staff if another is alive (for wind divisi)

2018-08-03 Thread Saul Tobin
Those errors are from this expression in the three staff example: <<
\global \I \II \III >>. Lilypond is implicitly creating three Voices
instead of treating it as a single Voice with simultaneous music. If you
replace that expression with { <> << \global \I \II \III >> }, the errors
go away.

Since the partcombiner doesn't currently support more than 2 arguments,
this is something that requires a workaround if you want to do three parts
on a single staff.

Anyway, it doesn't affect the point of this snippet, which is automatically
hiding staves based on which other staves are alive on each system.

On Fri, Aug 3, 2018 at 2:23 PM Ben  wrote:

> On 8/3/2018 5:14 PM, Saul Tobin wrote:
>
> Hi all,
>
> I just put together a snippet to make managing shared wind staves more
> automatic, particularly with triple winds that may be combined in different
> ways.
>
> \version "2.19.82"
>
> #(define remove-if-sibling
>(lambda (offsets)
>  (lambda (grob)
>(let* (
>;; The parent of a VerticalAxisGroup is a VerticalAlignment
>(parent (ly:grob-parent grob 1))
>;; Get the children VerticalAxisGroups of the parent
>(siblings (ly:grob-object parent 'elements))
>(siblings-list
> (if (ly:grob-array? siblings)
> (ly:grob-array->list siblings)
> '()))
>;; Find the siblings above or below me by offsets
>(my-vindex (ly:grob-get-vertical-axis-group-index grob))
>(enemy-indices (map (lambda (offset) (+ offset my-vindex))
> offsets))
>(enemy-vaxis? (lambda (v) (member
> (ly:grob-get-vertical-axis-group-index v)
>enemy-indices)))
>(enemy-vaxes
> (filter enemy-vaxis? siblings-list))
>)
>  ;; Suicide if an enemy sibling is alive
>  (map
>   (lambda (enemy-vaxis)
> (ly:pointer-group-interface::add-grob grob 'make-dead-when
> enemy-vaxis))
>   enemy-vaxes)
>  )
>)
>  )
>)
>
> %% Two Staff Example
>
> global = {
>   s1
>   \break
>   s1
>   \break
>   s1*2
> }
>
> I = {
>   c'''1
>   \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
>   c'''1
>   c'''1
>   \context Staff = "1" { \unset Staff.keepAliveInterfaces }
>   c'''1
> }
>
> II = {
>   e''1
>   e''1
>   e''1
>   e''1
> }
>
> <<
>   \new Staff = "1+2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(1))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \partcombine \I \II >>
>   \new Staff = "1" \with {
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I >>
>   \new Staff = "2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(-2))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \II >>
> >>
>
> %% Three Staff Example
>
> global = {
>   s1
>   \break
>   s1
>   \break
>   s1
>   \break
>   s1*2
> }
>
> I = {
>   c'''1
>   \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
>   c'''1
>   c'''1
>   c'''1
>   \context Staff = "1" { \unset Staff.keepAliveInterfaces }
>   c'''1
> }
>
> II = {
>   e''1
>   e''1
>   e''1
>   e''1
>   e''1
> }
>
> III = {
>   a'1
>   a'1
>   \context Staff = "3" { \set Staff.keepAliveInterfaces = #'() }
>   a'1
>   a'1
>   a'1
> }
>
> <<
>   \new Staff = "1+2+3" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(2 5))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I \II \III >>
>   \new Staff = "1+2" \with {
> \override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
> '(1 -1))
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \partcombine \I \II >>
>   \new Staff = "1" \with {
> \override VerticalAxisGroup.remove-empty = ##t
> \override VerticalAxisGroup.remove-first = ##t
>   } << \global \I >>

New snippet: remove staff if another is alive (for wind divisi)

2018-08-03 Thread Saul Tobin
Hi all,

I just put together a snippet to make managing shared wind staves more
automatic, particularly with triple winds that may be combined in different
ways.

\version "2.19.82"

#(define remove-if-sibling
   (lambda (offsets)
 (lambda (grob)
   (let* (
   ;; The parent of a VerticalAxisGroup is a VerticalAlignment
   (parent (ly:grob-parent grob 1))
   ;; Get the children VerticalAxisGroups of the parent
   (siblings (ly:grob-object parent 'elements))
   (siblings-list
(if (ly:grob-array? siblings)
(ly:grob-array->list siblings)
'()))
   ;; Find the siblings above or below me by offsets
   (my-vindex (ly:grob-get-vertical-axis-group-index grob))
   (enemy-indices (map (lambda (offset) (+ offset my-vindex))
offsets))
   (enemy-vaxis? (lambda (v) (member
(ly:grob-get-vertical-axis-group-index v)
   enemy-indices)))
   (enemy-vaxes
(filter enemy-vaxis? siblings-list))
   )
 ;; Suicide if an enemy sibling is alive
 (map
  (lambda (enemy-vaxis)
(ly:pointer-group-interface::add-grob grob 'make-dead-when
enemy-vaxis))
  enemy-vaxes)
 )
   )
 )
   )

%% Two Staff Example

global = {
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
}

<<
  \new Staff = "1+2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(1))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(-2))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
>>

%% Three Staff Example

global = {
  s1
  \break
  s1
  \break
  s1
  \break
  s1*2
}

I = {
  c'''1
  \context Staff = "1" { \set Staff.keepAliveInterfaces = #'() }
  c'''1
  c'''1
  c'''1
  \context Staff = "1" { \unset Staff.keepAliveInterfaces }
  c'''1
}

II = {
  e''1
  e''1
  e''1
  e''1
  e''1
}

III = {
  a'1
  a'1
  \context Staff = "3" { \set Staff.keepAliveInterfaces = #'() }
  a'1
  a'1
  a'1
}

<<
  \new Staff = "1+2+3" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(2 5))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I \II \III >>
  \new Staff = "1+2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(1 -1))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \I \II >>
  \new Staff = "1" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \I >>
  \new Staff = "2+3" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(2 -3))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \partcombine \II \III >>
  \new Staff = "2" \with {
\override VerticalAxisGroup.before-line-breaking = #(remove-if-sibling
'(-1 -3 -4))
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \II >>
  \new Staff = "3" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
  } << \global \III >>
>>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \unset with modified default properties

2018-07-02 Thread Saul Tobin
Sure, define-music-function works fine. That part I just copied from the
earlier snippet. That's a side issue, though.

On Mon, Jul 2, 2018 at 2:36 PM David Kastrup  wrote:

> Saul Tobin  writes:
>
> > Indeed, or StaffGroup level if I'm following correctly.
>
> And there is a StaffGroup.
>
> > My issue is that I want to change the default keepAliveInterfaces for
> > one staff within a StaffGroup. (Probably should have just posted this
> > as my initial example, I suppose.)
> >
> > \version "2.19.82"
> >
> > targetstaff = #(define-scheme-function (ctx) (string?)
> >  #{
> >  \set Staff.keepAliveInterfaces = #'()
> >  \context Staff = #ctx { \unset Staff.keepAliveInterfaces }
> >  #})
>
> Why not define-music-function?  This seems like asking for trouble
> unnecessarily.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \unset with modified default properties

2018-07-02 Thread Saul Tobin
Indeed, or StaffGroup level if I'm following correctly. My issue is that I
want to change the default keepAliveInterfaces for one staff within a
StaffGroup. (Probably should have just posted this as my initial example, I
suppose.)

\version "2.19.82"

targetstaff = #(define-scheme-function (ctx) (string?)
 #{
 \set Staff.keepAliveInterfaces = #'()
 \context Staff = #ctx { \unset Staff.keepAliveInterfaces }
 #})

music = {
  \targetstaff "2"
  c'1 d' e' d'
  \break
  \targetstaff "1"
  R1*4
}

\new StaffGroup <<
  \new Staff = "1" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##t
instrumentName = "1"
shortInstrumentName = "1"
  } \music
  \new Staff = "2" \with {
\override VerticalAxisGroup.remove-empty = ##t
\override VerticalAxisGroup.remove-first = ##f
instrumentName = "2"
shortInstrumentName = "2"
keepAliveInterfaces = #'(
  bass-figure-interface
  chord-name-interface
  cluster-beacon-interface
  fret-diagram-interface
  lyric-syllable-interface
  note-head-interface
  tab-note-head-interface
  lyric-interface
  percent-repeat-item-interface
  percent-repeat-interface
  ;; need this, as stanza numbers are items,
and appear only once.
  stanza-number-interface
  ;; all the normal stuff ^
  ;; new stuff v
  multi-measure-rest-interface
  )
  } \music
>>

This is adapted from a snippet posted a while ago on the mailing list:
https://www.mail-archive.com/lilypond-user@gnu.org/msg125650.html.

Does this clarify what I'm trying to do with \unset?

Thanks!

Saul

On Mon, Jul 2, 2018 at 12:24 AM David Kastrup  wrote:

> Saul Tobin  writes:
>
> > Interesting. So if the default property is set at the Staff level, for
> > instance, then changed and \unset at the Voice level, it goes back to the
> > default for the higher-level context. But if in the example \new Staff
> > \with... is changed to \new Voice \with... the original problem arises
> > where \unset reverts to the built-in default.
> >
> > Didn't realize about the \tuplet syntax. That's quite useful. Thanks for
> > the tip!
> >
> > Actually, I just used tupletSpannerDuration because it was convenient to
> > write a tiny example. My practical use case is changing the default
> > keepAliveInterfaces for certain staves.
>
> Ah, that is read at Staff level.  You could set your score-wide default
> at, well, Score level then.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Toc with counter

2018-07-02 Thread Saul Tobin
Try this:

tocItemWithDotsMarkupFixed = \markup {
  \fill-line {
\fromproperty #'toc:text
\fill-with-pattern #1 #RIGHT . "" \fromproperty #'toc:page
  }
}

\paper {
  tocItemMarkup = \tocItemWithDotsMarkupFixed
}

On Mon, Jul 2, 2018 at 12:57 PM Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com> wrote:

> Thank you Saul.
> I understood that fill-with-pattern initiated the problem but could not
> see why. So thank you for your detailed explanation.
> Now, if someone has a workaround...
>
> Cheers,
> Pierre
>
> 2018-07-02 21:12 GMT+02:00 Saul Tobin :
>
>> If I understand correctly, counter gets incremented whenever
>> interpret-markup is called on a markup containing the counter. If you look
>> in define-markup-commands.scm, \fill-line calls interpret-markup only once,
>> but \fill-with-pattern calls interpret-markup twice, first to find out the
>> width of the left and right text, then it calls interpret-markup again on
>> the entire line.
>>
>> On Mon, Jul 2, 2018 at 9:01 AM Pierre Perol-Schneider <
>> pierre.schneider.pa...@gmail.com> wrote:
>>
>>> > ... counter shows only pairs.
>>> " counter shows only even numbers"... sorry.
>>> Pierre
>>>
>>> 2018-07-02 17:23 GMT+02:00 Pierre Perol-Schneider <
>>> pierre.schneider.pa...@gmail.com>:
>>>
>>>> Hi All,
>>>>
>>>> I'd like to add a counter (LSR 543) in a table of content.
>>>> However, when 'tocItemWithDotsMarkup is set, counter shows only pairs.
>>>> Any idea how to solve this ?
>>>>
>>>> Snippet :
>>>>
>>>> 
>>>> \version "2.19.82" %% or 2.18
>>>>
>>>> %%% Counter defs
>>>> % => http://lsr.di.unimi.it/LSR/Item?id=543
>>>>
>>>> #(define counter-alist '())
>>>>
>>>> #(define-markup-command (counter layout props name) (string?)
>>>>   "Increases and prints out the value of the given counter named
>>>> @var{name}.
>>>>   If the counter does not yet exist, it is initialized with 1."
>>>>   (let* ((oldval (assoc-ref counter-alist name))
>>>>  (newval (if (number? oldval) (+ oldval 1) 1)))
>>>>   (set! counter-alist (assoc-set! counter-alist name newval))
>>>>   (interpret-markup layout props
>>>> (markup (number->string newval)
>>>>
>>>> #(define-markup-command (setcounter layout props name value) (string?
>>>> number?)
>>>>   "Set the given counter named @var{name} to the given @var{value} and
>>>> prints
>>>>   out the value. The counter does not yet have to exist."
>>>>   (set! counter-alist (assoc-set! counter-alist name (- value 1)))
>>>>   (interpret-markup layout props (make-counter-markup name)))
>>>>
>>>> %% Test:
>>>>
>>>> \book {
>>>>   \bookpart {
>>>> \markuplist \table-of-contents
>>>> \paper {
>>>>   %% comment the following line:
>>>>   tocItemMarkup = \tocItemWithDotsMarkup
>>>> }
>>>>   }
>>>>   \bookpart {
>>>> \tocItem \markup { "Étude" \counter #"counter" }
>>>> { c' }
>>>>   }
>>>>   \bookpart {
>>>> \tocItem \markup { "Étude" \counter #"counter" }
>>>> { c' }
>>>>   }
>>>>   \bookpart {
>>>> \tocItem \markup { "Étude" \counter #"counter" }
>>>> { c' }
>>>>   }
>>>> }
>>>> 
>>>>
>>>> TIA, cheers,
>>>> Pierre
>>>>
>>>>
>>>>
>>> ___
>>> lilypond-user mailing list
>>> lilypond-user@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>>>
>>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Toc with counter

2018-07-02 Thread Saul Tobin
If I understand correctly, counter gets incremented whenever
interpret-markup is called on a markup containing the counter. If you look
in define-markup-commands.scm, \fill-line calls interpret-markup only once,
but \fill-with-pattern calls interpret-markup twice, first to find out the
width of the left and right text, then it calls interpret-markup again on
the entire line.

On Mon, Jul 2, 2018 at 9:01 AM Pierre Perol-Schneider <
pierre.schneider.pa...@gmail.com> wrote:

> > ... counter shows only pairs.
> " counter shows only even numbers"... sorry.
> Pierre
>
> 2018-07-02 17:23 GMT+02:00 Pierre Perol-Schneider <
> pierre.schneider.pa...@gmail.com>:
>
>> Hi All,
>>
>> I'd like to add a counter (LSR 543) in a table of content.
>> However, when 'tocItemWithDotsMarkup is set, counter shows only pairs.
>> Any idea how to solve this ?
>>
>> Snippet :
>>
>> 
>> \version "2.19.82" %% or 2.18
>>
>> %%% Counter defs
>> % => http://lsr.di.unimi.it/LSR/Item?id=543
>>
>> #(define counter-alist '())
>>
>> #(define-markup-command (counter layout props name) (string?)
>>   "Increases and prints out the value of the given counter named
>> @var{name}.
>>   If the counter does not yet exist, it is initialized with 1."
>>   (let* ((oldval (assoc-ref counter-alist name))
>>  (newval (if (number? oldval) (+ oldval 1) 1)))
>>   (set! counter-alist (assoc-set! counter-alist name newval))
>>   (interpret-markup layout props
>> (markup (number->string newval)
>>
>> #(define-markup-command (setcounter layout props name value) (string?
>> number?)
>>   "Set the given counter named @var{name} to the given @var{value} and
>> prints
>>   out the value. The counter does not yet have to exist."
>>   (set! counter-alist (assoc-set! counter-alist name (- value 1)))
>>   (interpret-markup layout props (make-counter-markup name)))
>>
>> %% Test:
>>
>> \book {
>>   \bookpart {
>> \markuplist \table-of-contents
>> \paper {
>>   %% comment the following line:
>>   tocItemMarkup = \tocItemWithDotsMarkup
>> }
>>   }
>>   \bookpart {
>> \tocItem \markup { "Étude" \counter #"counter" }
>> { c' }
>>   }
>>   \bookpart {
>> \tocItem \markup { "Étude" \counter #"counter" }
>> { c' }
>>   }
>>   \bookpart {
>> \tocItem \markup { "Étude" \counter #"counter" }
>> { c' }
>>   }
>> }
>> 
>>
>> TIA, cheers,
>> Pierre
>>
>>
>>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \unset with modified default properties

2018-07-01 Thread Saul Tobin
Interesting. So if the default property is set at the Staff level, for
instance, then changed and \unset at the Voice level, it goes back to the
default for the higher-level context. But if in the example \new Staff
\with... is changed to \new Voice \with... the original problem arises
where \unset reverts to the built-in default.

Didn't realize about the \tuplet syntax. That's quite useful. Thanks for
the tip!

Actually, I just used tupletSpannerDuration because it was convenient to
write a tiny example. My practical use case is changing the default
keepAliveInterfaces for certain staves.

On Sun, Jul 1, 2018 at 1:00 AM David Kastrup  wrote:

> Saul Tobin  writes:
>
> > In both 2.18 and 2.19, \unset appears to set a context property to the
> > built-in default, rather than the default set in the \with {} block:
> >
> > music = \relative c' {
> >   \tuplet 3/2 {
> > c8 c c d d d e e e f f f |
> >   }
> >   \set Staff.tupletSpannerDuration = #(ly:make-moment 1/2)
> >   \tuplet 3/2 {
> > c8 c c d d d e e e f f f |
> >   }
> >   \unset Staff.tupletSpannerDuration
> >   \tuplet 3/2 {
> > c8 c c d d d e e e f f f |
> >   }
> > }
> >
> > \new Staff \with {
> >   tupletSpannerDuration = #(ly:make-moment 1/4)
> > } \music
> >
> > In cases like this, I would find it useful to reset the property to the
> > custom default value without having to explicitly \set it every time. Is
> > there a way to do this? Also, is this the most useful behavior of \unset?
>
> There are several approaches.  The tupletSpannerDuration is actually
> interpreted at Voice level, so if you set/unset the Voice level value,
> it remains dominant while set and can be unset nicely:
>
> music = \relative c' {
>   \tuplet 3/2 {
> c8 c c d d d e e e f f f |
>   }
>   \set tupletSpannerDuration = #(ly:make-moment 1/2)
>   \tuplet 3/2 {
> c8 c c d d d e e e f f f |
>   }
>   \unset tupletSpannerDuration
>   \tuplet 3/2 {
> c8 c c d d d e e e f f f |
>   }
> }
>
> \new Staff \with {
>   tupletSpannerDuration = #(ly:make-moment 1/4)
> } \music
>
> But of course for this functionality in particular, use the optional
> tuplet spanner duration argument to the \tuplet music function:
>
> music = \relative c' {
>   \tuplet 3/2 {
> c8 c c d d d e e e f f f |
>   }
>   \tuplet 3/2 2 {
> c8 c c d d d e e e f f f |
>   }
>   \tuplet 3/2 {
> c8 c c d d d e e e f f f |
>   }
> }
>
> \new Staff \with {
>   tupletSpannerDuration = #(ly:make-moment 1/4)
> } \music
>
> In fact, I'd lean towards using it always and not even bother setting
> tupletSpannerDuration at all.  So basically:
>
> music = \relative c' {
>   \tuplet 3/2 4 {
> c8 c c d d d e e e f f f |
>   }
>   \tuplet 3/2 2 {
> c8 c c d d d e e e f f f |
>   }
>   \tuplet 3/2 4 {
> c8 c c d d d e e e f f f |
>   }
> }
>
> \music
>
> It's minimal writing effort and keeps the information where it belongs.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: \unset with modified default properties

2018-06-30 Thread Saul Tobin
Unfortunately, for my use case, \once\set and \once\unset aren't enough.

On Sat, Jun 30, 2018 at 8:31 PM Aaron Hill  wrote:

> On 2018-06-30 17:50, Saul Tobin wrote:
> > In both 2.18 and 2.19, \unset appears to set a context property to the
> > built-in default, rather than the default set in the \with {} block:
> >
> > [ . . . ]
> >
> > In cases like this, I would find it useful to reset the property to the
> > custom default value without having to explicitly \set it every time.
> > Is
> > there a way to do this? Also, is this the most useful behavior of
> > \unset?
>
> While not a completely general solution, you may be able to use \once:
>
> 
>music = \relative c' {
>  \tuplet 3/2 {
>c8 c c d d d e e e f f f |
>  }
>  \once \set Staff.tupletSpannerDuration = #(ly:make-moment 1/2)
>  \tuplet 3/2 {
>c8 c c d d d e e e f f f |
>  }
>  \tuplet 3/2 {
>c8 c c d d d e e e f f f |
>  }
>}
> 
>
> -- Aaron Hill
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


\unset with modified default properties

2018-06-30 Thread Saul Tobin
In both 2.18 and 2.19, \unset appears to set a context property to the
built-in default, rather than the default set in the \with {} block:

music = \relative c' {
  \tuplet 3/2 {
c8 c c d d d e e e f f f |
  }
  \set Staff.tupletSpannerDuration = #(ly:make-moment 1/2)
  \tuplet 3/2 {
c8 c c d d d e e e f f f |
  }
  \unset Staff.tupletSpannerDuration
  \tuplet 3/2 {
c8 c c d d d e e e f f f |
  }
}

\new Staff \with {
  tupletSpannerDuration = #(ly:make-moment 1/4)
} \music

In cases like this, I would find it useful to reset the property to the
custom default value without having to explicitly \set it every time. Is
there a way to do this? Also, is this the most useful behavior of \unset?

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Combining full bar rests with omitted grobs in between

2018-05-19 Thread Saul Tobin
I wrote a function that does something similar to what you need. There may
be newer or better ways to do it, but it's what I use.

Saul

On Fri, May 18, 2018 at 1:12 AM, Davide Liessi 
wrote:

> Dear all,
> is there a way to combine the two full bar rests in one multimeasure
> rest in the following example?
>
> \version "2.19.81"
> \new Staff <<
>   \compressFullBarRests
>   {
> s1
> \once \omit Score.MetronomeMark
> \tempo "test"
>   }
>   {
> R1*2
>   }
> >>
>
> Use case: I have all tempo marks for the full score and parts in one
> variable, but I need to hide a couple of tempo marks in one of the
> parts (requested by the conductor).
>
> I tried the approaches mentioned in the thread
> http://lists.gnu.org/archive/html/lilypond-user/2014-11/msg00267.html
> but they didn't work, probably because omitting the grob only makes it
> invisible and with null extent but does not delete it.
>
> Is there a solution?
> Is there a way to actually delete an omitted grob?
>
> Best wishes.
> Davide
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>


rest_combiner.ily
Description: Binary data
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


convert-ly path for Frescobaldi in Windows?

2018-03-11 Thread Saul Tobin
Hi all,

I recently switched from Linux to Windows 10 and I'm trying to get
convert-ly to work in Frescobaldi 3. The "OK" button is greyed out and "Run
Again" seems not to do anything. What path should I be using for
convert-ly? My Lilypond installations are C:\Program Files\LilyPond\2.xx.x\.

Thanks,

Saul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
Is that the same scenario? By "encountered first" is the doc referring to
the parser or to the moment in musical time?

I can attempt turning off skylines, but I suspect the score will just
explode. I haven't had time to construct a controlled example of the
squished spacing. Seems hard to make it "tiny."

On Sun, Feb 18, 2018 at 6:47 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Saul,
>
> > I'm actually surprised that ordering behavior isn't documented. It's so
> consistent 99% of the time I just assumed it was officially defined
> behavior.
>
> Well,  automatic-behavior> says “If two objects have the same
> outside-staff-priority the one encountered first will be placed closer to
> the staff.” It continues: “In the following example all the markup texts
> have the same priority (since it is not explicitly set).” So far, so good.
>
> But then: “Note that ‘Text3’ is automatically positioned close to the
> staff again, nestling under ‘Text2’.” [!!] So there is some skyline
> (vertical and/or horizontal) calculation going on. Have you tried your
> "problem" score with all skylines turned off (etc.), to see if it makes a
> difference? That's not something you probably want to have as a global
> setting, but it might give you more insight into why you’re seeing the
> current behaviour.
>
> Hope that helps!
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
I'm actually surprised that ordering behavior isn't documented. It's so
consistent 99% of the time I just assumed it was officially defined
behavior.

On Sun, Feb 18, 2018 at 6:30 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Saul,
>
> > I probably will write such a function
>
> Excellent! Be sure to share it with the list.
>
> > when you write ^"one"^"two" you expect "two" to be displayed above "one."
>
> I've actually never had that expectation! (Perhaps I should have? I guess
> I just assumed it works like every other post-event in Lilypond does, which
> is that the display order is not determined by the order of entry, but
> instead by a rather complex combination of parameters known to me and
> otherwise.)
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
I probably will write such a function to deal with my immediate needs, but
I raise the issue because this is a case where Lilypond has well defined
behavior MOST of the time, and then sometimes violates it. Normally, when
you write ^"one"^"two" you expect "two" to be displayed above "one." It
seems rather odd to need to write a special workaround to ensure that the
normal behavior happens all the time, particularly since Lilypond's spacing
algorithm in this case can violate notational conventions relating to the
content of the text.

On Sun, Feb 18, 2018 at 2:21 PM, Kieren MacMillan <
kieren_macmil...@sympatico.ca> wrote:

> Hi Torsten,
>
> > Sometimes, the order of stacks /is/ important and you even can't always
> put
> > them together into a \markup column
>
> I didn’t refute that. I simply pointed out there is nothing in Lilypond to
> distinguish between when script order is important and when it's not — so
> she does what she does.
>
> If someone requires order-dependent scripts, they should just write a
> little syntactic sugar to handle the situation.
>
> Cheers,
> Kieren.
> 
>
> Kieren MacMillan, composer
> ‣ website: www.kierenmacmillan.info
> ‣ email: i...@kierenmacmillan.info
>
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
This is exactly my point. All of the suggested solutions to maintain
consistent vertical ordering require using a case-by-case override or
markup function. There is no way to create a global setting to force
Lilypond to respect text vertical ordering.

MOST of the time, Lilypond respects the order of TextScripts specified in
the music expression: ^"one"^"two" will print "two" above "one." Since
Lilypond can't tell whether text is an instrument shift, number of players,
technique, etc., the correct order can only be specified by the human
engraver.

On Sun, Feb 18, 2018 at 6:18 PM, Mason Hock <ma...@masonhock.com> wrote:

> On 02/18, Saul Tobin wrote:
> > This is exactly the sort of situation I'm talking about. You're correct
> > that the order doesn't change the meaning, just as changing the vertical
> > order of instruments in the score doesn't change the scoring. But there
> is
> > a strong convention of how to order different types of text instructions
>
> Indeed, but as layout these decisions are not part of the musical
> information. When you include these instuctions in an include file
> containing the musical content of a player's part, you are only indicating
> that and when these instructions apply. If the order in which you enter the
> instructions were to affect their placement in the score, one of Lilypond's
> greatest strengths, the ability to separate layout from content, would be
> compromised. Any override to Lilypond's behavior that applies to the entire
> score is better off done globally, in a separate file from those containing
> content.
>
> Mason
>
> > (who plays first, then instrument changes, then technical instructions,
> > then style of expression), similar to the conventions for score order.
> You
> > don't want a "solo" indication buried in between three technical
> > instructions, because it could easily get missed by sightreading players.
> > Also, in a full score if several staves have the same three text
> > instructions, it is more readable if they are in the same vertical order
> > for each staff.
> >
> > On Sun, Feb 18, 2018 at 5:51 PM, Mason Hock <ma...@masonhock.com> wrote:
> >
> > > > Indeed. However, the vertical order of expressions is part of
> content,
> > > not
> > > > a purely graphical layout issue.
> > >
> > > With the composer:content::editor:layout, vertical order of
> expressions
> > > seems like layout for most cases that come to mind. A composer might
> decide
> > > to have a violist switch to arco and ponticello simultaneously. The
> > > vertical order of those expressions does not affect what the violist
> does.
> > > I struggle to think of a situation in which the vertical order of
> > > simultaneous instructions would change the meaning of those
> instructions.
> > >
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
Indeed. However, the vertical order of expressions is part of content, not
a purely graphical layout issue.

On Sun, Feb 18, 2018 at 1:08 PM, David Kastrup <d...@gnu.org> wrote:

> Saul Tobin <saul.james.to...@gmail.com> writes:
>
> > It seems very un-Lilypond-like for the output to be so unpredictable,
>
> No.  It is the job of LilyPond to arrange elements in the best possible
> manner representing the input, and that is what it does.
>
> LilyPond is not a music typewriter, but a typesetting program.  It
> doesn't principally work left-to-right and top-to-bottom.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Force Lilypond to preserve vertical order of TextScripts?

2018-02-18 Thread Saul Tobin
It seems very un-Lilypond-like for the output to be so unpredictable, given
that the order is well defined most of the time. It is hard to predict from
the code when Lilypond will violate the specified order, so the only real
solution is to combine expressions into a single markup 100% of the time.
IMO this workaround amounts to deprecating the use of multiple TextScripts
as undefined behavior.

On Sun, Feb 18, 2018 at 3:30 AM, David Kastrup <d...@gnu.org> wrote:

> Saul Tobin <saul.james.to...@gmail.com> writes:
>
> > That's a reasonable workaround, but it's not semantic. A single column
> > markup is appropriate for one expression split across lines IMO. If it's
> > multiple expressions communicating distinct things, it makes sense to
> keep
> > them separate, particularly if one or more of them are predefined
> markups.
>
> If their vertical order is seminal to the reading, you need to either
> make them a single markup or give them different outside-staff-priority
> values.
>
> --
> David Kastrup
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


  1   2   >