Creating a plug-in recognizer is not difficult. The volume recognizer is provided as an example.
The sample recognizer directory contains a Makefile for constructing the shared object file, with the file extension .so, that is loaded at runtime. Also in the sample directory, there is a prototype recognizer called RCProto.h, RCProto.c++ which can be used as a starting point for a new recognizer.
The compilation process makes use of parts of the Plug-in Developer's Library (PDL) by including some of its header files. While there are quite of few different PDL classes, there are only a few that are directly pertinent to the creation of plug-in recognizers.
| See also the Plug-in Developer's Library section of the MotionSampler chapter. |
PDLRecognizer.h contains the base classes for the types used by recognizers. The base classes are PDLRecognizer and PDLRecognizerTarget. PDLRecognizerTarget also contains comments on the base classes and explains some of what is needed to derive a new recognizer type.
PDLSoundsync.h contains the interface code so that recognizers can create sliders and option menus in their control panels in Soundsync. There are three types of interface element: floating point slider, integer slider, and option (text list) menu.
PDLSound.h contains a variety of functions for working with sound samples, including resampling, cut and paste, and file input and output. The functions in PDLSound.h can be used to manipulate sound within a recognizer and can be extended by using the calls to get at the raw data as needed.
Each recognizer is a subclass of the class PDLRecognizer. Each contains a list of targets (subclasses of PDLRecognizerTarget) which are matched during the Recognize() function call. The list of matches is made available by the Matches() or IdMatches() calls.
Each recognizer must implement the virtual functions found in the PDLRecognizer base class, and each must build and update a user interface using the calls from PDLSoundsync.h.
The interface items interval and frequency are standard in all recognizers and should be duplicated in any new recognizer. The Read() and Write() calls save the recognizer's configuration.
The RCProto[.c++, .h] files are provided as a skeleton of a new recognizer.
Additional information on creating recognizers can be found in the comments in the files listed above.
Recognizers must be either in the same directory as the Alias plug-ins or in the path ALIAS_PLUGIN_PATH as set in the Soundsync start-up file (soundsync) to be installed.