How libmidi1 works~~~~~~~~~~~~~~~~~~Midi1 is implemented on top of midi2, which means that libmidi.sodepends on libmidi2.so to do the real work. BeOS versions earlier thanR5 did not include a midi_server, because midi1 itself did not need it.(A server is only really useful if data must be shared between teams,something that midi1 did not allow.)Midi2 is backwards compatible with midi1: The old libmidi.so stillexists so that applications using the old API will run (providing binarycompatibility). The old ``BMidiPort`` object is now a wrapper that usesthe new ``BMidiRoster`` to allow connections to any published MIDIproducer or consumer. Published MIDI objects are presented to the oldMIDI apps as if they were physical MIDI ports.Here is a very nice picture of how ``BMidiPort`` works:|image0|The softsynth~~~~~~~~~~~~~The General MIDI synthesizer is implemented in ``BSoftSynth``. This is aprivate class (not usable outside the API). It is not a real``BMidiEndpoint``, so you will not see it appear on Patchbay. I did thisfor simplicity's sake, for backwards compatibility (this is how the R5synth worked too), and because we will have to give the Midi Kit acomplete makeover for R2 anyway.The ``BMidiSynth`` and ``BSynth`` classes delegate most of the work to``BSoftSynth``. Not all of their methods are implemented, since some ofthem are very obscure. It would be a lot of work to figure out what theydo, while it is likely that no applications use them anyway. However,``BMidiSynth`` and ``BSynth`` should perform most common tasks withoutproblems.``BSamples`` doesn't do anything; its functions are mostly empty. Inother words, with the Haiku Midi Kit you cannot push waveform datainto the output of the softsynth.For simplicity's sake, ``BMidiSynthFile`` is implemented using``BMidiStore``, since the latter already knows how to parse StandardMIDI Files. Duplicating that functionality elsewhere would be pointless.However, this makes the behavior of our ``BMidiSynthFile`` a littledifferent from what the BeBook says — as long as your applications arewritten properly, you shouldn't notice any differences... |image0| image:: midiport.png