S2L Equalizer

   Print  Previous  Next

Functions Provided By S2L Equalizer

The following table provides an overview over all functions the effect provides:

Function

Description

void SetBpm(int bpm)

Sets the speed of the effect in BPM. Valid values range from 0 to 9999 BPM.

int GetBpm()

Returns the current effect speed in BPM.

void SetCrossed(int enable)

Enables cross-direction mode if enable is set to true, otherwise it is disabled.

int GetCrossed()

Returns true if cross-direction mode is enabled, otherwise false is returned.

void SetDirection(int direction)

Sets the direction of the effect. Valid values for direction are DIR_LEFT, DIR_RIGHT, DIR_UP, and DIR_DOWN.

int GetDirection()

Returns the current direction.

void SetFade(int fade)

Sets the fade value. Valid values range from 1 to 100.

int GetFade()

Returns the current fade value.

void SetAmplify(int amp)

Sets the amplification value (Amplify). Valid values range from 0 to 100.

int GetAmplify()

Returns the current amplify value.

void SetBandCount(int count)

Sets the number of equalizer bands to display. Valid values range from 1 to 511.

int GetBandCount()

Returns the current number of equalizer bands.

void SetInvert(int enable)

Disables inversion mode ("Invert") if enable is set to false, otherwise it will be enabled.

int GetInvert()

Returns true if "Invert" is enabled, otherwise false.

void SetMirror(int enable)

Disables "Mirror" mode if enable is set to false, otherwise it will be enabled.

int GetMirror()

Returns true if "Mirror" mode is enabled, otherwise false.

void SetViewLog(int enable)

Disables "View Log" if enable is false. Otherwise, it will be enabled.

int GetViewLog()

Returns true if "View Log" is enabled, otherwise false.

void SetPushHF(int enable)

Disables "Push HF" (amplification of high frequencies) if enable is set to false. Otherwise, it will be enabled.

int GetPushHF()

Returns true if "Push HF" is enabled, otherwise false.

void SetDoubleInwards(int enable)

Disables the doubled, inward-oriented equalizer if enable is set to false. Otherwise, it will be enabled.

int GetDoubleInwards()

Returns true if "Double Inwards" is enabled, otherwise false.

void SetDoubleOutwards(int enable)

Disables the doubled, outward-oriented equalizer if enable is set to false. Otherwise, it will be enabled.

int GetDoubleOutwards()

Returns true if "Double Outwards" is enabled, otherwise false.

void SetMonochrome(int enable)

Enables or disables monochrome mode for the equalizer.

int GetMonochrome()

Returns true if the equalizer is set to monochrome mode, otherwise false.

void SetDrawMode(int mode)

Sets the draw mode for the effect. See below for further details.

int GetDrawMode()

Returns the currently selected draw mode. See below for further details.

void SetBandMode(int state)

Enables (state set to 1) or disables (state set to 0) band mode for the effect.

int GetBandMode()

Retrieves if band mode is activated (1) or not (0).

void SetColor(int index, color c)

Sets the color at the specified index in the Color Ramp dialog. If index is out of range, nothing happens.

color GetColor(int index)

Returns the color with the specified index in the Color Ramp dialog. If index is out of range, black is returned.

int GetColorCount()

Returns the number of colors used in the Color Ramp.

int SetColorPosition(int index, float position)

Sets the color of the given index to a new position and returns the new index. Valid values for position range from 0.01 to 0.99. The first and last color are not allowed to be moved!

float GetColorPosition(int index)

Returns the position of a color at the specified index.

void SetColorFade(int index, int fade)

Disables or enables color fade for the color at the specified index by either using 0 (Off) or 1 (On) for fade.

int GetColorFade(int index)

Returns if color fade is set for the color at the specified index.

void FadeAllColors()

Enables color fade for all colors in the Color Ramp.

void FadeNoneColors()

Disables color fade for all colors in the Color Ramp.

void SetUniformDistances()

Sets uniform distances between each color in the Color Ramp.

void InvertColorPositions()

Inverts the positions of the colors in the Color Ramp.

void InvertColors()

Inverts every single color in the Color Ramp.

void AddColor(color c, float position, int index)

Adds another color to the Color Ramp at the specified position. Valid values for position range from 0.01 to 0.99. If the index is lower or equal to 0, the new color is added to the first position. If the index is greater than the current number of colors, the new color is added at the end.

void RemoveColor(int index)

Removes the color at the specified index. If the given index is out of range, nothing happens.

 

This Effect uses the Color Ramp dialog. Learn more about Using Colors.

 

Deprecated Functions
Deprecated functions are outdated functions and should not be used anymore.

Function

Description

void SetSpeed(int speed)

Sets the speed of the effect in FPS. Valid values range from 0 to 166. Please note: This function is deprecated and may be removed in one of the next releases. Use SetBpm instead.

float GetSpeed()

Returns the current effect speed in FPS. Please note: This function is deprecated and may be removed in one of the next releases. Use GetBpm instead.

 

Draw Modes

This effect uses various modes. With the function SetDrawMode it is possible to change them. The following values can be used as parameter:

Value

Description

MODE_BAR

Selects the normal bar mode.

MODE_RADIAL

Selects the unfilled radial mode.

MODE_RADIAL_LINE

Selects the filled radial mode without an outline.

MODE_RADIAL_OUTLINE

Selects the radial mode with an outline.

MODE_RADIAL_DOT

Selects the radial mode drawing a dotted outline.

 

Full Example

The following example combines Music2Light data with a Sound2Light effect. It sets the number of bands according to the current tonality.

int t = 10;

 

void InitEffect()

{

    SetBandCount(t);

    SetCrossed(true);

    SetDoubleInwards(true);

}

 

void PreRenderEffect()

{

    t = t / 2 + GetTonality() / 2;

    if (t > 1)

        SetBandCount(t * t);

}

 

void PostRenderEffect()

{

}