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_ROUGHNESS
is used.In a pull scenario this processor requires a generator that produces
LinearFrequencySpectrum
s. In a push scenario, this processor may listen to another push processor that producesLinearFrequencySpectrum
s.- 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 interface
RoughnessProcessor.Roughness
-
Field Summary
Fields Modifier and Type Field Description static RoughnessProcessor.Roughness
DEFAULT_ROUGHNESS
static RoughnessProcessor.Roughness
SETHARES_ROUGHNESS
static RoughnessProcessor.Roughness
VASSILAKIS_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 boolean
equals(Object o)
void
flush()
float
getContrastPeakThreshold()
Float
getOutput()
RoughnessProcessor.Roughness
getRoughness()
int
hashCode()
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).void
process(LinearFrequencySpectrum spectrum)
protected Float
processNext(LinearFrequencySpectrum spectrum)
Float
read()
void
reset()
void
setContrastPeakThreshold(float contrastPeakThreshold)
void
setRoughness(RoughnessProcessor.Roughness roughness)
String
toString()
-
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:
reset
in interfaceSignalSource<Float>
- Overrides:
reset
in classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
-
processNext
protected Float processNext(LinearFrequencySpectrum spectrum) throws IOException
- Specified by:
processNext
in classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
- Throws:
IOException
-
process
public void process(LinearFrequencySpectrum spectrum) throws IOException
- Specified by:
process
in interfaceSignalProcessor<LinearFrequencySpectrum,Float>
- Overrides:
process
in classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceSignalProcessor<LinearFrequencySpectrum,Float>
- Overrides:
flush
in classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
- Throws:
IOException
-
getOutput
public Float getOutput() throws IOException
- Specified by:
getOutput
in interfaceSignalProcessor<LinearFrequencySpectrum,Float>
- Overrides:
getOutput
in classAbstractSignalProcessor<LinearFrequencySpectrum,Float>
- Throws:
IOException
-
read
public Float read() throws IOException
- Specified by:
read
in interfaceSignalSource<Float>
- Overrides:
read
in 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
-
-