lilypond-auto
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 687 in lilypond: Enhancement: inequal MIDI qua


From: lilypond
Subject: Re: [Lilypond-auto] Issue 687 in lilypond: Enhancement: inequal MIDI quantization of equal durations (swing, rubato)
Date: Mon, 29 Oct 2012 18:36:52 +0000


Comment #34 on issue 687 by address@hidden: Enhancement: inequal MIDI quantization of equal durations (swing, rubato)
http://code.google.com/p/lilypond/issues/detail?id=687

Thanks for your encouragement. Dean (?), the code is supposed to work for weight lists of arbitrary length, though I did not test this extensively. If you have problems compiling the test file, please let me know, it works fine here with both LilyPond 2.16.0 and the current git version.

Adam, such a functionality for velocities would certainly be nice, too, yet I agree that this should be treated separately. My scheme function map-events-with-timing might come in handy again then, though.

[Actually, I was tempted to give this a shot at once. With the lessons learned here, the scheme side would seem to be quite simple, IF there were an interface for manipulating the velocity for individual NoteEvents.

Unfortunately, there does not seem to be one, so I checked some of LilyPond's MIDI performer source code to find out if it would be difficult to implement. It might be, I'm afraid, for me at least. Please forgive my ranting, but the MIDI subsystem appears to be an opaque mess of multi-layered levels of abstraction with essentially no documentation or useful code comments. And sorry, when I read a class called Midi_walker documented with "walk audio and output midi", I almost feel mocked. Maybe I'll try again another time, but for now I'm scared away.]

None of the points you raised in comment #15 should be a problem for my implementation. My functions never change the length of a full swing cycle, and they should work correctly with syncopated rhythms (as the test file is supposed to demonstrate). That's because the logic is concerned less with note durations than with the position of boundaries between notes. To quote my source comments,

;;   ... \applySwing operates by shifting the boundary
;;   between two events if it falls on an off-beat multiple of
;;   swingDiv. Assuming forward shift (backward shift works
;;   analogously), this is done by first lengthening the earlier
;;   event, then shortening the following event(s) by the same amount.

While my parameterization of the groove is quite different from the one you proposed in comment #6, I believe it should be general enough for all the cases you mentioned. For example you get a Viennese Waltz lilt with

   \applySwing 4 #'(3 5 4) ...  % second note starts 1/16 early
   \applySwing 4 #'(3/16 5/16 1/4) ...  % equivalent

   \applySwing 4 #'(7 9 8) ...  % second note starts 1/32 early
   \applySwing 4 #'(7/32 9/32 1/4) ...  % equivalent

or something in between, depending on how pronounced you want to have the effect. Of course you could define more convenience functions like my \tripletFeel, for example (untested):

  vienneseWaltzLilt = #(define-music-function
   (parser location headStart music)
   (ly:duration? ly:music?)
   (_i "Apply a Viennese Waltz lilt to music, in which the second
  quarter note beat starts early by a duration headStart."
   (let* ((a (- 1/4 (ly:moment-main (ly:duration-length headStart))))
          (b (- 2/4 a))
    #{ \applySwing 4 #'($a $b 1/4) $music #}))

  \vienneseWaltzLilt 16 { ... }
  \vienneseWaltzLilt 32 { ... }

No automatism for adapting to tempo changes is included, but I guess it should be possible to do this at a higher level, without changing my definitions.




reply via email to

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