Re: Harp Pedal Spanners

2023-06-07 Thread Alexandre Loomis
Your code is much more readable, but I'm not sure I understand the
difference between first and second take?
I just noticed, where I have -3 it is a typo, it should be positive 3

Alex Loomis

On Wed, Jun 7, 2023 at 9:24 AM David Kastrup  wrote:

> Alexandre Loomis  writes:
>
> > Thanks, that was very helpful! Adding \tweak padding 1 to the original
> > function and defining a continue function by
> > nextPed =
> > #(define-music-function (end-text) (markup?)
> >#{
> >  \tweak bound-details.left.padding -3
> >  \startPed "" #end-text
> >#})
> > makes many cases work or almost work by default. It still requires some
> > tweaking, but far less.
>
> That looks like it could instead be defined as
>
> nextPed = -\tweak bound-details.left.padding -3
>   \startPed "" \etc
>
> Note that this creates an "event function" instead of a "music function"
> since that is more appropriate for a \startTextSpan command which can
> only be applied attached to some rhythmic event.  That way you can write
>
> c'\nextPed
>
> instead of
>
> c'-\nextPad
>
> and have LilyPond recognize this in the first take (there has been a
> "second take" around for a few version that obscurs the distinction, but
> it will still show in the output of
>
> \displayLilyMusic c'\nextPad
>
> and similar constructs).
>
> --
> David Kastrup
>


Re: Harp Pedal Spanners

2023-06-07 Thread Alexandre Loomis
Thanks, that was very helpful! Adding \tweak padding 1 to the original
function and defining a continue function by
nextPed =
#(define-music-function (end-text) (markup?)
   #{
 \tweak bound-details.left.padding -3
 \startPed "" #end-text
   #})
makes many cases work or almost work by default. It still requires some
tweaking, but far less.

Alex

On Tue, Jun 6, 2023 at 1:53 PM Kieren MacMillan 
wrote:

> Hi Alexandre,
>
> > I'm trying to notate harp pedals
>
> It would be great to have more complete/robust harp pedal support in
> Lilypond!
>
> > Is there any way to make this more "automatic"?
>
> Unfortunately, I believe TextSpanner still doesn’t implement shorten-pair…
> but you can always use padding to fake it:
>
> startPed =
> #(define-music-function (start-text end-text) (markup? markup?)
>#{
>  \tweak dash-fraction #1.0
>  \tweak bound-details.left.text #start-text
>  \tweak bound-details.left.stencil-align-dir-y #CENTER
>  \tweak font-shape #'upright
>  \tweak bound-details.right.text #end-text
>  \tweak bound-details.right.stencil-align-dir-y #CENTER
>  \tweak bound-details.left-broken.text ##f
>  \tweak bound-details.right-broken.text ##f
>  \tweak bound-details.right.padding 4
>  \tweak padding 1
>  \startTextSpan
>#})
>
> endPed = \stopTextSpan
>
> RH = \relative es'' {
>   ces'16  gis f  gis  des8 r a'16 ges es  ges d8 r |
> }
>
> Pedals = {
>   s4_\startPed "G♯" " ♭" s s \endPed _\startPed "" "♮" s4 \endPed _"D♮" |
> }
>
> \score {
>   \new Staff <<
> \new Voice \RH
> \new Voice \Pedals
>   >>
> }
>
> Maybe Someone™ will have a more automatic and flexible method, but maybe
> this gives you a hint in the right direction?
>
> Best,
> Kieren.
> __
>
> My work day may look different than your work day. Please do not feel
> obligated to read or respond to this email outside of your normal working
> hours.
>
>


Harp Pedal Spanners

2023-06-06 Thread Alexandre Loomis
Hi all,

I'm trying to notate harp pedals. This should looks something like
[image: mwe1.cropped.png]
I currently have code where it's straightforward to get pretty close, like
this
[image: mwe2.cropped.png]
However, making it look like the first image involves a ton of time
starting the new spanner a 16 (or 32, or whatever gives good spacing)
later, setting TextSpanner.staff-padding so that the new spanner lines up
with the old one, and tweaking the whitespace around the accidentals to
look somewhat balanced. Is there any way to make this more "automatic"?
My current code is

\version "2.24.0"

startPed =
#(define-music-function (start-text end-text) (markup? markup?)
   #{
 \tweak dash-fraction #1.0
 \tweak bound-details.left.text #start-text
 \tweak bound-details.left.stencil-align-dir-y #CENTER
 \tweak font-shape #'upright
 \tweak bound-details.right.text #end-text
 \tweak bound-details.right.stencil-align-dir-y #CENTER
 \tweak bound-details.left-broken.text ##f
 \tweak bound-details.right-broken.text ##f
 \startTextSpan
   #})

endPed = \stopTextSpan

