XJ music engine  1.9.6
In-game runtime engine for XJ music.
Static Public Member Functions | List of all members
XJ::AudioMathUtils Class Reference

#include <AudioMathUtils.h>

Static Public Member Functions

static float computeIntensityAmplitude (const InstrumentAudio *audio, const int intensityLayers, const float intensityThreshold, const bool fadeOutLowerIntensities, const float intensity)
 

Member Function Documentation

◆ computeIntensityAmplitude()

float XJ::AudioMathUtils::computeIntensityAmplitude ( const InstrumentAudio audio,
const int  intensityLayers,
const float  intensityThreshold,
const bool  fadeOutLowerIntensities,
const float  intensity 
)
static

Compute the actual amplitude given the target intensity, with a plateau at 1.0 in the middle of the intensity range E.g., for source intensity 0.5 and intensity threshold 0.5, with fadeOutLowerIntensities = true;

  • target intensity 0.000 -> amplitude 0.0
  • target intensity 0.125 -> amplitude 0.5
  • target intensity 0.250 -> amplitude 1.0
  • target intensity 0.500 -> amplitude 1.0
  • target intensity 0.750 -> amplitude 1.0
  • target intensity 0.875 -> amplitude 0.5
  • target intensity 1.000 -> amplitude 0.0 E.g., for source intensity 0.5 and intensity threshold 0.5, with fadeOutLowerIntensities = false;
  • target intensity 0.000 -> amplitude 0.0
  • target intensity 0.125 -> amplitude 0.5
  • target intensity 0.250 -> amplitude 1.0
  • target intensity 0.500 -> amplitude 1.0
  • target intensity 0.750 -> amplitude 1.0
  • target intensity 0.875 -> amplitude 1.0
  • target intensity 1.000 -> amplitude 1.0
Parameters
audioinstrument audio from which to get source intensity
intensityLayersif the audio only has one layer, intensity is always 1.0
intensityThresholddistance between source and target intensity at which the amplitude fades down to 0
fadeOutLowerIntensitieswhether to fade out lower intensities when the target is higher than the source
intensitytarget intensity
Returns
amplitude

The documentation for this class was generated from the following files: