I think LilyPond must have the full score to create the MIDI, it doesn't happen measure by measure.

John O'Hagan wrote:
Why is it important to play the midi file during generation?

I'm glad you asked! The program is intended to have a performance mode: you enter a set of requirements and restrictions on the command-line (this is the creative part!) and then see what it produces.

The program then does some combinatorial number-crunching, which can take a long time to complete - in some cases unrealistically long. However, it uses Python generators, so that each small unit of output (i.e., bar) is yielded immediately and then forgotten about, and we begin to see output straight away. Without this feature, some of the larger operations would simply fill the memory and never complete. This way, it can begin to "perform" immediately.

Of course, it is possible to play midi files (or scores) produced by Lilypond at the end of the process, but that may be much later, or never.

To date, I've been using the sox synth to play the results, but that's pretty limited; and then by triggering some piano samples, but I realized I was re-inventing midi; and since my program already includes a function to convert my numerical representation of music into Lilypond-friendly strings, the midi data is already being produced.
If only I could get my hands on it!

John O'Hagan wrote:
Hi,

I'm using Lilypond to print the results of an algorithmic music program
written in Python.

I'm looking for a way to play the results as they are produced (i.e bar
by bar), and it occurred to me that simply playing Lilypond midi files
with a midi player would do the trick.

However, I can't figure out how to get Lilypond's midi data sent to
stdout, where it could then be read from stdin by a player. Whatever I
try (including python pipes and even plain shell pipes) it just writes
the file to my home directory.

Is there any way around this?

Regards,

John O'Hagan



_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to