RH = \relative es'' {
  ces'16  gis f  gis  des8 r a'16 ges es  ges d8 r |
}

Pedals = {
  s4_\startPed "G♯" " ♭" s s \endPed _\startPed "" "♮" s4 \endPed _"D♮" |
}

\score {
  \new Staff <<
\new Voice \RH
\new Voice \Pedals
  >>
  \layout {}
}

Thanks,
Alex


Re: Othering??

2023-05-10 Thread Alexandre Loomis
I'd translate it as aliénation or another antonym of assimilation.

On Wed, May 10, 2023, 5:45 AM Vincent Gay  wrote:

> Le 10/05/2023 à 14:26, Andrew Bernard a écrit :
>
> a word that does not really exist in English
>
> DeepL translate Othering in French by altérisation, which is not really
> French either (the right word would be altération)
>
> I suppose this is related to the use of sharp, flat and other beccare
>
> --
> Vincent Gay
> Envoyé depuis mon saxo-phone :)https://myrealbook.vintherine.org/ - 
> http://photos.vintherine.org/
>
>


Re: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Alexandre Loomis
> 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.
>>
>


Re: autoChange creating extra staff

2023-03-17 Thread Alexandre Loomis
That works perfectly, thanks! Follow up question, is there a way to change
the cross-over point during the music, or do I need to do something like

\CrossStaff = {
\autoChange c' { *music* }
\autoChange f' { *music* }
}

On Fri, Mar 17, 2023 at 11:45 AM Jean Abou Samra  wrote:

> Le vendredi 17 mars 2023 à 11:35 -0700, Alexandre Loomis a écrit :
>
> Hi, I'm running into an issue using \autoChange. I'd like CrossStaff to
> share the lower staff (and upper with another voice, but that doesn't seem
> to cause any issues), but it's creating its own.
>
> \version "2.24.0"
>
> CrossStaff = \autoChange f {
>   \relative c' {
> c2 c,
>   }
> }
>
> VoiceTwo = \relative { \clef "bass" c,1 }
>
> \new PianoStaff <<
>   \new Staff = "up" {
> \new Voice \CrossStaff
>   }
>   \new Staff = "down" {
> \new Voice \VoiceTwo
>   }
>
> Try
>
> \version "2.24.1"
>
> CrossStaff = \autoChange f {
>   \relative c' {
> c2 c,
>   }
> }
>
> VoiceTwo = \relative { \clef "bass" c,1 }
>
> \new PianoStaff <<
>   \new Staff = "up" {
> \new Voice \CrossStaff
>   }
>   \context Staff = "down" {
> \new Voice \VoiceTwo
>   }
> >>
>
> As you can see in the examples in the documentation, \autoChange is
> designed to create two staves at once if not already created. In this case,
> when \autoChange is seen by LilyPond at the start of the music, there is
> no "down" staff yet, so it's created, and then you create another one with
> \new. By using \context instead of new (see Creating and referencing
> contexts
> <https://lilypond.org/doc/v2.24/Documentation/notation/creating-and-referencing-contexts>),
> you insert your \VoiceTwo inside the same context rather than creating a
> new one.
>


autoChange creating extra staff

2023-03-17 Thread Alexandre Loomis
Hi, I'm running into an issue using \autoChange. I'd like CrossStaff to
share the lower staff (and upper with another voice, but that doesn't seem
to cause any issues), but it's creating its own.

\version "2.24.0"

CrossStaff = \autoChange f {
  \relative c' {
c2 c,
  }
}

VoiceTwo = \relative { \clef "bass" c,1 }

\new PianoStaff <<
  \new Staff = "up" {
\new Voice \CrossStaff
  }
  \new Staff = "down" {
\new Voice \VoiceTwo
  }
>>


Re: Not sure how to construct an example--need to mark repeat signs underneath, without wrapping to next line

2023-03-07 Thread Alexandre Loomis
You could also use \jump, for example

\version "2.24.1"

\repeat volta 2 {
  c'1 1 1 1
  \jump "4×"
}


On Tue, Mar 7, 2023 at 9:46 AM Jean Abou Samra  wrote:

