lilypond-devel
[Top][All Lists]
Advanced

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

Re: Event listener to extract (some) music events. (issue4373046)


From: percival . music . ca
Subject: Re: Event listener to extract (some) music events. (issue4373046)
Date: Fri, 08 Apr 2011 03:09:46 +0000

@Valentin's overall comment: we've had 2 or 3 people on -devel asking
about this functionality in 2011, so I think it's definitely worth
demonstrating the possibility -- and in many cases, the current file is
enough for whatever they'd want to do.  (maybe after adding one or two
more things, such as ties)

The current file doesn't have all that many things hard-coded.  Granted,
the "staff instrument name -> filename" might seem a bit arbitrary, and
the lack of supporting stuff like "lilypond foo.ly bar.ly" might not be
ideal, but I think it's still a huge step forward for researchers who
aren't intimately aware of our scheme stuff.

If there's strong opposition to having it in ly/, then I could live with
it being in Documentation/snippets/new/.  However, I think think the
current file is general enough, and would be useful enough, that it's
worth putting in it ly/ so that anybody can use it easily.


Massive refactoring; it should be much cleaner now.  I kind-of suspect
that I'll be asked to use optional arguments instead of
print-one-two-three-four, but this is what I have so far.


http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly
File input/regression/event-listener-output.ly (right):

http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly#newcode17
input/regression/event-listener-output.ly:17: st =
On 2011/04/07 13:30:21, Valentin Villenave wrote:
Is it really necessary to use a function for text spanners? (In which
case you
should seriously adding that to music-functions.ly)

I've considered the text span format to be horrible for the past few
years.  I can't remember if I ever added an issue for it, though.

Oh, and you might as well
want to make it postfix:

http://git.savannah.gnu.org/cgit/opus-libre.git/tree/doc/snippets/postfix-text-spanners.ly#n12

Hmm.  That file needs a .0 for the version (or ideally, move that to
2.13.58 so that people can try to compile it), and you need an = after
the texidoc.

When I tried it to use it in this regtest, though, I got some weird
errors.

Could you propose adding your function to music-functions.ly ?

http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly#newcode40
input/regression/event-listener-output.ly:40: d16(\downbow cis b a) g4
\breathe e8\p( g) fis4
On 2011/04/07 13:30:21, Valentin Villenave wrote:
I'd \upbow here (a matter of taste? :)

that would make the \breathe more awkward.  It's easier for a human to
control the bow at the frog, so being on an upbow for the g4 makes the
\breathe and subsequent e8\p easier to play.

http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly#newcode45
input/regression/event-listener-output.ly:45: b4\p\<( d8 cis) d4(-.
fis8-.^"II" e-.^"II")
On 2011/04/07 13:30:21, Valentin Villenave wrote:
Similarly: how about ais and eis instead of a and e?

I wanted to really show that Vivi could play the same pitch as an open
string, but with a finger on a different string.
Sure, it's obvious to a violinist that if you can play ais on the D
string, then you can also play a.  I'm happy with the loss of a bit of
"harmonic strength" in order to clarify the technical ability.

http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly#newcode56
input/regression/event-listener-output.ly:56: a16\mp e' a e' a,,32\f e'
a e' r8 r4
On 2011/04/07 13:30:21, Valentin Villenave wrote:
Any slurs missing here?

in the pizz section?  No, it's quite unusual to add slurs to pizz, other
than the l.v. type of "slur" (which is more like a tie, anyway)

http://codereview.appspot.com/4373046/diff/1/input/regression/event-listener-output.ly#newcode69
input/regression/event-listener-output.ly:69: << \vlnone >>
On 2011/04/07 13:30:21, Valentin Villenave wrote:
Is this considered good/sugar-ish syntax?

Maybe?  What did you have in mind?

I tend to always use << >> for my music expressions in a score so that
if I ever add a \vlntwo or \cello, it doesn't go berserk.  If I used a
{} around the \vlnone, or if I put the \vlnone in directly, then adding
a \vlntwo would blow up in interesting ways.

I suppose I could add some linebreaks and indentation?

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly
File ly/event-listener.ly (right):

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode36
ly/event-listener.ly:36: (string-concatenate (list
On 2011/04/07 13:42:54, MikeSol wrote:
Move close brackets up to previous argument
'instrumentName)))

Done.

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode40
ly/event-listener.ly:40: 2 )
On 2011/04/07 13:42:54, MikeSol wrote:
(+ (string-r-index (object->string (command-line)) #\sp)

Same formatting below

Done.

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode40
ly/event-listener.ly:40: 2 )
On 2011/04/07 13:30:21, Valentin Villenave wrote:
What about .ily extensions? I'd use a regexp here, much simpler and
more
flexible.

You have an odd definition of "simpler", if you think that writing a
regexp is simpler than cut&paste from LSR.  :)

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode40
ly/event-listener.ly:40: 2 )
On 2011/04/07 13:42:54, MikeSol wrote:
This fails (I think) when people do batch file processing.

hmm, probably.  I don't have the parser, though (and I don't think I can
get the parser from just the engraver?)

I'm open to suggestions for this... I couldn't remember any better way
to do it, other than Neil's solution which relied on having the parser.

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode53
ly/event-listener.ly:53:
On 2011/04/07 13:42:54, MikeSol wrote:
(/ (ly:moment-main-numerator moment)
    (ly:moment-main-denominator moment))))

done.

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode87
ly/event-listener.ly:87: (+ 60 (ly:pitch-semitones pitch))
On 2011/04/07 13:30:21, Valentin Villenave wrote:
Do you want to hardcode that?

The 60 is for MIDI pitch value output.  (well, I should definitely
comment it!)

http://codereview.appspot.com/4373046/diff/1/ly/event-listener.ly#newcode190
ly/event-listener.ly:190: (cdr (car (cdr (car (cdr (car (car
On 2011/04/07 13:42:54, MikeSol wrote:
I'd remove this bit.

oh, I know it's bad -- but how else can I get the text value of the
left-hand bounds of a TextSpanner ?  :(

A while ago I had kicked around the idea of meta-data in LilyPond.  I
used it to
compose a piece and it worked ok.  For this sorta thing, it seems like
implementing meta-data would be a good idea.  Otherwise, you're making
assumptions about the location of information that may be volatile in
future
versions of LilyPond.

I'd love to have a "user-event" (just like note-event and the like),
which just contains a list which the user can put whatever he wants
into.  I could then put data into my user-event with the custom "\st
string number" music function, expressive markings like "dolce" or
"espr", etc.

I was going to look into that once the first step of the event listener
was pushed.

http://codereview.appspot.com/4373046/



reply via email to

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