DirectMusic Software Synthesizer

Summary

This sample contains working source code for a user-mode software synthesizer that plugs into the Microsoft® DirectMusic® architecture.

Building a new DirectMusic Synthesizer

You are encouraged to use this sample code to start building your own software synthesizer. Modify the sample to add your own features.

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.

Creating a Kernel-mode Synthesizer or Driver

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.

Building the Sample

Open a free or checked DDK build environment, go to this directory, and run build. This creates Ddksynth.dll in the Objfre or Objchk directory. Before the sample can be used, it must be registered by running regsvr32 ddksynth.dll.

Testing the Synthesizer

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 Microsoft DDK Synthesizer in addition to the Microsoft Synthesizer option. Set one of the configurations to use the Microsoft DDK Synthesizer port.

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.

Supported Configurations

The DDK sample synthesizer has been tested in checked and free builds with Microsoft Visual C++® versions 5 and 6. It has not been tested on Alpha or other 64-bit platforms.

No special Plug and Play or Power Management support is required for this type of synthesizer.

CODE TOUR

File Manifest

File			Description

Instr.cpp		Implements instruments
Umsynth.cpp		Implementation of CUserModeSynth
Umsynth.h		Prototype file for Umsynth.cpp
Voice.cpp		Implements voices
Clist.cpp		Implements a simple list data structure
Clist.h			Prototype file for Clist.cpp
Control.cpp		Implementation of CControlLogic
Csynth.cpp		Implementation of CSynth
Csynth.h		Prototype file for Csynth.h
Midi.cpp		Implements MIDI events
Mix.cpp			Implements CDigitalAudio mixing functions
Mmx.cpp			Implements MMX-optimized mixing functions
Plclock.cpp		Implements clocks
Plclock.h		Prototype file for Plclock.cpp
Ddksynth.cpp		DLL entry points and IDirectMusicSynthFactory implementation
Oledll.cpp		Handle standard entry points for OLE server DLL
Oledll.h		Prototype file for Oledll.h
Synth.h			Prototype file for Instr.cpp, Midi.cpp, Voice.cpp, and Control.cpp
Simple.h		Includes some common header files
Misc.h			Prototypes of miscellaneous helper functions
Validate.h		Pointer validation macros
Debug.cpp		Debugging helper functions such as assertions and tracing
Debug.h			Prototype file for Debug.cpp
Ddksynth.rc		Resources file containung version information
Guids.cpp		GUID definitions
Ddksynth.def		DLL .def file
Makefile		Makefile for BUILD environment
Sources			Sources file for BUILD environment 




Top of page

© 1999 Microsoft Corporation