lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with \cueDuring and events


From: Thomas Morley
Subject: Re: problems with \cueDuring and events
Date: Sun, 14 Apr 2019 13:32:04 +0200

Am So., 14. Apr. 2019 um 12:05 Uhr schrieb Werner LEMBERG <address@hidden>:
>
>
> >> > `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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]