VST 3 Examples: LogScale< T > Class Template Reference
Author: Steinberg

VST 3 Examples VST 3.7 SDK for developing VST plug-in

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LogScale< T > Class Template Reference

LogScale class. More...

`#include <logscale.h>`

## Public Member Functions
| LogScale (T srcMin, T srcMax, T destMin, T destMax, T inValue=0.5, T outValue=0.1)
| Constructor.
| LogScale ()
| Default Constructor with [0, 0.5, 1] => [0, 0.1, 1].
void | changeScaling (T srcMin, T srcMax, T destMin, T destMax, T inValue, T outValue)
| Applies a new scale setting.
void | scale (T *pIn, T *pOut, int32 nSamples)
| Computes the scale from pIn input buffer to pOut output buffer (pIn and POut could be the same buffer).
T | scale (T input) const
| Computes for one given value the scale.
void | invscale (T *pIn, T *pOut, int32 nSamples)
| Computes the inverse scale from pIn input buffer to pOut output buffer (pIn and POut could be the same buffer).
T | invscale (T input) const
| Computes for one given value the inverse scale.
T | invscaleCheck (T in) const
| Same than invscale with a check of the input.

## Protected Member Functions
void | setScaling (T srcMin, T srcMax, T destMin, T destMax, T inValue, T outValue)

## Protected Attributes
T | scaleFactor
T | scaleFactorInv
T | srcScale
T | srcScaleInv
T | srcMin
T | expo
T | expoInv
T | destMin

## Detailed Description

template<class T>
class Steinberg::Vst::LogScale< T >

LogScale class.

Scales [srcMin srcMax] to [destMin destMax]

Scaling curve is defined by given outValue for given inValue

# Example for stretched lower range

LogScale myLogScale (0, 1, 0, 1, 0.5, 0.1);
means: input and output ranges are the same, but myLogScale.scale (0.5) is 0.1 ([0, 0.5, 1] => [0, 0.1, 1])

# Example for compressed lower range

LogScale myLogScale (0, 1, 0, 1, 0.5, 0.9);
means: input and output ranges are the same, but myLogScale.scale (0.5) is 0.9 ([0, 0.5, 1] => [0, 0.9, 1])

# Example for filter frequency range

LogScale myLogScale (0, 1, 80, 22000, 0.5, 2000);
means: input range is between 0 and 1 and output range is between 80 and 22000 and myLogScale.scale (0.5) is 2000 ([0, 0.5, 1] => [80, 2000, 22000])

## Constructor & Destructor Documentation

## ◆ LogScale() [1/2]

template<class T>

LogScale | ( | T | srcMin,
|  | T | srcMax,
|  | T | destMin,
|  | T | destMax,
|  | T | inValue = 0.5,
|  | T | outValue = 0.1 )

Constructor.

## ◆ LogScale() [2/2]

template<class T>

LogScale | ( |  | ) |

Default Constructor with [0, 0.5, 1] => [0, 0.1, 1].

## Member Function Documentation

## ◆ changeScaling()

template<class T>

void changeScaling | ( | T | srcMin,
|  | T | srcMax,
|  | T | destMin,
|  | T | destMax,
|  | T | inValue,
|  | T | outValue )

Applies a new scale setting.

Note that destMin should be different than destMax! The same for srcMin and srcMax.

## ◆ scale() [1/2]

template<class T>

void scale | ( | T * | pIn,
|  | T * | pOut,
|  | int32 | nSamples )

Computes the scale from pIn input buffer to pOut output buffer (pIn and POut could be the same buffer).

## ◆ scale() [2/2]

template<class T>

T scale | ( | T | input | ) | const

Computes for one given value the scale.

## ◆ invscale() [1/2]

template<class T>

void invscale | ( | T * | pIn,
|  | T * | pOut,
|  | int32 | nSamples )

Computes the inverse scale from pIn input buffer to pOut output buffer (pIn and POut could be the same buffer).

## ◆ invscale() [2/2]

template<class T>

T invscale | ( | T | input | ) | const

Computes for one given value the inverse scale.

## ◆ invscaleCheck()

template<class T>

T invscaleCheck | ( | T | in | ) | const

Same than invscale with a check of the input.

## ◆ setScaling()

template<class T>

void setScaling | ( | T | srcMin,
|  | T | srcMax,
|  | T | destMin,
|  | T | destMax,
|  | T | inValue,
|  | T | outValue )
| protected

## Member Data Documentation

## ◆ scaleFactor

template<class T>

T scaleFactor
| protected

## ◆ scaleFactorInv

template<class T>

T scaleFactorInv
| protected

## ◆ srcScale

template<class T>

T srcScale
| protected

## ◆ srcScaleInv

template<class T>

T srcScaleInv
| protected

## ◆ srcMin

template<class T>

T srcMin
| protected

## ◆ expo

template<class T>

T expo
| protected

## ◆ expoInv

template<class T>

T expoInv
| protected

## ◆ destMin

template<class T>

T destMin
| protected

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.