Am Sun, 12 Feb 2012 16:51:14 +0000 schrieb Richard Shann <[email protected]>:
> It occurred to me a month or so ago that with just a few primitive > commands added to Denemo we could generate the MIDI for playback from > scheme. This would make it much easier to implement things like > repeats, less mechanical note lengths and so on. > With Nils working on a more MIDI oriented program, I wondered if there > was a possibility of developing the algorithm for MIDI generation in > an abstract form, so that it could easily be implemented for any > program by providing primitives for the basic operations of stepping > through a score. > Does anyone fancy writing such a top-level description of MIDI > generation from a score? Has anyone listened to other attempts at > this, e.g. LilyPond's MIDI output? > > Richard I use Python but I still use libsmf, the python bindings are done by Dominic Sacre. The core of my midi generation is a cursor that goes through the score, step by step from the beginning to the end. Each object in the score has "exportMidi" method, which returns or directly adds the midi byte object to the midi stream/libsmf. The clue here is that the cursor gathers data which can be used for better midi generation. For example if there is a keysig change or instrument change the cursor can save that and all following notes can rely on that data. This example could be used for different tunings and tuning changes, if it weren't possible anyway by just sending a tuning command to the sampler. The real problems are repeats. I have not implemented them myself. A simple repeat maybe would be simple but once you get first and second volta and nested repeats it becomes more difficult. Nils _______________________________________________ Denemo-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/denemo-devel
