problems with \cueDuring and events

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

problems with \cueDuring and events

Werner LEMBERG

Attached is an image of the regression suite file
`quote-cue-event-types.ly'.  Note that the grace not slash is missing
in the `curDuring' line.  I consider this a bug, and I tried to fix
it.  However, I wasn't able to locate the proper event which is
responsible for that.  Any help is greatly appreciated.

In a similar vein, I want to add tremolo stems and beams.  The former
works fine, but the latter does not – it fails even if using
`\quoteDuring', which is expected to contain all events (see attached
MWE).  Does anybody have an idea what's going on?


    Werner

quoteMe = \relative { \repeat tremolo 4 { b16 c) } }
\addQuote quoteMe \quoteMe

<<
  \new Staff \with { instrumentName = "Quoted Voice" } {
    \quoteMe
  }
  \new Staff \with { instrumentName = "quoteDuring" } {
    \relative { c'8 \quoteDuring "quoteMe" { s8 s4 } }
  }
  \new Staff {
    \relative { c'8 \cueDuring "quoteMe" #UP { r8 r4 } }
  }
>>

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

quote-cue-event-types.png (26K) Download Attachment
quote-cue-tremolo.png (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
Am Fr., 5. Apr. 2019 um 14:27 Uhr schrieb Werner LEMBERG <[hidden email]>:

>
>
> Attached is an image of the regression suite file
> `quote-cue-event-types.ly'.  Note that the grace not slash is missing
> in the `curDuring' line.  I consider this a bug, and I tried to fix
> it.  However, I wasn't able to locate the proper event which is
> responsible for that.  Any help is greatly appreciated.
>
> In a similar vein, I want to add tremolo stems and beams.  The former
> works fine, but the latter does not – it fails even if using
> `\quoteDuring', which is expected to contain all events (see attached
> MWE).  Does anybody have an idea what's going on?

Hi Werner,

acciaccatura contains
    \temporary \override Flag.stroke-style = #"grace"
reverting it at the end.

Per default override/revert is not quoted.
You may extend quotedCueEventTypes by `Override´ and `Revert´ to get
the slashed grace.
Though, now _all_ overrides will be quoted.

`Override´ and `Revert´ are not listed in the IR but in define-event-classes.scm
Not sure why `OverrideProperty´ and `RevertProperty´ is not sufficient.

Below an example, also including your patch form
https://sourceforge.net/p/testlilyissues/issues/5506/

\version "2.19.82"

\layout {
  \context {
    \Score
      quotedCueEventTypes = #'(
        ;;;; default
        note-event
        rest-event
        tie-event
        beam-event
        tuplet-span-event
        ;;;; added
        slur-event
        tremolo-event
        ;; see define-event-classes.scm
        Override
        Revert
        )
  }
  \context {
    \CueVoice
    \override StemTremolo.beam-thickness = #0.35
  }
}


quoteMe = \relative {
fis'8 r16-. a8.->
\displayMusic
\acciaccatura {
\once \override NoteHead.color = #red
c8
}
b4:8(-\ff~  b16 c8. b8)
}
\addQuote quoteMe \quoteMe

