Re: insert a `Custos` grob manually

2023-03-29 Thread Werner LEMBERG
>> [...] the ideal solution would be that the custos is really at the
>> end of the staff line, and the extra note is just there to indicate
>> at which pitch the custos gets typeset.
> 
> This should do:

It does, thanks a lot!


Werner



Re: temporarily overriding paper variables

2023-03-29 Thread Aaron Hill

On 2023-03-28 11:51 pm, Werner LEMBERG wrote:

\markup \with-dimensions #'(0 . 0) #'(0 . -2.5) \column {
  \vspace #0.55
  "foo"
}

I want the violin clef touch the top edge of the page.


Ah, you need to adjust the vertical extent in the other direction:


\markup \with-dimensions #'(0 . 0) #'(2.5 . 0)
  \general-align #Y #UP "foo"


The vertical extents #'(0 . -2.5) and #'(2.5 . 0) both have the same 
effective height of -2.5 units, however they have a different relative 
starting point which is important for what may appear *below* the 
markup.  In my example, I needed the red rectangle to snugly fit with 
the scores on both sides, so I apologize that it was not very clear how 
the vertical extent had been altered to achieve that.


Also, do use \general-align to avoid futzing with \vspace in your 
markup.



-- Aaron Hill



Re: temporarily overriding paper variables

2023-03-29 Thread Werner LEMBERG
> 
> \markup \with-dimensions #'(0 . 0) #'(2.5 . 0)
>   \general-align #Y #UP "foo"
> 
> 
> The vertical extents #'(0 . -2.5) and #'(2.5 . 0) both have the same
> effective height of -2.5 units, however they have a different
> relative starting point which is important for what may appear
> *below* the markup.

Aah, thanks.

> Also, do use \general-align to avoid futzing with \vspace in your
> markup.

Excellent advice, thanks again.

Alas, it *still* doesn't work as expected.  Obviously, I have
simplified the code example too much: adding a `ChordNames` context
prevents alignment.  Note that the top skyline of the chord symbol
doesn't show anything suspicious.

```
\paper {
  left-margin = 0
  right-margin = 0
  top-margin = 0
  bottom-margin = 0

  oddHeaderMarkup = ##f
  evenHeaderMarkup = ##f
  oddFooterMarkup = ##f
  evenFooterMarkup = ##f

  top-markup-spacing.basic-distance = 0
  top-markup-spacing.minimum-distance = 0
  top-markup-spacing.padding = 0
  top-markup-spacing.stretchability = 0

  top-system-spacing.basic-distance = 0
  top-system-spacing.minimum-distance = 0
  top-system-spacing.padding = 0
  top-system-spacing.stretchability = 0

  markup-system-spacing.basic-distance = 0
  markup-system-spacing.minimum-distance = 0
  markup-system-spacing.padding = 2.5
  markup-system-spacing.stretchability = 0

  ragged-bottom = ##t
  ragged-last-bottom = ##t

  indent = 1\cm
}

\markup \with-dimensions #'(0 . 0) #'(2.5 . 0) \column {
  \general-align #Y #UP
  "foo"
}

\score {
  <<
\new ChordNames \chordmode { f1:7 }
\new Staff { f'4 }
  >>
}
```


Werner


Re: temporarily overriding paper variables

2023-03-29 Thread Aaron Hill

On 2023-03-29 1:51 am, Werner LEMBERG wrote:

Alas, it *still* doesn't work as expected.  Obviously, I have
simplified the code example too much: adding a `ChordNames` context
prevents alignment.  Note that the top skyline of the chord symbol
doesn't show anything suspicious.


Okay, then I think we are hitting something else.

I imagine this whole business with inverted vertical extents working 
only sometimes is by fluke, not by intentional design.


Would it suffice for you to remove the global padding and manually 
insert any spacing where it is needed as opposed to trying to remove the 
padding in the spot where you do not need it?  Not knowing what you are 
trying to tackle, this might be a non-trivial amount of work.  But I 
think it might be best option given that it does not rely on the 
uncertain behavior of internal arithmetic.



