1How libmidi1 works 2~~~~~~~~~~~~~~~~~~ 3 4Midi1 is implemented on top of midi2, which means that libmidi.so 5depends on libmidi2.so to do the real work. BeOS versions earlier than 6R5 did not include a midi_server, because midi1 itself did not need it. 7(A server is only really useful if data must be shared between teams, 8something that midi1 did not allow.) 9 10Midi2 is backwards compatible with midi1: The old libmidi.so still 11exists so that applications using the old API will run (providing binary 12compatibility). The old ``BMidiPort`` object is now a wrapper that uses 13the new ``BMidiRoster`` to allow connections to any published MIDI 14producer or consumer. Published MIDI objects are presented to the old 15MIDI apps as if they were physical MIDI ports. 16 17Here is a very nice picture of how ``BMidiPort`` works: 18 19|image0| 20 21The softsynth 22~~~~~~~~~~~~~ 23 24The General MIDI synthesizer is implemented in ``BSoftSynth``. This is a 25private class (not usable outside the API). It is not a real 26``BMidiEndpoint``, so you will not see it appear on Patchbay. I did this 27for simplicity's sake, for backwards compatibility (this is how the R5 28synth worked too), and because we will have to give the Midi Kit a 29complete makeover for R2 anyway. 30 31The ``BMidiSynth`` and ``BSynth`` classes delegate most of the work to 32``BSoftSynth``. Not all of their methods are implemented, since some of 33them are very obscure. It would be a lot of work to figure out what they 34do, while it is likely that no applications use them anyway. However, 35``BMidiSynth`` and ``BSynth`` should perform most common tasks without 36problems. 37 38``BSamples`` doesn't do anything; its functions are mostly empty. In 39other words, with the OpenBeOS Midi Kit you cannot push waveform data 40into the output of the softsynth. 41 42For simplicity's sake, ``BMidiSynthFile`` is implemented using 43``BMidiStore``, since the latter already knows how to parse Standard 44MIDI Files. Duplicating that functionality elsewhere would be pointless. 45However, this makes the behavior of our ``BMidiSynthFile`` a little 46different from what the BeBook says — as long as your applications are 47written properly, you shouldn't notice any differences. 48 49.. |image0| image:: midiport.png 50 51