<<
  \new Staff \with { instrumentName = "Quoted Voice" } {
    \quoteMe
  }
  \new Staff \with { instrumentName = "quoteDuring" } {
    \relative { c'8 \quoteDuring "quoteMe" { s8 s4 s2 } }
  }
  \new Staff \with { instrumentName = "cueDuring" } {
    \relative { c'8 \cueDuring "quoteMe" #UP { r8 r4 r2 } }
  }
>>

Cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Werner LEMBERG

> acciaccatura contains
>     \temporary \override Flag.stroke-style = #"grace"
> reverting it at the end.
>
> Per default override/revert is not quoted.  You may extend
> quotedCueEventTypes by `Override´ and `Revert´ to get the slashed
> grace.

Aah!  Thanks a lot!

> Though, now _all_ overrides will be quoted.

OK.

> `Override´ and `Revert´ are not listed in the IR but in
> `define-event-classes.scm'.

This is something which should be fixed!  I had a look how the
documentation gets generated, but it is far too much Scheme code for
me, alas.  Can you perhaps provide a fix?

> Not sure why `OverrideProperty´ and `RevertProperty´ is not
> sufficient.

Maybe because `{Override,Revert}Property' are music expressions and
not events?

The last riddle are tremolo beams: This MWE

  \version "2.19.82"

  \layout {
    \context {
      \Score
        quotedCueEventTypes = #'(
          note-event
          rest-event
          tie-event
          beam-event
          tuplet-span-event
          tremolo-event
          tremolo-span-event
          Override
          Revert
          )
    }
  }

  quoteMe = \relative {
    fis'8 fis4. \repeat tremolo 4 { b16 c }
  }
  \addQuote quoteMe \quoteMe

  <<
    \new Staff \with { instrumentName = "Quoted Voice" } {
      \quoteMe
    }
    \new Staff \with { instrumentName = "quoteDuring" } {
      \relative { c'8 \quoteDuring "quoteMe" { s2.. } }
    }
  >>

causes the attached output.  Are there still some events missing?


    Werner

GNU LilyPond 2.21.0
Processing `q.ly'
Parsing...
Interpreting music...
Interpreting music...
q.ly:22:13: warning: unterminated chord tremolo
fis'8 fis4.
            \repeat tremolo 4 { b16 c }
Preprocessing graphical objects...
q.ly:22:37: programming error: cyclic dependency: calculation-in-progress encountered for #'direction (Stem)
fis'8 fis4. \repeat tremolo 4 { b16
                                    c }
q.ly:22:37: continuing, cross fingers
programming error: Grob direction requested while calculation in progress.
continuing, cross fingers
q.ly:22:33: programming error: cyclic dependency: calculation-in-progress encountered for #'direction (Stem)
fis'8 fis4. \repeat tremolo 4 {
                                b16 c }
q.ly:22:33: continuing, cross fingers
programming error: Grob direction requested while calculation in progress.
continuing, cross fingers
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
q.ly:22:33: programming error: cyclic dependency: calculation-in-progress encountered for #'stem-begin-position (Stem)
fis'8 fis4. \repeat tremolo 4 {
                                b16 c }
q.ly:22:33: continuing, cross fingers
q.ly:22:33: programming error: ly:stem::calc-length called but will not be used for beamed stem.
fis'8 fis4. \repeat tremolo 4 {
                                b16 c }
q.ly:22:33: continuing, cross fingers
q.ly:22:37: programming error: cyclic dependency: calculation-in-progress encountered for #'stem-begin-position (Stem)
fis'8 fis4. \repeat tremolo 4 { b16
                                    c }
q.ly:22:37: continuing, cross fingers
q.ly:22:37: programming error: ly:stem::calc-length called but will not be used for beamed stem.
fis'8 fis4. \repeat tremolo 4 { b16
                                    c }
q.ly:22:37: continuing, cross fingers
Layout output to `/tmp/lilypond-73hoNr'...
Converting to `q.pdf'...
Deleting `/tmp/lilypond-73hoNr'...
Success: compilation successfully completed

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel

q.png (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
Am So., 7. Apr. 2019 um 19:20 Uhr schrieb Werner LEMBERG <[hidden email]>:

>
>
> > acciaccatura contains
> >     \temporary \override Flag.stroke-style = #"grace"
> > reverting it at the end.
> >
> > Per default override/revert is not quoted.  You may extend
> > quotedCueEventTypes by `Override´ and `Revert´ to get the slashed
> > grace.
>
> Aah!  Thanks a lot!
>
> > Though, now _all_ overrides will be quoted.
>
> OK.
>
> > `Override´ and `Revert´ are not listed in the IR but in
> > `define-event-classes.scm'.
>
> This is something which should be fixed!  I had a look how the
> documentation gets generated, but it is far too much Scheme code for
> me, alas.  Can you perhaps provide a fix?

Tbh, I've no clue how the docs are created.
Could you give me some pointers where to look?

>
> > Not sure why `OverrideProperty´ and `RevertProperty´ is not
> > sufficient.
>
> Maybe because `{Override,Revert}Property' are music expressions and
> not events?
>
> The last riddle are tremolo beams: This MWE
>
>   \version "2.19.82"
>
>   \layout {
>     \context {
>       \Score
>         quotedCueEventTypes = #'(
>           note-event
>           rest-event
>           tie-event
>           beam-event
>           tuplet-span-event
>           tremolo-event
>           tremolo-span-event
>           Override
>           Revert
>           )
>     }
>   }
>
>   quoteMe = \relative {
>     fis'8 fis4. \repeat tremolo 4 { b16 c }
>   }
>   \addQuote quoteMe \quoteMe
>
>   <<
>     \new Staff \with { instrumentName = "Quoted Voice" } {
>       \quoteMe
>     }
>     \new Staff \with { instrumentName = "quoteDuring" } {
>       \relative { c'8 \quoteDuring "quoteMe" { s2.. } }
>     }
>   >>
>
> causes the attached output.  Are there still some events missing?

I doubt there are events missing. I even tried:

%% Needed for `ly:symbol-ci<?´
%% `symbol<?´ would work without lily-sort.scm
#(ly:load "lily-sort.scm")

%% Others somewhere?
#(define all-events
  (sort
    (delete-duplicates
      (append
        (append-map
          (lambda (x) (assoc-get 'types (cdr x)))
          music-descriptions)
        (append-map cdr (@@ (lily) event-classes))))
    ;symbol<?
    ly:symbol-ci<?
    ))

%#(pretty-print all-events)

\layout {
  \context {
    \Score
      quotedEventTypes =
      #all-events
  }
}

quoteMe = \relative {
  fis'8 fis4. \repeat tremolo 4 { b16 c } r1
}
\addQuote quoteMe \quoteMe

<<
  \new Staff \with { instrumentName = "Quoted Voice" } {
    \quoteMe
  }
  \new Staff \with { instrumentName = "quoteDuring" } {
    \relative { c'8 \quoteDuring "quoteMe" { s2.. } cis1 }
  }
>>

To no avail.

So I tend to think it has to do how quotes are processed.
You can get the stored quote with

#(pretty-print
  (hash-ref (module-ref (current-module) 'musicQuotes) "quoteMe")
  )

Which returns a vector with entries
for
- moment and pitch (I think it's a reference pitch)
- a stream-event
- a boolean (no clue for which purpose)


Though, I'm at a loss how to get deeper.



Cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Werner LEMBERG

>> > `Override´ and `Revert´ are not listed in the IR but in
>> > `define-event-classes.scm'.
>>
>> This is something which should be fixed!  I had a look how the
>> documentation gets generated, but it is far too much Scheme code
>> for me, alas.  Can you perhaps provide a fix?
>
> Tbh, I've no clue how the docs are created.  Could you give me some
> pointers where to look?

The top entry point for the creation of the event class documentation
is function `music-doc-node' in file `document-music.scm', called from
`documentation-generate.scm'.  This function calls `music-types-doc',
mapping `music-type-doc' onto a hash table with the event class names.
It seems to me that this hash table lacks `Override' and `Revert'.

>> [...] Are there still some events missing?
>
> I doubt there are events missing.  I even tried [...] To no avail.
>
> So I tend to think it has to do how quotes are processed.  [...]
> Though, I'm at a loss how to get deeper.

David K., can you help?


    Werner
_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
Am So., 14. Apr. 2019 um 12:05 Uhr schrieb Werner LEMBERG <[hidden email]>:

>
>
> >> > `Override´ and `Revert´ are not listed in the IR but in
> >> > `define-event-classes.scm'.
> >>
> >> This is something which should be fixed!  I had a look how the
> >> documentation gets generated, but it is far too much Scheme code
> >> for me, alas.  Can you perhaps provide a fix?
> >
> > Tbh, I've no clue how the docs are created.  Could you give me some
> > pointers where to look?
>
> The top entry point for the creation of the event class documentation
> is function `music-doc-node' in file `document-music.scm', called from
> `documentation-generate.scm'.  This function calls `music-types-doc',
> mapping `music-type-doc' onto a hash table with the event class names.
> It seems to me that this hash table lacks `Override' and `Revert'.

Ok, I've found that stuff. Though, meanwhile I think the problem is
more complicated or confusing, at least to me.
First I tried to understand what's it all about those
events/classes/types/parents and children.
No point in attempting to fix something I do not understand.

It looks like the types from `music-descriptions´ can be used for p.e.
music-functions, but those from `event-classes´ for engravers.
If that's true than `event-classes´ shouldn't be part of
`music-descriptions´, but how to document then?

To illustrate:

mus = { \override NoteHead.color = #red b1 }

#(music-map
  (lambda (m)
    (newline)
    (cond ((music-is-of-type? m 'override-property-event)
           (format
             #t
             "\noverride-property-event from music-map:\ntypes: ~a\nevent: ~a"
             (ly:music-property m 'types)
             m))
          ;; never triggered, not a type?
          ((music-is-of-type? m 'Override)
           (format
             #t
             "\nOverride from music-map:\ntypes: ~a\nevent: ~a"
             (ly:music-property m 'types)
             m))
          ((music-is-of-type? m 'note-event)
           (format
             #t
             "\nnote-event from music-map:\ntypes: ~a\nevent:~a"
             (ly:music-property m 'types)
             m)))
    m)
  mus)

tst =
#(lambda (ctx)
  (make-engraver
    (listeners
      ((Override engraver event)
        (newline)
        (format
          #t
          "\nOverride from engraver:\nclass: ~a\nevent: ~a"
          (ly:event-property event 'class)
          event))
      ;; never triggered, not a class?
      ((override-property-event engraver event)
        (newline)
        (format
          #t
          "\noverride-property-event from engraver:\nclass: ~a\nevent: ~a"
          (ly:event-property event 'class)
          event))
      ((note-event engraver event)
        (newline)
        (format
          #t
          "\nnote-event from engraver:\nclass: ~a\ntypes: ~a\nevent: ~a"
          (ly:event-property event 'class)
          (ly:prob-property (ly:prob-property event 'music-cause) 'types)
          event))
      )))

\score {
  \mus
  \layout {
    \context {
      \Voice
      \consists \tst
    }
  }
}

It's very confusing several are named equal.
P.e. note-event
It pops up as a type and a class. Is it both or not ??
I don't feel I get closer ...

Anyway, here all entries of `event-classes´ not present in `music-descriptions´
  Announcement
  AnnounceNewContext
  ChangeParent
  CreateContext
  Finish
  GraceChange
  music-event
  OldMusicEvent
  OneTimeStep
  Override
  Prepare
  RemoveContext
  Revert
  SetProperty
  StreamEvent
  UnsetProperty

For none of them I found any documentation.

There are also several types in `music-descriptions´ not present in
`event-classes´, fwiw.

Only thing I managed so far is
https://sourceforge.net/p/testlilyissues/issues/5510/
curing a warning while running generate-documentation.ly

So far, cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
In reply to this post by Werner LEMBERG
Am So., 14. Apr. 2019 um 12:05 Uhr schrieb Werner LEMBERG <[hidden email]>:

> > I doubt there are events missing.  I even tried [...] To no avail.
> >
> > So I tend to think it has to do how quotes are processed.  [...]
> > Though, I'm at a loss how to get deeper.
>
> David K., can you help?

As far as I understand, it's the partcombiner at work here.
At least:

\version "2.21.0"

%% use \partcombine with lowercase "c" for lower versions
\partCombine
  \relative { fis'8 fis4. \repeat tremolo 4 { b16 c } r1 }
  \relative { c'8 s2..  cis1 }

returns similiar warnings and output.

Cheers,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

David Kastrup

Thomas Morley <[hidden email]> writes:

> Am So., 14. Apr. 2019 um 12:05 Uhr schrieb Werner LEMBERG <[hidden email]>:
>
>> > I doubt there are events missing.  I even tried [...] To no avail.
>> >
>> > So I tend to think it has to do how quotes are processed.  [...]
>> > Though, I'm at a loss how to get deeper.
>>
>> David K., can you help?
>
> As far as I understand, it's the partcombiner at work here.

It is common infrastructure, recording-group-emulate I think (and likely
in scm/part-combiner.scm).  It only picks up a single bottom context,
ignoring the rest.  I am currently on my yearly climbing vacation in
Italy.  This does involve sampling of the local wine so I am not really
in a condition to analyse this to any useful detail before hitting the
bed.

I'll try taking a look tomorrow but am doubtful that I have much more of
a clue about it.

--
David Kastrup


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
In reply to this post by Thomas Morley-2
Am So., 14. Apr. 2019 um 22:44 Uhr schrieb David Kastrup <[hidden email]>:
> I am currently on my yearly climbing vacation in
> Italy.  This does involve sampling of the local wine

Enjoy it!


Best,
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Dan Eble
In reply to this post by Thomas Morley-2
On Apr 14, 2019, at 08:10, Thomas Morley <[hidden email]> wrote:

>
> As far as I understand, it's the partcombiner at work here.
> At least:
>
> \version "2.21.0"
>
> %% use \partcombine with lowercase "c" for lower versions
> \partCombine
>  \relative { fis'8 fis4. \repeat tremolo 4 { b16 c } r1 }
>  \relative { c'8 s2..  cis1 }
>
> returns similiar warnings and output.

I wasn’t paying much attention until “partcombiner.”  Now I’m reading through this thread in the archive, but I’m having trouble making the connection.  Was the part combiner involved at all before this mention?

Similar warnings could simply indicate a shared cause.

Regards,

Dan


_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: problems with \cueDuring and events

Thomas Morley-2
Am Mo., 15. Apr. 2019 um 02:26 Uhr schrieb Dan Eble <[hidden email]>:

>
> On Apr 14, 2019, at 08:10, Thomas Morley <[hidden email]> wrote:
> >
> > As far as I understand, it's the partcombiner at work here.
> > At least:
> >
> > \version "2.21.0"
> >
> > %% use \partcombine with lowercase "c" for lower versions
> > \partCombine
> >  \relative { fis'8 fis4. \repeat tremolo 4 { b16 c } r1 }
> >  \relative { c'8 s2..  cis1 }
> >
> > returns similiar warnings and output.
>
> I wasn’t paying much attention until “partcombiner.”  Now I’m reading through this thread in the archive, but I’m having trouble making the connection.  Was the part combiner involved at all before this mention?
>
> Similar warnings could simply indicate a shared cause.
>
> Regards,
> —
> Dan
>

Yep, after further research I think it has nothing to do with the
partcombiner itself. Rather the problem with \repeat tremolo is
present here in the quoting-topic _and_ in the partcombiner.

Related issues for the partcombiner:
https://sourceforge.net/p/testlilyissues/issues/5281/
https://sourceforge.net/p/testlilayissues/issues/3374/

For the quoting-stuff I probably found the cause of the trouble,
although I've no clue how to fix.

%% Let's look at an example:

quoteMe =
{ r2 <>\< \repeat tremolo 8 { c''32 d'' } e''1\! }
\addQuote quoteMe \quoteMe

%% And some diagnostic code:

#(define display-some-event-props
  (lambda (ctx event)
    (let ((mus-cause (ly:prob-property event 'music-cause)))
      (format #t "\nFound ~a at ~a with span-direction ~a"
        (ly:prob-property mus-cause 'name)
        (ly:context-current-moment ctx)
        (ly:prob-property mus-cause 'span-direction)))))

eng =
#(lambda (ctx)
  (make-engraver
    (listeners
      ((crescendo-event engraver event)
        (display-some-event-props ctx event))
      ((tremolo-span-event engraver event)
        (display-some-event-props ctx event)))
    (acknowledgers
      ((beam-interface engraver grob source-engraver)
       (format #t "\n\nBeam created by ~a starts at ~a"
         source-engraver
         (ly:context-current-moment ctx))))
    (end-acknowledgers
      ((beam-interface engraver grob source-engraver)
       (format #t "\nBeam created by ~a ends at ~a\n"
         source-engraver
         (ly:context-current-moment ctx))))))

%% Calling the example code

\new Voice \with { \consists \eng } \quoteMe

%% returns in terminal:
%% Found CrescendoEvent at #<Mom 1/2> with span-direction -1
%% Found TremoloSpanEvent at #<Mom 1/2> with span-direction -1
%%
%% Beam created by #<Translator Chord_tremolo_engraver > starts at #<Mom 1/2>
%% Beam created by #<Translator Chord_tremolo_engraver > ends at #<Mom 3/4>
%%
%% Found TremoloSpanEvent at #<Mom 1> with span-direction 1
%% Found CrescendoEvent at #<Mom 1> with span-direction 1

%% Note the ending TremoloSpanEvent at #<Mom 1> (like the crescendo)
%% But the beam ends at #<Mom 3/4>

%% If you now try, i.e. the tremolo-end is _not_ quoted,
\new Voice \with { \consists \eng } { c''2 \quoteDuring "quoteMe" { s2 }  d''1 }

%% then you see in terminal among others:
%%
%% Found CrescendoEvent at #<Mom 1/2> with span-direction -1
%% Found TremoloSpanEvent at #<Mom 1/2> with span-direction -1
%%
%% Beam created by #<Translator Chord_tremolo_engraver > starts at #<Mom 1/2>
%% Beam created by #<Translator Chord_tremolo_engraver > ends at #<Mom 3/4>
%%
%% Beam created by #<Translator Chord_tremolo_engraver > ends at #<Mom 1>

%% Neither tremolo nor crescendo is ended, the Beam is ended twice ... a mess
%% For the Hairpin a warning is done, nothing more,
%% The Chord_tremolo_engraver warns as well but is not that smart later,
%% Several programming errors are thrown.

%% But if you ensure the tremolo-end is quoted as well, all's fine:
\new Voice \with { \consists \eng } { c''2 \quoteDuring "quoteMe" { s1 }  d''2 }


So the culprit seems to be the tremolo is per design ended at the
following timestep, which may or may not be in the quote.

So far my findings, best
  Harm

_______________________________________________
lilypond-devel mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-devel