Re: Tweak Slur direction "neutral"

2023-01-30 Thread Jean Abou Samra
On 30/01/2023 23:08, Ahanu Banerjee wrote:
> Perhaps the documentation could be amended to clarify how neutral direction 
> is handled for slurs? There are two documentation pages here that mention 
> slur orientation but don't describe the calculation that occurs in 
> \slurNeutral:
> https://lilypond.org/doc/v2.24/Documentation/notation/direction-and-placement#the-direction-property
>  
> 


I think it's not necessary to go to this level of detail in
the documentation: \displayLilyMusic tends to work well enough.


> Also, the documentation in the second link states "The value 0 may also be 
> used in some cases. It is simply treated as meaning UP for slurs, but for 
> some objects it means ‘center’." This doesn't seem accurate, as \override 
> Slur.direction = 0 results in an error, not a slur with direction UP.

That one sounds like a genuine documentation bug indeed.



OpenPGP_signature
Description: OpenPGP digital signature


Re: Tweak Slur direction "neutral"

2023-01-30 Thread Ahanu Banerjee
Perhaps the documentation could be amended to clarify how neutral direction
is handled for slurs? There are two documentation pages here that mention
slur orientation but don't describe the calculation that occurs in
\slurNeutral:
https://lilypond.org/doc/v2.24/Documentation/notation/direction-and-placement#the-direction-property
https://lilypond.org/doc/v2.24/Documentation/learning/within_002dstaff-objects#the-direction-property

Also, the documentation in the second link states "The value 0 may also be
used in some cases. It is simply treated as meaning UP for slurs, but for
some objects it means ‘center’." This doesn't seem accurate, as \override
Slur.direction = 0 results in an error, not a slur with direction UP.

On Sun, Jan 29, 2023 at 8:40 PM Ahanu Banerjee 
wrote:

