Source code of Windows XP (NT5)
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
4.9 KiB

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