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.

102 lines
5.2 KiB

  1. <HTML>
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
  4. <META NAME="Generator" CONTENT="Microsoft FrontPage 5.0">
  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 kernel-mode software synthesizer that plugs
  12. into the Microsoft&#174; DirectMusic&#174; and WDM Audio architectures.<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_DDKWDMSynth at the top of private.h and ddksynth.inf to be your
  19. GUID. You should also set the text in miniport.cpp, ddksynth.rc and ddksynth.inf to
  20. describe your synthesizer.<P>
  21. Note: this is a software synthesizer sample, but is also relevant as a hardware driver
  22. sample. If you are writing a hardware driver, you should 1) not implement the wave pin,
  23. 2) not implement a synthsink nor depend on Render being called from the port (the
  24. hardware should notify the miniport if it needs additional work done at buffer render
  25. time), and 3) use category RENDER instead of DATATRANSFORM.
  26. <H3>Creating a User-mode Synthesizer </H3></FONT><FONT FACE="Verdana" SIZE=2><P>
  27. Although this sample doesn't show you how to create a user-mode synthesizer, you can start
  28. with the user-mode sample to feel out how synthesis and DLS downloads work. We recommend that
  29. you try out your ideas and get things working in user-mode before moving to kernel mode.
  30. This approach might be easier and save a bit of debugging time.<P>
  31. <H3>Building the Sample</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
  32. Open a free or checked DDK build environment, go to the sample directory, and run <B>build</B>.
  33. This creates ddksynth.sys in the Objfre or Objchk subdirectories. Before the sample can
  34. be used, it must be installed by executing <B>ddksynth.inf</B>.<P>
  35. <H3>Testing the Synthesizer</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
  36. To test the synthesizer, open DirectMusic Producer and open the Port Configuration window.
  37. (You can do this by right-clicking the button showing a 1 or 2 with a sound wave behind it on the
  38. Transit Controls toolbar.) The port name dropdown will now contain the option <B>Microsoft DDK
  39. Synthesizer (WDM)</B> in addition to the Microsoft Synthesizer (WDM) option. Set one of the
  40. configurations to use the Microsoft DDK Synthesizer port.<P>
  41. Then, when you play music through that configuration, it will be played by the synthesizer
  42. you built from the DDK sample. The sound and capabilities of the DDK sample -- Microsoft DDK
  43. Synthesizer (WDM) -- are virtually identical to the kernel-mode DirectMusic synthesizer --
  44. Microsoft Synthesizer (WDM). One major exception is that the DDK sample synthesizer does not
  45. support reverb.<P>
  46. <H3>Supported Configurations</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
  47. The DDK sample synthesizer has been tested in checked and free builds with Microsoft Visual C++&#174;
  48. version 6. It has been tested on Alpha, but not on 64-bit platforms.<P>
  49. Plug and Play as well as Power Management are supported by PortCls on behalf of the synthesizer.<P>
  50. <H3>CODE TOUR</H3>
  51. <H4>File Manifest</H4>
  52. </FONT><U><PRE>File&#9;&#9; Description
  53. </U>
  54. adapter.cpp&#9; Implementation of WDM adapter
  55. clist.cpp&#9; Implements a simple list data structure
  56. clist.h &#9; Prototypes for clist.cpp
  57. common.h&#9; Master header file
  58. control.cpp&#9; CControlLogic implementation
  59. csynth.cpp&#9; CSynth implementation
  60. csynth.h&#9; Prototypes for csynth.cpp
  61. DDKSynth.rc&#9; Resources file containng version information
  62. instr.cpp&#9; Implements instruments
  63. kernhelp.cpp&#9; Helper functions to keep code common between user and kernel modes
  64. kernhelp.h&#9; Prototype file for kernhelp.h
  65. makefile&#9; Makefile for BUILD environment
  66. midi.cpp&#9; Implements MIDI events
  67. miniport.cpp&#9; Implementation of WDM miniport
  68. mix.cpp&#9; CDigitalAudio mixing functions
  69. mmx.cpp&#9; MMX-optimized mixing functions
  70. muldiv32.h&#9; High-resolution multiply-divide operations
  71. plclock.cpp&#9; Clock implementation
  72. plclock.h&#9; Prototypes for plclock.cpp
  73. private.h&#9; Prototypes for adapter.cpp, miniport.cpp, and syslink.cpp
  74. sources&#9; Sources file for BUILD environment
  75. synth.h&#9; Prototypes for instr.cpp, midi.cpp, voice.cpp, and control.cpp
  76. syslink.cpp&#9; Wave interface back into PortCls
  77. voice.cpp&#9; Voice implementation
  78. </FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
  79. <TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
  80. <TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
  81. <P></TD>
  82. </TR>
  83. </TABLE>
  84. <FONT FACE="MS Sans Serif" SIZE=1><P>&copy; 1999-2000 Microsoft Corporation. All rights reserved.</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
  85. </HTML>