> Le mardi 07 mars 2023 à 10:29 -0600, Matthew Probst a écrit :
>
> I'm not quite sure how to construct an example--I'm working on my scoring
> for rock/funk band, and I have everything under control due to the great
> help I've received here. One final sticking point is that I like to mark
> repeat signs underneath with a "2x" or "4x".  I've been using  tweaked
> \marks:
>
> \tweak direction #DOWN \mark "4x"
>
> Problem is, if the closing repeat mark is at the end of a line of music as
> it decides to typeset it, this text appears at the beginning of the next
> line instead of at the ending repeat barline where I want it.
>
> I'm guessing that this is not the best way to mark a bar, and I'm not
> finding the right terminology/concepts to search for what I want on my own.
>
> For example:
>
> \version "2.24.1"
>
> \repeat volta 2 {
>   c'1 1 1 1
>   \tweak direction #DOWN \textEndMark "4×"
> }
>
> See
> https://lilypond.org/doc/v2.24/Documentation/notation/writing-text.html#text-marks
>
> For a mark at the beginning of the line, you'd use \textMark instead of
> \textEndMark.
>
> Note that you could also use \tweak break-visibility
> #begin-of-line-invisible \mark "4×" instead of \textEndMark "4×", but
> using \mark for a textual mark has shortcomings, and it is discouraged
> starting from version 2.24 in favor of \textMark and \textEndMark. It's
> only being kept for compatibility. (This is only about \mark ; \mark
> \default is still recommended for a rehearsal mark.)
>


Re: Harp Pedal Spanner

2023-03-02 Thread Alexandre Loomis
That works perfectly, thanks!

Alex

On Thu, Mar 2, 2023 at 1:34 PM Jean Abou Samra  wrote:

> Le jeudi 02 mars 2023 à 12:11 -0700, Alexandre Loomis a écrit :
>
> Hi,
>
> I'm having trouble defining a harp pedal spanner. I'd like to be able to
> write code like
>
> \relative c' { f4 _\startPedal "F♮" g fes \endPedal "♭" }
>
> and get as output the notes, with F♮ below the f natural, ♭ below the f
> flat, and a line connecting the markups. So far the closest I've been able
> to get is
>
> \relative c' { \startPedal "F♮" \endPedal "♭" f4 _\startTextSpan g fes
> \stopTextSpan }
>
> where startPedal and endPedal are defined as
>
> startPed =
> #(define-music-function
>   (text)
>   (markup?)
>   #{
> \once \override TextSpanner.dash-fraction = #1.0
> \once \override TextSpanner.bound-details.left.text = #text
> \once \override TextSpanner.bound-details.left.stencil-align-dir-y =
> #CENTER
> \once \override TextSpanner.font-shape = #'upright
>   #}
> )
>
> endPed =
> #(define-music-function
>   (text)
>   (markup?)
>   #{
> \once \override TextSpanner.bound-details.right.text = #text
> \once \override TextSpanner.bound-details.right.stencil-align-dir-y =
> #CENTER
>   #}
> )
> This produces the correct output, but needing to call all four of
> startPed, endPed, startTextSpan, and stopTextSpan is inconveniently verbose.
>
> With \override, you need to put the command before the note, but LilyPond
> also has \tweak, which attaches to the event itself, so you can do
>
> \version "2.24.1"
>
> startPed =
> #(define-music-function (start-text end-text) (markup? markup?)
>   #{
> \tweak dash-fraction #1.0
> \tweak bound-details.left.text #start-text
> \tweak bound-details.left.stencil-align-dir-y #CENTER
> \tweak font-shape #'upright
> \tweak bound-details.right.text #end-text
> \tweak bound-details.right.stencil-align-dir-y #CENTER
> \startTextSpan
>   #})
>
> endPed = \stopTextSpan
>
> \relative c' { f4 _\startPed "F♮" "♭" g fes \endPed }
>
> Note that this isn't exactly your wished syntax because the end text is
> given to \startPed, not to \endPed. There are no built-in ways to
> override the properties of a spanner at a later point than the moment it
> has been created in, so it would require custom Scheme code to make your
> original syntax work. Unless you really want that, I suggest you just use
> this syntax, which isn't more verbose than yours.
>
> HTH,
>
> Jean
>


Harp Pedal Spanner

2023-03-02 Thread Alexandre Loomis
Hi,

I'm having trouble defining a harp pedal spanner. I'd like to be able to
write code like

\relative c' { f4 _\startPedal "F♮" g fes \endPedal "♭" }

and get as output the notes, with F♮ below the f natural, ♭ below the f
flat, and a line connecting the markups. So far the closest I've been able
to get is

\relative c' { \startPedal "F♮" \endPedal "♭" f4 _\startTextSpan g fes
\stopTextSpan }

where startPedal and endPedal are defined as

startPed =
#(define-music-function
  (text)
  (markup?)
  #{
\once \override TextSpanner.dash-fraction = #1.0
\once \override TextSpanner.bound-details.left.text = #text
\once \override TextSpanner.bound-details.left.stencil-align-dir-y =
#CENTER
\once \override TextSpanner.font-shape = #'upright
  #}
)

endPed =
#(define-music-function
  (text)
  (markup?)
  #{
\once \override TextSpanner.bound-details.right.text = #text
\once \override TextSpanner.bound-details.right.stencil-align-dir-y =
#CENTER
  #}
)

This produces the correct output, but needing to call all four of startPed,
endPed, startTextSpan, and stopTextSpan is inconveniently verbose.

Thanks,
Alex