Re: tie direction !?

2018-07-26 Thread Torsten Hämmerle
Simon Albrecht-2 wrote
> The most sensible solution to me seems to be for Tie to use the 
> neutral-direction property and heed it in such cases, overriding the 
> direction if it is set.

Using Harm's example, setting Tie.neutral-direction to #DOWN will just flip
everything around.
Then, the first tie is up and the second tie is down.

All this only happens for opposite stem directions and tied notes on the
middle stave line, everything is quite unpredictable and the slightest
change in spacing etc. may flip a tie to any direction.

Robert's code will react very sensitive to changes like
   \override Tie.details.note-head-gap = …
When just changing this from standard #0.2 to #0.20001, the first tie will
change its direction.

Perhaps some penalty calculations yield nearly identical results for
different tie directions so that the slightest environmental change may
result in a tie direction change.

All the best,
Torsten



--
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


Re: tie direction !?

2018-07-26 Thread Simon Albrecht
The most sensible solution to me seems to be for Tie to use the 
neutral-direction property and heed it in such cases, overriding the 
direction if it is set.


Best, Simon


On 26.07.2018 13:34, Robert Schmaus wrote:

Might be the same thing as here:

http://lilypond.1069038.n5.nabble.com/Curious-thing-about-ties-td196616.html

On 26 Jul 2018, at 12:37, Thomas Morley > wrote:



Hi,

please consider the following example:

\version "2.19.82"

\relative c'' {
 f,1
 r4 b~ b8 a b4~
 b8 a b2.
 \repeat unfold 8 f8
}

The ties have different directions.
If you change the example a little bit you may (or may not) get equal
directions.

Where does it comes from?
Or wit different wording, what are the conditions for the tie's
direction applying here?

Thanks,
 Harm

___
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



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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread David Kastrup
David Kastrup  writes:

