On 25/04/2008, Valentin Villenave <[EMAIL PROTECTED]> wrote: > 2008/4/25 Neil Puttock <[EMAIL PROTECTED]>: > > > > That's good, but there are two problems with it; one quite serious if > > you value having MIDI output. > > > I don't, so I don't care :) > > > > First, you haven't set tempoWholesPerMinute properly, unfortunately > > (it's the same problem I was scratching my head about in the original > > thread): the combination of the note value and beats per minute needs > > to be converted to a moment. > > > > Yes. We need a string->moment function, as well as a better string->duration.
Indeed, but in this case what's needed is a (string beat)->moment function. > > Second, unlike the helper function parse-simple-duration, > > string->duration doesn't account for durations longer than a semibreve > > since they can't be directly converted to a number. > > > Ideal answer: oh yes, that is definitely a limitation. > Pragmatic answer : hmm, do we really need \breve in metronome marks? I agree that it's not really a big issue, but on that rare occasion when somebody wants to use \breve or \longa, they'll get a nasty surprise and a failed file. This could be solved easily *if* parse-simple-duration can be made public , so it can be accessed from a .ly file. Then it's just a matter of changing string->duration to the following: #(define (string->duration duration) (let ((parsed (parse-simple-duration duration))) (ly:make-duration (car parsed) (cadr parsed))) ) Then again, there may be a good reason why it's not (define-public ...) already. > > So, in conclusion, close but no cigar. ;) > > > Hey, now it's your turn! The main issue I've been working on was: how > to pass the text string as an argument to the metronomeMarkFormatter. > Currently, it's a bit dirty (and heavy) but at least it produces a > decent graphical output. I don't (yet) understand ly:make-duration and > ly:make-moment well enough to improve the MIDI result. Well, I have been trying to work it out, but I think your scheme knowledge is much greater than mine at the moment (and I'm a bit preoccupied with \sacredHarpHeads; can you suggest any improvements to my code?) If the MIDI problem can be solved, I think this would prove a better snippet than the one I added, since it works under 2.10. Regards, Neil _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user