-- Aaron Hill



Re: temporarily overriding paper variables

2023-03-29 Thread Werner LEMBERG


>> Alas, it *still* doesn't work as expected.  Obviously, I have
>> simplified the code example too much: adding a `ChordNames` context
>> prevents alignment.  Note that the top skyline of the chord symbol
>> doesn't show anything suspicious.
> 
> Okay, then I think we are hitting something else.

It seems so, yes.  Jean, do you have an idea?  Shall I submit an
issue?

> I imagine this whole business with inverted vertical extents working
> only sometimes is by fluke, not by intentional design.

Probably.  On the other hand, it would be useful from time to time,
and, as David has observed, both `\vspace` and `\hspace` accept
negative values, which means that LilyPond is essentially ready to
handle those cases.

> Would it suffice for you to remove the global padding and manually
> insert any spacing where it is needed as opposed to trying to remove
> the padding in the spot where you do not need it?

Yes, this will be the workaround I'm going to use eventually.


Werner



Height of markup entered on a Dynamics Staff

2023-03-29 Thread Richard Shann
In the following snippet the text is displaced vertically upwards if
the commenting out is removed, i.e. a note appears with more than one
leger line later on the staff.
8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
\version "2.24"
MI = {
<> ^\markup \bold \italic {"text" } 
R1*4/4
R1*4/4
}
MII = {
 R1*4/4
 R1*4/4
 c''1 
 %c'''1
 
}
\score {
  <<
  \new Dynamics \MI
  \new Staff  \MII
  >>
   }
8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

Is this a bug?

Richard





Re: Height of markup entered on a Dynamics Staff

2023-03-29 Thread Knute Snortum
On Wed, Mar 29, 2023 at 5:08 AM Richard Shann 
wrote:

> In the following snippet the text is displaced vertically upwards if
> the commenting out is removed, i.e. a note appears with more than one
> leger line later on the staff.
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> \version "2.24"
> MI = {
> <> ^\markup \bold \italic {"text" }
> R1*4/4
> R1*4/4
> }
> MII = {
>  R1*4/4
>  R1*4/4
>  c''1
>  %c'''1
>
> }
> \score {
>   <<
>   \new Dynamics \MI
>   \new Staff  \MII
>   >>
>}
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
>
> Is this a bug?
>

Hmm... I'm not seeing anything I would call a bug when I run your example.
Here's what it looks like (attached).

--
Knute Snortum


Re: Height of markup entered on a Dynamics Staff

2023-03-29 Thread Jean Abou Samra
Le mercredi 29 mars 2023 à 13:07 +0100, Richard Shann a écrit :
> In the following snippet the text is displaced vertically upwards if  
> the commenting out is removed, i.e. a note appears with more than one  
> leger line later on the staff.  
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> \version "2.24"  
> MI = {  
>     <> ^\markup \bold \italic {"text" }  
>     R1*4/4  
>     R1*4/4  
> }  
> MII = {  
>  R1*4/4  
>  R1*4/4  
>  c''1  
>  %c'''1  
>   
> }  
> \score {  
>   <<  
>   \new Dynamics \MI  
>   \new Staff  \MII  
>   >>  
>    }  
> 8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><
> 
> Is this a bug?

I don't think so. The point of the Dynamics context is to align the dynamics 
put into it on a common baseline. If there were another `^\markup ...` at the 
point of that note with a ledger line, the alignment would force the first 
markup to much higher (just add `s1 s1^"text"` in `MI` to see it). There is a 
tradeoff between making the line of dynamics look like it's consistently above 
the staff and not pushing it farther than necessary from the staff. I think 
LilyPond's behavior here is legitimate, though perhaps the text script should 
go higher than it does (with the ledgered note).


signature.asc
Description: This is a digitally signed message part


Re: temporarily overriding paper variables

2023-03-29 Thread Jean Abou Samra
Le mercredi 29 mars 2023 à 10:58 +, Werner LEMBERG a écrit :
> ```
> 
> >> Alas, it *still* doesn't work as expected.  Obviously, I have
> >> simplified the code example too much: adding a `ChordNames` context
> >> prevents alignment.  Note that the top skyline of the chord symbol
> >> doesn't show anything suspicious.
> > 
> > Okay, then I think we are hitting something else.
> 
> It seems so, yes.  Jean, do you have an idea?  Shall I submit an
> issue?

I am not yet sure if this is a bug or not.

However, I would like to hear about your actual use case. What do you want this 
for?

Perhaps `oddHeaderMarkup` will work better? This looks OK:

```
\version "2.25.2"

\paper {
  left-margin = 0
  right-margin = 0
  top-margin = 0
  bottom-margin = 0

  oddHeaderMarkup =
\markup
  \if \on-page #1
  \with-dimension #Y #'(0 . 0)
  \general-align #Y #UP
  "foo"
  evenHeaderMarkup = ##f
  oddFooterMarkup = ##f
  evenFooterMarkup = ##f

  top-system-spacing.basic-distance = 0
  top-system-spacing.minimum-distance = 0
  top-system-spacing.padding = 0
  top-system-spacing.stretchability = 0

  ragged-bottom = ##t
  ragged-last-bottom = ##t

  indent = 1\cm
}

\score {
  <<
\new ChordNames \chordmode { f1:7 }
\new Staff { f'4 }
  >>
}
```


signature.asc
Description: This is a digitally signed message part


Re: temporarily overriding paper variables

2023-03-29 Thread David Kastrup
Jean Abou Samra  writes:

> Le mercredi 29 mars 2023 à 10:58 +, Werner LEMBERG a écrit :
>> ```
>> 
>> >> Alas, it *still* doesn't work as expected.  Obviously, I have
>> >> simplified the code example too much: adding a `ChordNames` context
>> >> prevents alignment.  Note that the top skyline of the chord symbol
>> >> doesn't show anything suspicious.
>> > 
>> > Okay, then I think we are hitting something else.
>> 
>> It seems so, yes.  Jean, do you have an idea?  Shall I submit an
>> issue?
>
> I am not yet sure if this is a bug or not.

I'd call it more of an inconsistency with regard to behavior of
something for which (ly:stencil-empty ... #X) returns #t (namely
vertical spacing).  The behavior inside of markup itself is to space and
pad the adjacent vertical elements as if the vertical spacing weren't
there, then add the spacing.

-- 
David Kastrup



Re: temporarily overriding paper variables

2023-03-29 Thread Werner LEMBERG
>> >> Alas, it *still* doesn't work as expected.  Obviously, I have
>> >> simplified the code example too much: adding a `ChordNames` context
>> >> prevents alignment.  Note that the top skyline of the chord symbol
>> >> doesn't show anything suspicious.
> 
> I am not yet sure if this is a bug or not.
> 
> However, I would like to hear about your actual use case. What do
> you want this for?

I'm working on the visual index, and there is a place where markup is
on the left, and a score on the right, but some lines of the score
(via `InstrumentName`) reach into the markup.  For example, lines 1,
3, and 5 on the left come from the markup, while lines 2 and 4 come
from the score.  Contrary to earlier versions, the new visual index
will be split into two pages, and this special markup will positioned
at the top of the second page.  Previously, there was no problem in
interweaving markup and space because it happened mid-page.  However,
moving it up as much as possible to the edge of the page doesn't work,
as described in earlier e-mails.

BTW, the reason to have no margin at all is to include the PDF as an
image into the PDF version of the NR, making it as large as possible
without exceeding the text height and width.

As mentioned earlier I know how to work around the problem.  It is
just surprising that Aaron's solution works mid-page but not at the
edge, and I would like to know the reason.


Werner


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: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Nate
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: 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: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Kenneth Wolcott
HI Saul;

  I asked ChatGPT to write some ABC notation.  The result was...'okay'.

  I then asked for a very simple arrangement of some children's tune
and it got very confused about relative pitches.  Since the rhythm for
the piece of music I requested was so simple it didn't have a problem
generating the score.  I argued with ChatGPT about relative pitches in
Lilypond, I told it to go back and read the manuals :-)  I gave up
asking ChatGPT about generating Lilypond scores after that.

Ken Wolcott

On Wed, Mar 29, 2023 at 3: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: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Kenneth Wolcott
Correction: I don't think I'm using ChatGPT4, I'm using
https://chat.openai.com/chat.
Ken

On Wed, Mar 29, 2023 at 4:06 PM Kenneth Wolcott
 wrote:
>
> HI Saul;
>
>   I asked ChatGPT to write some ABC notation.  The result was...'okay'.
>
>   I then asked for a very simple arrangement of some children's tune
> and it got very confused about relative pitches.  Since the rhythm for
> the piece of music I requested was so simple it didn't have a problem
> generating the score.  I argued with ChatGPT about relative pitches in
> Lilypond, I told it to go back and read the manuals :-)  I gave up
> asking ChatGPT about generating Lilypond scores after that.
>
> Ken Wolcott
>
> On Wed, Mar 29, 2023 at 3: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: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Nate
For some real fun i asked it to generate code that a potential solution
would be recursive (without suggesting a recursive solution). The first
time I stumped it and it went off for two hours. I asked it again later and
it camenback with an interative solution without getting stuck . But i
found that amusing

On Wed, Mar 29, 2023, 7:07 PM Kenneth Wolcott 
wrote:

> HI Saul;
>
>   I asked ChatGPT to write some ABC notation.  The result was...'okay'.
>
>   I then asked for a very simple arrangement of some children's tune
> and it got very confused about relative pitches.  Since the rhythm for
> the piece of music I requested was so simple it didn't have a problem
> generating the score.  I argued with ChatGPT about relative pitches in
> Lilypond, I told it to go back and read the manuals :-)  I gave up
> asking ChatGPT about generating Lilypond scores after that.
>
> Ken Wolcott
>
> On Wed, Mar 29, 2023 at 3: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: 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.
>>>
>>


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 Kenneth Wolcott
I'm currently using "ChatGPT Mar 14 Version."

Ken

On Wed, Mar 29, 2023 at 5:15 PM Saul Tobin  wrote:
>
> 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 kieren

Hi Saul,

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.


Mutopia?
Kieren.



Re: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Curt McDowell
I use chat.openai.com quite a bit for LilyPond. It almost never gives a 
correct or directly useful answer, but often gives me ideas where I can 
continue with LilyPond docs to figure out a solution. It's definitely 
good at explaining how code fragments work if you paste them in. This is 
a very similar situation to another esoteric language I use, OpenSCAD. 
These languages don't benefit from anywhere near the amount of training 
data that's available for languages like C++ and Python. That should 
improve over time, but for now it's a crap-shoot.


Incidentally, I found Bing (supposedly based on GPT-4) is much worse 
than chat.openai.com, despite its ability to look up info on the web, 
and often just says it can't find anything.


Regards,
Curt

On 3/29/2023 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.




bookOutputName still gets "-1" suffix added to SVG file names

2023-03-29 Thread Jeff Olson

I've got to generate a thousand+ cropped SVG files with specified file names
from one lilypond compilation, so I'm wrapping each score in a \book with
its own \bookOutputName as in this MWE:

\version "2.24.1"
#(ly:set-option 'backend 'cairo)
#(ly:set-option 'separate-page-formats 'svg)
#(ly:set-option 'use-paper-size-for-page #f)
#(ly:set-option 'point-and-click #f)
\book {
  \bookOutputName  "Foo"
  { f' }
}
\book {
  \bookOutputName  "Abc"
  { a' }
}
\book {
  \bookOutputName  "Bar"
  { b' }
}

But the SVG files all have the extra -1 suffix as though there were additional
files from the same book that would collide:

  32 -rwxrwxrwx+ 1 J None   32199 Mar 29 22:25  Foo-1.svg*
  32 -rwxrwxrwx+ 1 J None   32190 Mar 29 22:25  Abc-1.svg*
  32 -rwxrwxrwx+ 1 J None   32231 Mar 29 22:25  Bar-1.svg*

My MIDI files don't have this problem since they only add a suffix on
**subsequent** files with the same base name, and there's only one per book.

These "-1" suffices are messing with my URLs for the SVG files,
so I'd appreciate any ideas on how to get rid of them.  Thx.

P.S. I get the same thing using 'backend 'svg
P.P.S  I'm using Windows 10 Pro with Cygnus bash and Frescobaldi 3.1.1

Jeff




Re: Anybody else playing with GPT4 and Lilypond?

2023-03-29 Thread Mike Blackstock
re. "Anybody else playing with GPT4 and Lilypond?"

I'm very much interested in exploring its use to generate graded
sight-reading material.
My own instrument is classical guitar and we're not the best
sight-readers[1]... it would be
nice to have daily sight-reading exercises generated for practice, with
midi. I could donate
the use of a QEMU/KVM server instance for working on a project of that sort.

[1] Guitarist John Williams:
"Another thing I’ve noticed in master classes, is that players will come on
and play the most
difficult solo works from memory, and yet if you give them a part to play
in one of the easier
Haydn String Quartets, as I often do, they’re lost in no time, and have a
very poor sense of
ensemble or timing. Guitarists are among the worst sight-readers I’ve come
across.
Julian Bream and I are both dead average sight-readers by orchestral
standards,
but among guitarists, we are [considered] outstanding! "
https://guitarteacher.com.au/interview/john-williams-interview/

On Wed, 29 Mar 2023 at 18:44, 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.
>


-- 
https://blackstock.media


Re: bookOutputName still gets "-1" suffix added to SVG file names

2023-03-29 Thread Jean Abou Samra
Le mercredi 29 mars 2023 à 22:56 -0600, Jeff Olson a écrit :
> I've got to generate a thousand+ cropped SVG files with specified file names  
> from one lilypond compilation, so I'm wrapping each score in a \book with  
> its own \bookOutputName as in this MWE:
> 
> \version "2.24.1"  
> #(ly:set-option 'backend 'cairo)  
> #(ly:set-option 'separate-page-formats 'svg)  
> #(ly:set-option 'use-paper-size-for-page #f)  
> #(ly:set-option 'point-and-click #f)  
> \book {  
>    \bookOutputName  "Foo"  
>    { f' }  
> }  
> \book {  
>    \bookOutputName  "Abc"  
>    { a' }  
> }  
> \book {  
>    \bookOutputName  "Bar"  
>    { b' }  
> }
> 
> But the SVG files all have the extra -1 suffix as though there were 
> additional  
> files from the same book that would collide:
> 
>    32 -rwxrwxrwx+ 1 J None   32199 Mar 29 22:25  Foo-1.svg*  
>    32 -rwxrwxrwx+ 1 J None   32190 Mar 29 22:25  Abc-1.svg*  
>    32 -rwxrwxrwx+ 1 J None   32231 Mar 29 22:25  Bar-1.svg*
> 
> My MIDI files don't have this problem since they only add a suffix on  
> **subsequent** files with the same base name, and there's only one per book.
> 
> These "-1" suffices are messing with my URLs for the SVG files,  
> so I'd appreciate any ideas on how to get rid of them.  Thx.

They are there for good reason. If any of your `\book`s got output on multiple 
pages, there would indeed be multiple files output.

If you never want separate pages, you should not use `separate-page-formats` 
but `tall-page-formats`.

By the way, in addition to simplifying automation (like lilypond-book), having 
`-1.svg` even on the first page makes it possible to use both 
`separate-page-formats` and `tall-page-formats` at the same time.

Jean


signature.asc
Description: This is a digitally signed message part