Class RoughnessProcessor
- java.lang.Object
-
- com.tagtraum.jipes.AbstractSignalProcessor<LinearFrequencySpectrum,Float>
-
- com.tagtraum.audiokern.audioprocessor.RoughnessProcessor
-
- All Implemented Interfaces:
SignalProcessor<LinearFrequencySpectrum,Float>,SignalPullProcessor<LinearFrequencySpectrum,Float>,SignalSource<Float>
public class RoughnessProcessor extends AbstractSignalProcessor<LinearFrequencySpectrum,Float>
Computes the sensory dissonance also known as roughness. How the value is computed, can be manipulated through
setRoughness(com.tagtraum.audiokern.audioprocessor.RoughnessProcessor.Roughness). By default,SETHARES_ROUGHNESSis used.In a pull scenario this processor requires a generator that produces
LinearFrequencySpectrums. In a push scenario, this processor may listen to another push processor that producesLinearFrequencySpectrums.- Author:
- Hendrik Schreiber
- See Also:
FFT, Roughness Calculation Model (from Vassilakis, 2001 & 2005), Sethares, W. A. (1998). Tuning, Timbre, Spectrum, Scale. London: Springer-Verlag., Vassilakis, P. N. (2005). Auditory roughness as means of musical expression. Selected Reports in Ethnomusicology 12 (Perspectives in Systematic Musicology): 119-144.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRoughnessProcessor.Roughness
-
Field Summary
Fields Modifier and Type Field Description static RoughnessProcessor.RoughnessDEFAULT_ROUGHNESSstatic RoughnessProcessor.RoughnessSETHARES_ROUGHNESSstatic RoughnessProcessor.RoughnessVASSILAKIS_ROUGHNESS-
Fields inherited from class com.tagtraum.jipes.AbstractSignalProcessor
lastOut, signalProcessorSupport
-
-
Constructor Summary
Constructors Constructor Description RoughnessProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)voidflush()floatgetContrastPeakThreshold()FloatgetOutput()RoughnessProcessor.RoughnessgetRoughness()inthashCode()static doubleplompLeveltDissonance(float freq1, float freq2)Returns the dissonance of two pure tones at frequencies freq1 and freq2 Hz according to the Plomp-Levelt curve (see term Z).voidprocess(LinearFrequencySpectrum spectrum)protected FloatprocessNext(LinearFrequencySpectrum spectrum)Floatread()voidreset()voidsetContrastPeakThreshold(float contrastPeakThreshold)voidsetRoughness(RoughnessProcessor.Roughness roughness)StringtoString()-
Methods inherited from class com.tagtraum.jipes.AbstractSignalProcessor
connectTo, connectTo, connectTo, disconnectFrom, getConnectedProcessors, getConnectedSource, getId, setId
-
-
-
-
Field Detail
-
SETHARES_ROUGHNESS
public static final RoughnessProcessor.Roughness SETHARES_ROUGHNESS
-
VASSILAKIS_ROUGHNESS
public static final RoughnessProcessor.Roughness VASSILAKIS_ROUGHNESS
-
DEFAULT_ROUGHNESS
public static final RoughnessProcessor.Roughness DEFAULT_ROUGHNESS
-
-
Method Detail
-
getContrastPeakThreshold
public float getContrastPeakThreshold()
-
setContrastPeakThreshold
public void setContrastPeakThreshold(float contrastPeakThreshold)
-
getRoughness
public RoughnessProcessor.Roughness getRoughness()
-
setRoughness
public void setRoughness(RoughnessProcessor.Roughness roughness)
-
reset
public void reset()
- Specified by:
resetin interfaceSignalSource<Float>- Overrides:
resetin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
-
processNext
protected Float processNext(LinearFrequencySpectrum spectrum) throws IOException
- Specified by:
processNextin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>- Throws:
IOException
-
process
public void process(LinearFrequencySpectrum spectrum) throws IOException
- Specified by:
processin interfaceSignalProcessor<LinearFrequencySpectrum,Float>- Overrides:
processin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceSignalProcessor<LinearFrequencySpectrum,Float>- Overrides:
flushin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>- Throws:
IOException
-
getOutput
public Float getOutput() throws IOException
- Specified by:
getOutputin interfaceSignalProcessor<LinearFrequencySpectrum,Float>- Overrides:
getOutputin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>- Throws:
IOException
-
read
public Float read() throws IOException
- Specified by:
readin interfaceSignalSource<Float>- Overrides:
readin classAbstractSignalProcessor<LinearFrequencySpectrum,Float>- Throws:
IOException
-
plompLeveltDissonance
public static double plompLeveltDissonance(float freq1, float freq2)Returns the dissonance of two pure tones at frequencies freq1 and freq2 Hz according to the Plomp-Levelt curve (see term Z).- Parameters:
freq1- frequency 1 in Hzfreq2- frequency 2 in Hz- Returns:
- dissonance according to the Plomp-Levelt curve
-
-