> David Kastrup  writes:
>
>> Thomas Morley  writes:
>>
>>> Hi,
>>>
>>> I stumbled across
>>> (equal?  #{ \voiceOne #} voiceOne)
>>> returning false.
>>>
>>> Is it expected behaviour?
>>
>> equal? is not implemented all that great for "probs" but Music::equal_p
>> is implemented in a manner where at least
>>
>> #(display (equal? voiceOne (ly:music-deep-copy voiceOne)))
>>
>> would be expected to display #t and it doesn't.
>>
>> Sigh.  I'll see what I can find out.
>
> Tracker issue: 5391 (https://sourceforge.net/p/testlilyissues/issues/5391/)
> Rietveld issue: 363740043 (https://codereview.appspot.com/363740043)
> Issue description:
>   Prob::equal_p: discard "origin" property  Previously elements of
>   class Input was considered equal when compared as part of Music
>   property lists but this did not take into account that some music
>   might store its origin (if any) at different locations in its
>   property lists.  So we just discard any "origin" property
>   completely, regardless of position in the property list and its
>   actual value type.   Also contains commit:  Don't set origin on
>   copied music explicitly  There would be some mild incentive if the
>   origin were accessed an inordinary amount of times (and thus leaving
>   it unset would maximize access times to it) but there is no evidence
>   for that.  One reason might be to ensure greater structural
>   similarity between copies of music, but Prob::equal_p has been
>   changed to be robust against differences here.

In the mean time, here is a workaround:

voiceOne = \voiceOne

Seriously.

-- 
David Kastrup

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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread David Kastrup
David Kastrup  writes:

> Thomas Morley  writes:
>
>> Hi,
>>
>> I stumbled across
>> (equal?  #{ \voiceOne #} voiceOne)
>> returning false.
>>
>> Is it expected behaviour?
>
> equal? is not implemented all that great for "probs" but Music::equal_p
> is implemented in a manner where at least
>
> #(display (equal? voiceOne (ly:music-deep-copy voiceOne)))
>
> would be expected to display #t and it doesn't.
>
> Sigh.  I'll see what I can find out.

Tracker issue: 5391 (https://sourceforge.net/p/testlilyissues/issues/5391/)
Rietveld issue: 363740043 (https://codereview.appspot.com/363740043)
Issue description:
  Prob::equal_p: discard "origin" property  Previously elements of
  class Input was considered equal when compared as part of Music
  property lists but this did not take into account that some music
  might store its origin (if any) at different locations in its
  property lists.  So we just discard any "origin" property
  completely, regardless of position in the property list and its
  actual value type.   Also contains commit:  Don't set origin on
  copied music explicitly  There would be some mild incentive if the
  origin were accessed an inordinary amount of times (and thus leaving
  it unset would maximize access times to it) but there is no evidence
  for that.  One reason might be to ensure greater structural
  similarity between copies of music, but Prob::equal_p has been
  changed to be robust against differences here.


-- 
David Kastrup

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


Re: tie direction !?

2018-07-26 Thread Robert Schmaus
Might be the same thing as here:

http://lilypond.1069038.n5.nabble.com/Curious-thing-about-ties-td196616.html

> On 26 Jul 2018, at 12:37, Thomas Morley  wrote:
> 
> Hi,
> 
> please consider the following example:
> 
> \version "2.19.82"
> 
> \relative c'' {
>  f,1
>  r4 b~ b8 a b4~
>  b8 a b2.
>  \repeat unfold 8 f8
> }
> 
> The ties have different directions.
> If you change the example a little bit you may (or may not) get equal
> directions.
> 
> Where does it comes from?
> Or wit different wording, what are the conditions for the tie's
> direction applying here?
> 
> Thanks,
>  Harm
> 
> ___
> 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: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread David Kastrup
Urs Liska  writes:

> Am 26.07.2018 um 11:57 schrieb Thomas Morley:
>> Hi,
>>
>> I stumbled across
>> (equal?  #{ \voiceOne #} voiceOne)
>> returning false.
>>
>> Is it expected behaviour?
>
> Check with \displayMusic, but I'd suspect that #{ \voiceOne #} might
> add an additional layer of sequential-music around the variable.

Nope.  Only for multiple included expressions.  It also tampers with the
'origin field, but the basic equal? test is supposed to ignore that.

-- 
David Kastrup

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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread Urs Liska




Am 26.07.2018 um 12:32 schrieb Thomas Morley:

2018-07-26 12:20 GMT+02:00 Urs Liska :


Am 26.07.2018 um 11:57 schrieb Thomas Morley:

Hi,

I stumbled across
(equal?  #{ \voiceOne #} voiceOne)
returning false.

Is it expected behaviour?


Check with \displayMusic, but I'd suspect that #{ \voiceOne #} might add an
additional layer of sequential-music around the variable.

Hi Urs,

thanks for your reply.

Though:

#(format #t "\nequal? ~a"
   (equal?
 (with-output-to-string (lambda () (display-lily-music voiceOne)))
 (with-output-to-string (lambda () (display-lily-music #{ \voiceOne #})

returns true.


What I meant is


voiceOne = { c' d' e' }

#(displayMusic voiceOne)
#(displayMusic #{ \voiceOne #})

But in fact that returns the same expressions as well.
So you should better go with David's insight ...


Thanks



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


tie direction !?

2018-07-26 Thread Thomas Morley
Hi,

please consider the following example:

\version "2.19.82"

\relative c'' {
  f,1
  r4 b~ b8 a b4~
  b8 a b2.
  \repeat unfold 8 f8
}

The ties have different directions.
If you change the example a little bit you may (or may not) get equal
directions.

Where does it comes from?
Or wit different wording, what are the conditions for the tie's
direction applying here?

Thanks,
  Harm

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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread David Kastrup
Thomas Morley  writes:

> Hi,
>
> I stumbled across
> (equal?  #{ \voiceOne #} voiceOne)
> returning false.
>
> Is it expected behaviour?

equal? is not implemented all that great for "probs" but Music::equal_p
is implemented in a manner where at least

#(display (equal? voiceOne (ly:music-deep-copy voiceOne)))

would be expected to display #t and it doesn't.

Sigh.  I'll see what I can find out.

-- 
David Kastrup

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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread Thomas Morley
2018-07-26 12:20 GMT+02:00 Urs Liska :
>
>
> Am 26.07.2018 um 11:57 schrieb Thomas Morley:
>>
>> Hi,
>>
>> I stumbled across
>> (equal?  #{ \voiceOne #} voiceOne)
>> returning false.
>>
>> Is it expected behaviour?
>
>
> Check with \displayMusic, but I'd suspect that #{ \voiceOne #} might add an
> additional layer of sequential-music around the variable.

Hi Urs,

thanks for your reply.

Though:

#(format #t "\nequal? ~a"
  (equal?
(with-output-to-string (lambda () (display-lily-music voiceOne)))
(with-output-to-string (lambda () (display-lily-music #{ \voiceOne #})

returns true.

Thanks

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


Re: Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread Urs Liska




Am 26.07.2018 um 11:57 schrieb Thomas Morley:

Hi,

I stumbled across
(equal?  #{ \voiceOne #} voiceOne)
returning false.

Is it expected behaviour?


Check with \displayMusic, but I'd suspect that #{ \voiceOne #} might add 
an additional layer of sequential-music around the variable.


Urs



And is the condition in the function below robust?

check =
#(define-music-function (mus) (ly:music?)
(music-map
  (lambda (m)
(if (equal? m #{ \voiceOne #})
;; below will never be #t
;(equal? m voiceOne)
(begin
  (display "\nvoiceOne found\n")
  m)
m))
  mus))

\check
{
   \voiceOne
   c'1
   \voiceTwo
   c'1
}



Thanks,
   Harm

___
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


Iterating music for voiceOne. Checking with equal?

2018-07-26 Thread Thomas Morley
Hi,

I stumbled across
(equal?  #{ \voiceOne #} voiceOne)
returning false.

Is it expected behaviour?


And is the condition in the function below robust?

check =
#(define-music-function (mus) (ly:music?)
   (music-map
 (lambda (m)
   (if (equal? m #{ \voiceOne #})
   ;; below will never be #t
   ;(equal? m voiceOne)
   (begin
 (display "\nvoiceOne found\n")
 m)
   m))
 mus))

\check
{
  \voiceOne
  c'1
  \voiceTwo
  c'1
}



Thanks,
  Harm

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


Re: Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread David Kastrup
Jan-Peter Voigt  writes:

> Hi Risto,
>
> you might go this way:
>
> lineThickness = 5
> \markup \override #`(thickness . ,lineThickness) \draw-hline
>
> That is semi-quote the pair with ` (instead of ') and then "unquote" the
> variable to retrieve the value with a comma (,)

Which is equivalent to

\markup \override #(cons 'thickness lineThickness) \draw-hline

Either will create a pair at "runtime" rather than directly in the
"Scheme reader" which does not access variables but rather creates
symbols when given an identifier.

-- 
David Kastrup

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


Re: Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread Risto Vääräniemi
Whoa! I would have never found that out by myself. :) Thanks Urs &
Jan-Peter. I have to check the Scheme link, too.

BR,
Risto

On 26 July 2018 at 10:40, Jan-Peter Voigt  wrote:

> Hi Risto,
>
> you might go this way:
>
> lineThickness = 5
> \markup \override #`(thickness . ,lineThickness) \draw-hline
>
> That is semi-quote the pair with ` (instead of ') and then "unquote" the
> variable to retrieve the value with a comma (,)
>
> HTH
> Jan-Peter
>
> Am 26.07.2018 um 09:35 schrieb Risto Vääräniemi:
> > Hi,
> >
> > I tried the following:
> >
> > lineThickness = 5
> > \markup \override #'(thickness . #lineThickness) \draw-hline
> >
> > But it seems I cannot give the variable inside the pair. This works:
> >
> > lineThicknessPair = #'(thickness . 5)
> > \markup \override #lineThicknessPair \draw-hline
> >
> > Is there any way to make it work with just a single number variable? I
> > even tried the variable without the '#' or replaced it with a '\'. I
> > just got different errors.
> >
> > BR,
> > Risto
> >
> >
> > ___
> > 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
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread Jan-Peter Voigt
Hi Risto,

you might go this way:

lineThickness = 5
\markup \override #`(thickness . ,lineThickness) \draw-hline

That is semi-quote the pair with ` (instead of ') and then "unquote" the
variable to retrieve the value with a comma (,)

HTH
Jan-Peter

Am 26.07.2018 um 09:35 schrieb Risto Vääräniemi:
> Hi,
> 
> I tried the following:
> 
> lineThickness = 5
> \markup \override #'(thickness . #lineThickness) \draw-hline
> 
> But it seems I cannot give the variable inside the pair. This works:
> 
> lineThicknessPair = #'(thickness . 5)
> \markup \override #lineThicknessPair \draw-hline
> 
> Is there any way to make it work with just a single number variable? I
> even tried the variable without the '#' or replaced it with a '\'. I
> just got different errors.
> 
> BR,
> Risto
> 
> 
> ___
> 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: Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread Urs Liska



Am 26.07.2018 um 09:35 schrieb Risto Vääräniemi:

Hi,

I tried the following:

lineThickness = 5
\markup \override #'(thickness . #lineThickness) \draw-hline

But it seems I cannot give the variable inside the pair. This works:

lineThicknessPair = #'(thickness . 5)
\markup \override #lineThicknessPair \draw-hline

Is there any way to make it work with just a single number variable? I 
even tried the variable without the '#' or replaced it with a '\'. I 
just got different errors.


You need a technique known as quasi-quoting.

In your code #'( means that you have a pair of literal symbols, i.e. a 
symbol "thickness" and a symbol "#lineThickness". The straight single 
quote tells Lily to "quote" everything inside the brackets.


What you need is to write the pair as #`(a . b) with a backtick instead 
of a straight single quote. This allows you to "unquote" individual 
elements with a comma:


lineThickness = 5
\markup \override #`(thickness . ,lineThickness) \draw-hline

See https://scheme-book.ursliska.de/scheme/quoting/ for some more info

HTH
Urs



BR,
Risto


___
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


Is it possible to replace a number with variable inside a pair?

2018-07-26 Thread Risto Vääräniemi
Hi,

I tried the following:

lineThickness = 5
\markup \override #'(thickness . #lineThickness) \draw-hline

But it seems I cannot give the variable inside the pair. This works:

lineThicknessPair = #'(thickness . 5)
\markup \override #lineThicknessPair \draw-hline

Is there any way to make it work with just a single number variable? I even
tried the variable without the '#' or replaced it with a '\'. I just got
different errors.

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