Re: Re-using "\with" contexts

2022-07-15 Thread Alasdair McAndrew
Dear Lukas, Pierre, David,

Thank you all for your expert advice and examples.  It is indeed quite
straightforward - when you know how!  I'll now be able to finish off my
current piece, and start on the next one...

cheers,
Alasdair

On Sat, Jul 16, 2022 at 1:21 AM David Kastrup  wrote:

> Alasdair McAndrew  writes:
>
> > Hello,
> >
> > There are examples of changing a staff context in the manual, for
> example at
> >
> >
> https://lilypond.org/doc/v2.21/Documentation/snippets/pitches#pitches-creating-custom-key-signatures
> >
> > Here a new staff is instantiated; with about 10 lines of "\with"  to
> change
> > its appearance and behaviour.
> >
> > However, if I wish to use several such staves, I don't want to be copying
> > the "\with" material into each one.  Is it possible to create a new
> context
> > just from such a definition?  What I mean is something like
> >
> > myStaff = staff \with {
> > < lots of lines of definition >
> > }
> >
> > so that I can simply create a new staff the way I want it with, for
> example
> >
> > \new myStaff {
> >
> > }
> >
> > All I want is an example.  There is some information about defining a new
> > context, but in my case all I want is a tweaked version of a current
> > context.
>
> \layout {
>   \context {
> \Staff
> \name "myStaff"
> < lots of lines of definition >
>   }
>   \inherit-acceptability myStaff Staff
> }
>
> --
> David Kastrup
>


-- 
Alasdair McAndrew (he/him)
mob: 0432 854 858

https://numbersandshapes.net


Re: Acciaccatura question/issue

2022-07-15 Thread Andrew Bernard
As a further aside, because these are graces, there's nothing wrong with 
having them as 16s but they are not really tuplets three in the space of 
2 because the whole point is they occupy no notation time. They'd be 
clearer just as 3 16s. People like Chopin have long grace runs with 
maybe 17 notes but not written as tuplet.


Andrew





Re: Acciaccatura question/issue

2022-07-15 Thread Andrew Bernard
Turning this into compilable code with a couple of braces, directly 
copied from you post, works just fine for me with lilypond 2.23.10.


Given they are tuplets technically they are really graces not 
appogiaturas, but that has no bearing on your issue. And yes it is 
correct that notation wise graces and appogiaturas occupy no musical 
time in a bar.



Andrew





Re: Acciaccatura question/issue

2022-07-15 Thread jh
Unfortunately I don't think I can.  I can post/send the entire thing 
which will drive everyone hatefully crazy that's why I just took the 
part that didn't do what I expected.  The first measure is correct with 
4 quarters in the bar the second one doesn't  only 3 with the 
acciaccatura.  I use a lot of partials in this piece (or set of pieces) 
and up to this point everything compiles as expected so if you have an 
idea of how much of this to send great otherwise I'm stuck, because it 
doesn't work in context of the whole.

Jay
BTW thank you for responding. And I'm happy to know that my ancient 
understanding of the ornament is still current.

J

On 2022-07-15 17:38, Knute Snortum wrote:

On Fri, Jul 15, 2022 at 3:34 PM jh  wrote:


using 2.22.2 in fresco, my very old understanding of grace and
acciaccatura is that they receive no duration value in a measure.


That's correct.


