Creating Plug-in Recognizers

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.

Installing Recognizers

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.

Troubleshooting SoundSync

The Recognizer menu is empty.

At start-up, SoundSync looks in several places for recognizers. If your recognizer objects (such as volume.so) are not in the standard location, you can set the environment variable ALIAS_PLUGIN_PATH to the directory that contains your recognizer objects and restart SoundSync.

Setting ALIAS_PLUGIN_PATH to a non-standard location can affect other Alias programs that use plug-ins, such as MotionSampler2.

My track file (or keyset file) contains configuration information for the recognizers but they don't appear in the menu.

If your recognizer shared objects are not being found at runtime, see the previous problem to set environment variables so that SoundSync can locate your plug-ins.

I don't hear any sound when I use playback or when I scratch across the soundtrack.

The problem may be that the volume is turned down on your machine.

Select Desktop Audio Control from the desktop Toolchest as follows:

When you select Audio Control, the following control panel opens:

Click and drag the Speaker sliders toward 10. Also, make sure that the Mute button is not pressed.

There does not appear to be any animation in the wire files I applied animation to.

There are several things that could prevent the animation from being applied correctly to your wire file.

  • Are you certain that the dag node names match in your initial and final wire files? Because SoundSync uses dag node names and not the hierarchy to match animation to nodes, the names in the initial file, from which the keysets and keyshapes are derived, must match the final file, onto which the animation is applied. This does not mean that the hierarchy must be the same or that all of the dag nodes must match in each file. Typically, the final file is more complex and contains more data than the initial file, but if you placed animation on the dag node cheek#5 in the initial file, SoundSync looks beneath the dag node you specify in the Apply dialog for a dag node cheek, ignoring the # and numbers. Since Alias renumbers dag nodes to maintain name uniqueness, this is a common problem.

  • If that fails, try running the program with the [-v] option. SoundSync lists which dag nodes and channels it believes contain animation for each keyset. If you don't see any animation, you probably have not created your initial file correctly and you should review the section on creating data.

  • The [-v] option also indicates which dag nodes are receiving animation during the Apply phase. This will help you track down mismatched names and missing animation.

    Parts of my geometry appear to be missing in the geometry window.

    SoundSync cannot tessellate or display blend surfaces. Therefore, these surfaces do not appear in the display.

    The SoundSync window is incorrectly configured and there are a number of X complaints when the program is started.

    This means that SoundSync can't locate its resource file. The environment variable XMAPPUSERFILES determines a search path for the resource files.

    The Play button is missing its triangle shape.

    All of the playback buttons are missing their images.

    The playback button images are bitmaps and must be in a known location for SoundSync to load them properly.





    aliasdocs@aw.sgi.com
    Copyright © 1997, Alias|Wavefront, a Silicon Graphics Company. All rights reserved.