haiku/docs/develop/midi/midi1.html
mahlzeit e16d0060fe More docs.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7577 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-14 09:49:32 +00:00

26 lines
2.3 KiB
HTML

<HTML>
<BODY>
<H3>How libmidi1 works</H3>
<P>Midi1 is implemented on top of midi2, which means that libmidi.so depends on libmidi2.so to do the real work. BeOS versions earlier than R5 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.)</P>
<P>Midi2 is backwards compatible with midi1: The old libmidi.so still exists so that applications using the old API will run (providing binary compatibility). The old <CODE>BMidiPort</CODE> object is now a wrapper that uses the new <CODE>BMidiRoster</CODE> to allow connections to any published MIDI producer or consumer. Published MIDI objects are presented to the old MIDI apps as if they were physical MIDI ports.</P>
<P>Here is a very nice picture of how <CODE>BMidiPort</CODE> works:</P>
<P><IMG ALT="" SRC="midiport.png"></P>
<H3>The softsynth</H3>
<P>The General MIDI synthesizer is implemented in <CODE>BSoftSynth</CODE>. This is a private class (not usable outside the API). It is not a real <CODE>BMidiEndpoint</CODE>, so you will not see it appear on Patchbay. I did this for simplicity's sake, for backwards compatibility (this is how the R5 synth worked too), and because we will have to give the Midi Kit a complete makeover for R2 anyway.</P>
<P>The <CODE>BMidiSynth</CODE> and <CODE>BSynth</CODE> classes delegate most of the work to <CODE>BSoftSynth</CODE>. Not all of their methods are implemented, since some of them are very obscure. It would be a lot of work to figure out what they do, while it is likely that no applications use them anyway. However, <CODE>BMidiSynth</CODE> and <CODE>BSynth</CODE> should perform most common tasks without problems.</P>
<P><CODE>BSamples</CODE> doesn't do anything; its functions are mostly empty. In other words, with the OpenBeOS Midi Kit you cannot push waveform data into the output of the softsynth.</P>
<P>For simplicity's sake, <CODE>BMidiSynthFile</CODE> is implemented using <CODE>BMidiStore</CODE>, since the latter already knows how to parse Standard MIDI Files. Duplicating that functionality elsewhere would be pointless. However, this makes the behavior of our <CODE>BMidiSynthFile</CODE> a little different from what the BeBook says &mdash; as long as your applications are written properly, you shouldn't notice any differences.</P>
</BODY>
</HTML>