> Thank you so much!
>
> -Ahanu
>
> On Sun, Jan 29, 2023, 20:36 Jean Abou Samra  wrote:
>
>> On 30/01/2023 02:20, Ahanu Banerjee wrote:
>> > When I attempt to change the "direction" property of a slur, whether
>> that is with \tweak or \override, I cannot set the direction to neutral
>> (0). UP (1) and DOWN (-1) work fine, but when setting to 0, I get the
>> following error:
>> >
>> > "Assertion failed: d, file
>> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
>> line 56
>> > Exited with return code 3."
>> >
>> > This is necessary for a function I am creating; Slur.direction has
>> already been set to UP or DOWN earlier in the document, and I need to
>> temporarily set it to neutral while also changing its color. (\once
>> \slurNeutral is not practical here)
>> >
>> > Below is example code that generates the error:
>> >
>> > \version "2.24"
>> > \language "english"
>> > { c' d' \tweak Slur.direction #0 ( e' ) c' }
>> >
>> > Any suggestions?
>>
>>
>> You can see with
>>
>> \void \displayLilyMusic \slurNeutral
>>
>>
>> that \slurNeutral is not equivalent to \override Slur.direction = #0,
>> but \revert Slur.direction, which reverts Slur.direction to its default
>> value #ly:slur::calc-direction. So you want
>>
>> \version "2.24.0"
>>
>>
>> \language "english"
>> { c' d' \tweak Slur.direction #ly:slur::calc-direction ( e' ) c' }
>>
>>
>> Jean
>>
>>


Re: Tweak Slur direction "neutral",Re: Tweak Slur direction "neutral",Re: Tweak Slur direction "neutral",Re: Tweak Slur direction "neutral"

2023-01-30 Thread Werner LEMBERG
>> But the user shouldn't see an assertion error even in case of a wrong
>> argument, right?
> 
> Yeah,
> https://gitlab.com/lilypond/lilypond/-/merge_requests/1828

Thanks!


Werner



Re: Tweak Slur direction "neutral", Re: Tweak Slur direction "neutral"

2023-01-30 Thread Jean Abou Samra
On 30/01/2023 08:19, Werner LEMBERG wrote:
> 
>>> When I attempt to change the "direction" property of a slur,
>>> whether that is with \tweak or \override, I cannot set the
>>> direction to neutral (0). UP (1) and DOWN (-1) work fine, but when
>>> setting to 0, I get the following error: 
>>>
>>> "Assertion failed: d, file 
>>> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
>>>  line 56
>>> Exited with return code 3."  [...]
>>
>> You can see with
>>
>> \void \displayLilyMusic \slurNeutral
>>
>> that \slurNeutral is not equivalent to \override Slur.direction =
>> #0, but \revert Slur.direction, which reverts Slur.direction to its
>> default value #ly:slur::calc-direction.  [...]
> 
> But the user shouldn't see an assertion error even in case of a wrong
> argument, right?

Yeah,
https://gitlab.com/lilypond/lilypond/-/merge_requests/1828




OpenPGP_signature
Description: OpenPGP digital signature


Re: Tweak Slur direction "neutral", Re: Tweak Slur direction "neutral"

2023-01-30 Thread Valentin Petzel
It think the problem here is not that the error happens, but that the error 
message is absolutely unusable for a user.

If the error message was somthing like "direction must not be 0" it would be 
much clearer for the user.

Still maybe this should be handled before passing this to the drul array.

Cheers,
Valentin

Am Montag, 30. Jänner 2023, 08:19:41 CET schrieb Werner LEMBERG:
> >> When I attempt to change the "direction" property of a slur,
> >> whether that is with \tweak or \override, I cannot set the
> >> direction to neutral (0). UP (1) and DOWN (-1) work fine, but when
> >> setting to 0, I get the following error: 
> >>
> >>
> >>
> >> "Assertion failed: d, file
> >> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24
> >> .0/flower/include/drul-array.hh, line 56
 Exited with return code 3." 
> >> [...]
> >
> >
> >
> > You can see with
> >
> >
> >
> > \void \displayLilyMusic \slurNeutral
> >
> >
> >
> > that \slurNeutral is not equivalent to \override Slur.direction =
> > #0, but \revert Slur.direction, which reverts Slur.direction to its
> > default value #ly:slur::calc-direction.  [...]
> 
> 
> But the user shouldn't see an assertion error even in case of a wrong
> argument, right?
> 
> 
> Werner



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


Re: Tweak Slur direction "neutral",Re: Tweak Slur direction "neutral"

2023-01-29 Thread Werner LEMBERG

>> When I attempt to change the "direction" property of a slur,
>> whether that is with \tweak or \override, I cannot set the
>> direction to neutral (0). UP (1) and DOWN (-1) work fine, but when
>> setting to 0, I get the following error: 
>>
>> "Assertion failed: d, file 
>> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
>>  line 56
>> Exited with return code 3."  [...]
>
> You can see with
>
> \void \displayLilyMusic \slurNeutral
>
> that \slurNeutral is not equivalent to \override Slur.direction =
> #0, but \revert Slur.direction, which reverts Slur.direction to its
> default value #ly:slur::calc-direction.  [...]

But the user shouldn't see an assertion error even in case of a wrong
argument, right?


Werner


Re: Tweak Slur direction "neutral"

2023-01-29 Thread Ahanu Banerjee
Thank you so much!

-Ahanu

On Sun, Jan 29, 2023, 20:36 Jean Abou Samra  wrote:

> On 30/01/2023 02:20, Ahanu Banerjee wrote:
> > When I attempt to change the "direction" property of a slur, whether
> that is with \tweak or \override, I cannot set the direction to neutral
> (0). UP (1) and DOWN (-1) work fine, but when setting to 0, I get the
> following error:
> >
> > "Assertion failed: d, file
> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
> line 56
> > Exited with return code 3."
> >
> > This is necessary for a function I am creating; Slur.direction has
> already been set to UP or DOWN earlier in the document, and I need to
> temporarily set it to neutral while also changing its color. (\once
> \slurNeutral is not practical here)
> >
> > Below is example code that generates the error:
> >
> > \version "2.24"
> > \language "english"
> > { c' d' \tweak Slur.direction #0 ( e' ) c' }
> >
> > Any suggestions?
>
>
> You can see with
>
> \void \displayLilyMusic \slurNeutral
>
>
> that \slurNeutral is not equivalent to \override Slur.direction = #0,
> but \revert Slur.direction, which reverts Slur.direction to its default
> value #ly:slur::calc-direction. So you want
>
> \version "2.24.0"
>
>
> \language "english"
> { c' d' \tweak Slur.direction #ly:slur::calc-direction ( e' ) c' }
>
>
> Jean
>
>


Re: Tweak Slur direction "neutral"

2023-01-29 Thread Jean Abou Samra
On 30/01/2023 02:20, Ahanu Banerjee wrote:
> When I attempt to change the "direction" property of a slur, whether that is 
> with \tweak or \override, I cannot set the direction to neutral (0). UP (1) 
> and DOWN (-1) work fine, but when setting to 0, I get the following error: 
> 
> "Assertion failed: d, file 
> /home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
>  line 56
> Exited with return code 3."
> 
> This is necessary for a function I am creating; Slur.direction has already 
> been set to UP or DOWN earlier in the document, and I need to temporarily set 
> it to neutral while also changing its color. (\once \slurNeutral is not 
> practical here)
> 
> Below is example code that generates the error: 
> 
> \version "2.24"
> \language "english"
> { c' d' \tweak Slur.direction #0 ( e' ) c' }
> 
> Any suggestions?


You can see with

\void \displayLilyMusic \slurNeutral


that \slurNeutral is not equivalent to \override Slur.direction = #0,
but \revert Slur.direction, which reverts Slur.direction to its default
value #ly:slur::calc-direction. So you want

\version "2.24.0"


\language "english"
{ c' d' \tweak Slur.direction #ly:slur::calc-direction ( e' ) c' }


Jean



OpenPGP_signature
Description: OpenPGP digital signature


Tweak Slur direction "neutral"

2023-01-29 Thread Ahanu Banerjee
When I attempt to change the "direction" property of a slur, whether that
is with \tweak or \override, I cannot set the direction to neutral (0). UP
(1) and DOWN (-1) work fine, but when setting to 0, I get the following
error:

"Assertion failed: d, file
/home/lily/lilypond-2.24.0/release/binaries/mingw/lilypond/lilypond-2.24.0/flower/include/drul-array.hh,
line 56
Exited with return code 3."

This is necessary for a function I am creating; Slur.direction has already
been set to UP or DOWN earlier in the document, and I need to temporarily
set it to neutral while also changing its color. (\once \slurNeutral is not
practical here)

Below is example code that generates the error:

\version "2.24"
\language "english"
{ c' d' \tweak Slur.direction #0 ( e' ) c' }

Any suggestions?

Thanks,
-Ahanu