the
following Minimal example using forget for accidentals when compiled
allows only 3 quarter notes in a 4/4 bar.  I changed the 8ths in the
acciaccatura to 16ths in case that was the problem but that's not the
solution.
~
4^\markup {IX}
\acciaccatura {\times 2/3 {aes16 ges aes}} 4
\acciaccatura {\times 2/3 {aes'16 ges f}} 4
\acciaccatura {\times 2/3 {ges'16 f d}} bes>4\fermata\bar

"||"
d'8 f es16 ces bes8 aes ces bes16 ges f8 es4 ~ \bar
"||"

So what don't I understand?


Here's your code slightly modified so that it actually compiles:

\version "2.22.2"

\relative {
  4^\markup {IX}
  \acciaccatura {\times 2/3 {aes16 ges aes}} 4
  \acciaccatura {\times 2/3 {aes'16 ges f}} 4
  \acciaccatura {\times 2/3 {ges'16 f d}} 4\fermata\bar 
"||"

  d'8 f es16 ces bes8 aes ces bes16 ges f8 es4 ~ \bar "||"
}

I don't see any problem with this code and no errors are produced when
I compile it.  Can't you post a minimal *working* example that
demonstrates the problem?  (Working, as is "it will compile").

--
Knute Snortum




Re: Acciaccatura question/issue

2022-07-15 Thread Knute Snortum
On Fri, Jul 15, 2022 at 3:34 PM jh  wrote:
>
> using 2.22.2 in fresco, my very old understanding of grace and
> acciaccatura is that they receive no duration value in a measure.

That's correct.

> the
> following Minimal example using forget for accidentals when compiled
> allows only 3 quarter notes in a 4/4 bar.  I changed the 8ths in the
> acciaccatura to 16ths in case that was the problem but that's not the
> solution.
> ~
> 4^\markup {IX}
> \acciaccatura {\times 2/3 {aes16 ges aes}} 4
> \acciaccatura {\times 2/3 {aes'16 ges f}} 4
> \acciaccatura {\times 2/3 {ges'16 f d}} 4\fermata\bar
> "||"
> d'8 f es16 ces bes8 aes ces bes16 ges f8 es4 ~ \bar
> "||"
>
> So what don't I understand?

Here's your code slightly modified so that it actually compiles:

\version "2.22.2"

\relative {
  4^\markup {IX}
  \acciaccatura {\times 2/3 {aes16 ges aes}} 4
  \acciaccatura {\times 2/3 {aes'16 ges f}} 4
  \acciaccatura {\times 2/3 {ges'16 f d}} 4\fermata\bar "||"
  d'8 f es16 ces bes8 aes ces bes16 ges f8 es4 ~ \bar "||"
}

I don't see any problem with this code and no errors are produced when
I compile it.  Can't you post a minimal *working* example that
demonstrates the problem?  (Working, as is "it will compile").

--
Knute Snortum



Acciaccatura question/issue

2022-07-15 Thread jh
using 2.22.2 in fresco, my very old understanding of grace and 
acciaccatura is that they receive no duration value in a measure.  the 
following Minimal example using forget for accidentals when compiled 
allows only 3 quarter notes in a 4/4 bar.  I changed the 8ths in the 
acciaccatura to 16ths in case that was the problem but that's not the 
solution.

~
4^\markup {IX}
   \acciaccatura {\times 2/3 {aes16 ges aes}} 4
   \acciaccatura {\times 2/3 {aes'16 ges f}} 4
   \acciaccatura {\times 2/3 {ges'16 f d}} 4\fermata\bar 
"||"
   d'8 f es16 ces bes8 aes ces bes16 ges f8 es4 ~ \bar 
"||"


So what don't I understand?

--
Thank you Sound & Silence

Beginning May 1, 2021 a new address; 1814 Lake Washington Blvd. So.,
Seattle, Wa. 98144

_206-328-7694 or messages at 206-308-8189_

www.soundand.com

and an online short (45 minute) concert of new material on Wayward in 
Limbo



https://www.waywardmusic.org/?p=6082



Piping contents of SVG directly to stdout

2022-07-15 Thread DoubleFelix
Hello,

I'm using lilypond to programmatically generate sheet music. I already have
a system in place to crop the SVGs, but now I need to load them in my
software. I could use the default behavior of letting lilypond write to
some file, and then reading it, but file I/O tends to be pretty expensive,
especially when you're doing it in bulk like I am, so I'd like to avoid
that.

My question is this: Is there a way to get lilypond to write the output to
stdout to save on performance, or do I need to use a file as a middleman?
For reference, my current command is:
"lilypond --svg --loglevel=none file.ly"

Thanks,
Felix


Re: Re-using "\with" contexts

2022-07-15 Thread David Kastrup
Alasdair McAndrew  writes:

> Hello,
>
> There are examples of changing a staff context in the manual, for example at
>
> https://lilypond.org/doc/v2.21/Documentation/snippets/pitches#pitches-creating-custom-key-signatures
>
> Here a new staff is instantiated; with about 10 lines of "\with"  to change
> its appearance and behaviour.
>
> However, if I wish to use several such staves, I don't want to be copying
> the "\with" material into each one.  Is it possible to create a new context
> just from such a definition?  What I mean is something like
>
> myStaff = staff \with {
> < lots of lines of definition >
> }
>
> so that I can simply create a new staff the way I want it with, for example
>
> \new myStaff {
>
> }
>
> All I want is an example.  There is some information about defining a new
> context, but in my case all I want is a tweaked version of a current
> context.

\layout {
  \context {
\Staff
\name "myStaff"
< lots of lines of definition >
  }
  \inherit-acceptability myStaff Staff
}

-- 
David Kastrup



Re: Re-using "\with" contexts

2022-07-15 Thread Pierre Perol-Schneider
Hi Alasdair,
See also:
https://lilypond.org/doc/v2.22/Documentation/notation/defining-new-contexts.html
Cheers,
Pierre

Le ven. 15 juil. 2022 à 16:22, Lukas-Fabian Moser  a écrit :

> Hi Alasdair,
>
> > Here a new staff is instantiated; with about 10 lines of "\with"  to
> > change its appearance and behaviour.
> >
> > However, if I wish to use several such staves, I don't want to be
> > copying the "\with" material into each one.  Is it possible to create
> > a new context just from such a definition? What I mean is something like
> >
> > myStaff = staff \with {
> > < lots of lines of definition >
> > }
> >
> > so that I can simply create a new staff the way I want it with, for
> > example
> >
> > \new myStaff {
> >
> > }
> >
> > All I want is an example.  There is some information about defining a
> > new context, but in my case all I want is a tweaked version of a
> > current context.
>
> This is easier than one might think, but - somewhat counterintuitively -
> you need _two_ instances of the word \with.
>
> \version "2.23.7"
>
> rainbowSettings = \with {
>\override Clef.color = #red
>\override TimeSignature.color = #green
>\override StaffSymbol.color = #blue
>clefGlyph = "clefs.C"
> }
>
> \new Staff \with \rainbowSettings {
>\key d \major
>d'4
> }
>
> \new Staff \with {
>\rainbowSettings
>\magnifyStaff 2
> } {
>\key d \major
>d'4
> }
>
> And I just found out that you can even do
>
> rainbowSettings = {
>\override Clef.color = #red
>\override TimeSignature.color = #green
>\override StaffSymbol.color = #blue
>\set clefGlyph = "clefs.C"
> }
>
> (To wit, if rainbowSettings are entered as music instead of as a \with
> clause, context properties have to be set with \set.)
>
> Lukas
>
>
>


Re: Re-using "\with" contexts

2022-07-15 Thread Lukas-Fabian Moser

Hi Alasdair,

Here a new staff is instantiated; with about 10 lines of "\with"  to 
change its appearance and behaviour.


However, if I wish to use several such staves, I don't want to be 
copying the "\with" material into each one.  Is it possible to create 
a new context just from such a definition? What I mean is something like


myStaff = staff \with {
    < lots of lines of definition >
}

so that I can simply create a new staff the way I want it with, for 
example


\new myStaff {

}

All I want is an example.  There is some information about defining a 
new context, but in my case all I want is a tweaked version of a 
current context.


This is easier than one might think, but - somewhat counterintuitively - 
you need _two_ instances of the word \with.


\version "2.23.7"

rainbowSettings = \with {
  \override Clef.color = #red
  \override TimeSignature.color = #green
  \override StaffSymbol.color = #blue
  clefGlyph = "clefs.C"
}

\new Staff \with \rainbowSettings {
  \key d \major
  d'4
}

\new Staff \with {
  \rainbowSettings
  \magnifyStaff 2
} {
  \key d \major
  d'4
}

And I just found out that you can even do

rainbowSettings = {
  \override Clef.color = #red
  \override TimeSignature.color = #green
  \override StaffSymbol.color = #blue
  \set clefGlyph = "clefs.C"
}

(To wit, if rainbowSettings are entered as music instead of as a \with 
clause, context properties have to be set with \set.)


Lukas




Re-using "\with" contexts

2022-07-15 Thread Alasdair McAndrew
Hello,

There are examples of changing a staff context in the manual, for example at

https://lilypond.org/doc/v2.21/Documentation/snippets/pitches#pitches-creating-custom-key-signatures

Here a new staff is instantiated; with about 10 lines of "\with"  to change
its appearance and behaviour.

However, if I wish to use several such staves, I don't want to be copying
the "\with" material into each one.  Is it possible to create a new context
just from such a definition?  What I mean is something like

myStaff = staff \with {
< lots of lines of definition >
}

so that I can simply create a new staff the way I want it with, for example

\new myStaff {

}

All I want is an example.  There is some information about defining a new
context, but in my case all I want is a tweaked version of a current
context.

Thanks everybody,
Alasdair

-- 
Alasdair McAndrew (he/him)
mob: 0432 854 858

https://numbersandshapes.net