CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
Randomization of 3D sound source playback position
It is possible to randomly determine the position of the 3D sound source during playback.
adx2u_keys_ADX_A_70_3DPOS_RandomPosition.png
As shown in the figure above, playback positions are evenly distributed inside the shape centered on the original sound source.
Currently the following shapes are supported.
  • rectangle
  • cuboid
  • circle
  • cylinder
  • sphere
  • list
adx2u_keys_pos3d_random_types.png
The position randomization function can be configured from the CRIWARE Unity plugin or from the CRI Atom Craft tool.
About how to set up position randomization in CRI Atom Craft, please refer to "How to Set Up 3D Positioning" in the CRI Atom Craft manual.
Configuration from CRIWARE Unity Plugin
If configuration has been done via CriWare.CriAtomSource component's inspector, the randomization setting will be applied to the built-in CriWare.CriAtomEx3dSource member when the component is initialized.
Please refer to " Cri Atom Source " for information about the CriWare.CriAtomEx3dSource inspector.

When using scripting, please configure the position randomization in the CriWare.CriAtomEx::Randomize3dConfig structure, and apply the setting to the 3D sound source with the CriWare.CriAtomEx3dSource::SetRandomPositionConfig method.
To turn off this feature, please specify null for the argument of the function.
The following settings can be made in the CriWare.CriAtomEx::Randomize3dConfig structure.
  • Whether to follow the position and orientation of the 3D sound source
    • CriAtomEx.Randomize3dConfig.followsOriginalSource
  • Shape (calculation method of coordinates)
    • CriAtomEx.Randomize3dConfig.calculationType
  • Parameters of the chosen shape (coordinate calculation method)
    • CriAtomEx.Randomize3dConfig.calculationParameters
All of these settings can be set in the inspector of CriWare.CriAtomSource .
When making settings in a script, please specify them as arguments of the structure's constructor.
When using a basic shape, it is necessary to set the parameters for the shape.
The table below shows every combination of shape and parameters.
Definition Shape Parameter 1 Parameter 2 Parameter 3
CriWare.CriAtomEx::Randomize3dCalcType::Rectangle Rectangle Width Depth -
CriWare.CriAtomEx::Randomize3dCalcType::Cuboid Cuboid Width Depth Height
CriWare.CriAtomEx::Randomize3dCalcType::Circle Circle Radius - -
CriWare.CriAtomEx::Randomize3dCalcType::Cylinder Cylinder Radius Height -
CriWare.CriAtomEx::Randomize3dCalcType::Sphere Sphere Radius - -
Remarks
  • The fields marked with "-" are not referenced internally.
The following coordinate calculation method does not refer to the shape parameters.
A list of relative coordinates can be pre-determined and used during position-randomized playback.
You need to follow the steps below to use this coordinate calculation method.
  • List configuration
  • List registration
The memory space of the list is allocated inside CRI ADX.
The maximum number of elements of the list to be allocated should be specified as the constructor argument of the following class:
In the CriWare.CriAtomSource component's Inspector, if you set the shape type to List, this maximum number of elements setting will appear.
You can register a list by using the following method.