CRI ADX  Last Updated: 2024-07-17 10:47 p
User Effect Plugin

Samples Directory

/CRIWARE/SDK/pc/samples/criatomex/user_effect_plugin


How to Build

This is a sample that imports a user-defined effect into ADX and applied it to a sound effect.br> In order to build this sample, the CRI ADX Audio Effect Plugin SDK is required.
Please add the following headers from the "simple_delay" sample included in the CRI ADX Audio Effect Plugin SDK:
  • Place cri_audio_effect.h in /CRIWARE/SDK/pc/include/
  • Place simple_delay.h in /CRIWARE/SDK/pc/include/Expansion/effect_plugin/

Build the "simple_delay" sample and place the resulting libraries in the following directories:

  • Place cri_simple_delay_pcx86.lib, cri_simple_delay_pcx86D.lib in /CRIWARE/SDK/pc/libs/x86/Expansion/effect_plugin/
  • Place cri_simple_delay_pcx64.lib, cri_simple_delay_pcx64D.lib in /CRIWARE/SDK/pc/libs/x64/Expansion/effect_plugin/

Sample Description<

The procedure to add a user-defined effect into ADX is as follows.
(Please refer to the manual included in the CRI ADX Audio Effect Plugin SDK for extra details).
  1. Use the CRI ADX Audio Effect Plugin SDK to create a runtime library and tool plug-in.
  2. Import the resulting tool plug-in into CRI Atom Craft, and build an ACF file containing the user-defined effect.
  3. Register the user-defined effect interface with the runtime library linked with the application.
When you execute the criAtomExAsr_RegisterEffectInterface function, you register the user-defined effect interface with the Atom library.
/* User defined effect header */
#include "simple_delay.h"
/* Main Procces */
main
{
/* Initialize the CRI Atom Library */
criAtomEx_Initialize(NULL, NULL, 0);
:
/* Register the user-defined effect interface in the Atom library */
criAtomExAsr_RegisterEffectInterface(simpleDelay_GetInterfaceWithVersion());
:
/* Register the ACF with the user-defined effect in the DSP bus setting */
criAtomEx_criAtomEx_RegisterAcfFile(NULL, acf_file, NULL, 0);
:
}
CriBool criAtomExAsr_RegisterEffectInterface(CriAtomExAsrAfxInterfaceWithVersionPtr afx_interface)
Register a user-defined effect interface.
CriBool criAtomEx_Initialize(const CriAtomExConfig *config, void *work, CriSint32 work_size)
Initialize the library.
[Remark]

Attention
Care must be taken when calling the criAtomExAsr_RegisterEffectInterface and the criAtomExAsr_UnregisterEffectInterface functions.
In particular, please:
  1. Be sure to call the criAtomExAsr_RegisterEffectInterface function before attaching the DSP bus setting (call the criAtomEx_AttachDspBusSetting). In order to attach the DSP bus setting including the user-defined effect, please register all the interfaces of the effect included in the DSP bus setting.
    If a required effect interface is not found, an error callback will be triggered and the attachment of the DSP bus setting will fail.
  2. Call the criAtomExAsr_UnregisterEffectInterface function with the DSP bus setting detached. Once registered, the effect interface will continue to be referenced from the library until you exit the Atom library or call the criAtomExAsr_UnregisterEffectInterface function.
    An access violation exception may occur if you cancel the registration of the interface while still performing signal processing, such as during the playback of sound.
    Therefore, please unregister the effect interface only after the DSP bus setting is detached.
  3. The registration of all the effect interfaces will be canceled during the finalization of the library (at the time of execution of the criAtomEx_Finalize function) When re-initializing the library, you need to re-register the necessary effect interfaces.


Directory of the AtomCraft project with the data used in the sample

/CRIWARE/Tools/ADX/ver.2/examples/tutorial_data_for_runtime