Get the MIDI tempo from a Lilypond score in Scheme

29 Views Asked by At

I have a set of Scheme functions that generate several MIDI files from a score. It does so by creating a book with several scores. I would like to have those MIDI files use the same MIDI setup as specified in the \midi{} block in the original score. Especially the tempo. Can that be extracted somehow? I know how to display the structure of music expressions and get properties, but Score is not a music expression. If I print it, I just get #, and I don't know what that means. I have read through the documentation but found no guide on how to traverse the structure of a #.

Does anyone have insights into working with scores from Scheme?

1

There are 1 best solutions below

0
brownian On

Try smth like this:

\context {
      \Score
      \include "midi-score-setup.lyi"
}

And put smth like tempoWholesPerMinute = #(ly:make-moment 18) in that file.

So you can put a required the same tempo in a single file and change it over there as you wish.