mirror of https://github.com/tongzx/nt5src
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.
103 lines
5.2 KiB
103 lines
5.2 KiB
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
|
|
<META NAME="Generator" CONTENT="Microsoft FrontPage 5.0">
|
|
<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 kernel-mode software synthesizer that plugs
|
|
into the Microsoft® DirectMusic® and WDM Audio architectures.<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_DDKWDMSynth at the top of private.h and ddksynth.inf to be your
|
|
GUID. You should also set the text in miniport.cpp, ddksynth.rc and ddksynth.inf to
|
|
describe your synthesizer.<P>
|
|
|
|
Note: this is a software synthesizer sample, but is also relevant as a hardware driver
|
|
sample. If you are writing a hardware driver, you should 1) not implement the wave pin,
|
|
2) not implement a synthsink nor depend on Render being called from the port (the
|
|
hardware should notify the miniport if it needs additional work done at buffer render
|
|
time), and 3) use category RENDER instead of DATATRANSFORM.
|
|
|
|
|
|
<H3>Creating a User-mode Synthesizer </H3></FONT><FONT FACE="Verdana" SIZE=2><P>
|
|
Although this sample doesn't show you how to create a user-mode synthesizer, you can start
|
|
with the user-mode sample to feel out how synthesis and DLS downloads work. We recommend that
|
|
you try out your ideas and get things working in user-mode before moving to kernel mode.
|
|
This approach might be easier and save 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 the sample directory, and run <B>build</B>.
|
|
This creates ddksynth.sys in the Objfre or Objchk subdirectories. Before the sample can
|
|
be used, it must be installed by executing <B>ddksynth.inf</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 (WDM)</B> in addition to the Microsoft Synthesizer (WDM) 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 (WDM) -- are virtually identical to the kernel-mode DirectMusic synthesizer --
|
|
Microsoft Synthesizer (WDM). One major exception is 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++®
|
|
version 6. It has been tested on Alpha, but not on 64-bit platforms.<P>
|
|
|
|
Plug and Play as well as Power Management are supported by PortCls on behalf of the synthesizer.<P>
|
|
|
|
<H3>CODE TOUR</H3>
|
|
<H4>File Manifest</H4>
|
|
</FONT><U><PRE>File		 Description
|
|
</U>
|
|
adapter.cpp	 Implementation of WDM adapter
|
|
clist.cpp	 Implements a simple list data structure
|
|
clist.h 	 Prototypes for clist.cpp
|
|
common.h	 Master header file
|
|
control.cpp	 CControlLogic implementation
|
|
csynth.cpp	 CSynth implementation
|
|
csynth.h	 Prototypes for csynth.cpp
|
|
DDKSynth.rc	 Resources file containng version information
|
|
instr.cpp	 Implements instruments
|
|
kernhelp.cpp	 Helper functions to keep code common between user and kernel modes
|
|
kernhelp.h	 Prototype file for kernhelp.h
|
|
makefile	 Makefile for BUILD environment
|
|
midi.cpp	 Implements MIDI events
|
|
miniport.cpp	 Implementation of WDM miniport
|
|
mix.cpp	 CDigitalAudio mixing functions
|
|
mmx.cpp	 MMX-optimized mixing functions
|
|
muldiv32.h	 High-resolution multiply-divide operations
|
|
plclock.cpp	 Clock implementation
|
|
plclock.h	 Prototypes for plclock.cpp
|
|
private.h	 Prototypes for adapter.cpp, miniport.cpp, and syslink.cpp
|
|
sources	 Sources file for BUILD environment
|
|
synth.h	 Prototypes for instr.cpp, midi.cpp, voice.cpp, and control.cpp
|
|
syslink.cpp	 Wave interface back into PortCls
|
|
voice.cpp	 Voice implementation
|
|
|
|
|
|
|
|
|
|
</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>© 1999-2000 Microsoft Corporation. All rights reserved.</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
|
|
</HTML>
|