public class DecibelMeter extends LXModulator implements LXNormalizedParameter, LXOscComponent
LXComponent.Placeholder, LXComponent.Renamable
LXParameter.Formatter, LXParameter.Polarity, LXParameter.Units
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
CompoundParameter |
attack
Meter attack time, in milliseconds
|
protected float |
attackGain |
protected LXAudioBuffer |
buffer |
CompoundParameter |
gain
Gain of the meter, in decibels
|
protected static double |
LOG_10 |
CompoundParameter |
range
Range of the meter, in decibels.
|
CompoundParameter |
release
Meter release time, in milliseconds
|
protected float |
releaseGain |
runMs, running, trigger
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Constructor and Description |
---|
DecibelMeter(LXAudioBuffer buffer)
Default constructor, creates a meter with unity gain and 72dB dynamic range
|
DecibelMeter(String label,
LXAudioBuffer buffer)
Default constructor, creates a meter with unity gain and 72dB dynamic range
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeValue(double deltaMs)
Implementation method to advance the modulator's internal state.
|
double |
getDecibels() |
float |
getDecibelsf() |
double |
getExponent()
Gets the exponent used for scaling this parameter across its normalized range.
|
double |
getNormalized()
Gets the value of the parameter in a normalized space from 0 to 1
|
float |
getNormalizedf()
Gets the value of the parameter in a normalized space as a float
|
double |
getPeak() |
float |
getPeakf() |
float |
getRaw()
Return raw underlying levels, no attack/gain smoothing
|
double |
getSquare() |
float |
getSquaref() |
DecibelMeter |
setBuffer(LXAudioBuffer buffer) |
LXNormalizedParameter |
setNormalized(double value)
Sets the value or the parameter in normalized space from 0 to 1
|
getDescription, getFormatter, getIndex, getOscAddress, getOscPath, getPath, getPolarity, getUnits, getValue, getValuef, onSetValue, run, setComponent, setDescription, setFormatter, setIndex, setPolarity, setUnits, setValue, setValue, updateValue
isRunning, loop, onParameterChanged, onReset, onStart, onStop, reset, start, stop, toggle, trigger
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, dispose, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscLabel, getParameter, getParameters, getParent, handleOscMessage, load, loadParameters, removeParameter, removeParameter, save, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getDescription, getFormatter, getLabel, getPolarity, getUnits, getValue, getValuef, isMappable, reset, setComponent, setMappable, setValue
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter, getParent, getPath
getOscAddress, handleOscMessage
protected static final double LOG_10
protected LXAudioBuffer buffer
public final CompoundParameter gain
public final CompoundParameter range
public final CompoundParameter attack
public final CompoundParameter release
protected float attackGain
protected float releaseGain
public DecibelMeter(LXAudioBuffer buffer)
buffer
- Audio buffer to meterpublic DecibelMeter(String label, LXAudioBuffer buffer)
label
- Labelbuffer
- Audio buffer to meterpublic DecibelMeter setBuffer(LXAudioBuffer buffer)
public double getExponent()
LXNormalizedParameter
getExponent
in interface LXNormalizedParameter
public float getRaw()
public double getDecibels()
public float getDecibelsf()
public double getSquare()
public float getSquaref()
protected double computeValue(double deltaMs)
LXModulator
computeValue
in class LXModulator
deltaMs
- Number of milliseconds to advance bypublic LXNormalizedParameter setNormalized(double value)
LXNormalizedParameter
setNormalized
in interface LXNormalizedParameter
value
- The normalized value, from 0 to 1public double getPeak()
public float getPeakf()
public double getNormalized()
LXNormalizedParameter
getNormalized
in interface LXNormalizedParameter
public float getNormalizedf()
LXNormalizedParameter
getNormalizedf
in interface LXNormalizedParameter
LX library by Mark C. Slee. © 2012-2020