Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

100 lines
5.0 KiB

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>DirectMusic</TITLE>
<META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
</HEAD>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff" leftmargin="8">
<FONT FACE="Verdana"><H2><A NAME="MYSAMPLE">DirectMusic Software Synthesizer</A> </H2>
<H3>Summary</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
This sample contains working source code for a user-mode software synthesizer that plugs
into the Microsoft&#174; DirectMusic&#174; architecture.<P>
<H3>Building a new DirectMusic Synthesizer</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
You are encouraged to use this sample code to start building your own software
synthesizer. Modify the sample to add your own features.<P>
If you ship your synthesizer to customers, be sure to use the Guidgen program to create
a Globally Unique ID (GUID) for your synthesizer so it won't interfere with other
synthesizers. Set CLSID_DDKSynth at the top of Umsynth.h to be your GUID. You should also
set the text in Ddksynth.cpp and Ddksynth.rc to describe your synthesizer.<P>
<H3>Creating a Kernel-mode Synthesizer or Driver</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
Although this sample doesn't show you how to create a kernel-mode synthesizer or driver,
you can use this code to feel out how synthesis and DLS downloads work. We recommend that
you try out your ideas and get things working in a user-mode synthesizer before moving to
kernel mode or writing drivers. This approach is often easier and can save
quite a bit of debugging time.<P>
<H3>Building the Sample</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
Open a free or checked DDK build environment, go to this directory, and run <B>build</B>.
This creates Ddksynth.dll in the Objfre or Objchk directory. Before the sample can
be used, it must be registered by running <B>regsvr32 ddksynth.dll</B>.<P>
<H3>Testing the Synthesizer</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
To test the synthesizer, open DirectMusic Producer and open the Port Configuration window.
(You can do this by right-clicking the button showing a 1 or 2 with a sound wave behind it on the
Transit Controls toolbar.) The port name dropdown will now contain the option <B>Microsoft
DDK Synthesizer</B> in addition to the Microsoft Synthesizer option. Set one of the
configurations to use the Microsoft DDK Synthesizer port.<P>
Then, when you play music through that configuration, it will be played by the synthesizer
you built from the DDK sample. The sound and capabilities of the DDK sample (Microsoft DDK
Synthesizer) are virtually identical to the default DirectMusic synthesizer
(Microsoft Synthesizer), one major exception to this being that the DDK sample synthesizer
does not support reverb.<P>
<H3>Supported Configurations</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
The DDK sample synthesizer has been tested in checked and free builds with Microsoft Visual C++&#174;
versions 5 and 6. It has not been tested on Alpha or other 64-bit platforms.<P>
No special Plug and Play or Power Management support is required for this type of synthesizer.<P>
<H3>CODE TOUR</H3>
<H4>File Manifest</H4>
</FONT><U><PRE>File&#9;&#9; Description
</U>
Instr.cpp&#9; Implements instruments
Umsynth.cpp&#9; Implementation of CUserModeSynth
Umsynth.h&#9; Prototype file for Umsynth.cpp
Voice.cpp&#9; Implements voices
Clist.cpp&#9; Implements a simple list data structure
Clist.h &#9; Prototype file for Clist.cpp
Control.cpp&#9; Implementation of CControlLogic
Csynth.cpp&#9; Implementation of CSynth
Csynth.h&#9; Prototype file for Csynth.h
Midi.cpp&#9; Implements MIDI events
Mix.cpp&#9; Implements CDigitalAudio mixing functions
Mmx.cpp&#9; Implements MMX-optimized mixing functions
Plclock.cpp&#9; Implements clocks
Plclock.h&#9; Prototype file for Plclock.cpp
Ddksynth.cpp&#9; DLL entry points and IDirectMusicSynthFactory implementation
Oledll.cpp&#9; Handle standard entry points for OLE server DLL
Oledll.h&#9; Prototype file for Oledll.h
Synth.h&#9; Prototype file for Instr.cpp, Midi.cpp, Voice.cpp, and Control.cpp
Simple.h&#9; Includes some common header files
Misc.h&#9; Prototypes of miscellaneous helper functions
Validate.h&#9; Pointer validation macros
Debug.cpp&#9; Debugging helper functions such as assertions and tracing
Debug.h&#9; Prototype file for Debug.cpp
Ddksynth.rc&#9; Resources file containung version information
Guids.cpp&#9; GUID definitions
Ddksynth.def&#9; DLL .def file
Makefile&#9; Makefile for BUILD environment
Sources&#9; Sources file for BUILD environment
</FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
<TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
<TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
<P></TD>
</TR>
</TABLE>
<FONT FACE="MS Sans Serif" SIZE=1><P>&copy; 1999 Microsoft Corporation</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
</HTML>