Class LogFrequencyConcertPitch
- java.lang.Object
-
- com.tagtraum.audiokern.audioprocessor.LogFrequencyConcertPitch
-
- All Implemented Interfaces:
SignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
public class LogFrequencyConcertPitch extends Object implements SignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
Adjusts spectra so that they are in "concert pitch", i.e. A4 is at 440Hz.- See Also:
- Concert pitch on Wikipedia
-
-
Field Summary
Fields Modifier and Type Field Description static float
DEFAULT_MIN_RELIABILITY
-
Constructor Summary
Constructors Constructor Description LogFrequencyConcertPitch()
LogFrequencyConcertPitch(Object id, int binsPerSemitone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <O2> SignalProcessor<LogFrequencySpectrum,O2>
connectTo(SignalProcessor<LogFrequencySpectrum,O2> logFrequencySpectrumO2SignalProcessor)
<O2> SignalProcessor<LogFrequencySpectrum,O2>
disconnectFrom(SignalProcessor<LogFrequencySpectrum,O2> logFrequencySpectrumO2SignalProcessor)
void
flush()
Byte
getCentDeviation()
Deviation of source spectra from concert pitch in cents.SignalProcessor<LogFrequencySpectrum,?>[]
getConnectedProcessors()
Object
getId()
float
getMinReliability()
Minimum reliability.LogFrequencySpectrum
getOutput()
float
getReliability()
Calculated strength of calculated tuning.void
process(LogFrequencySpectrum spectrum)
void
setMinReliability(float minReliability)
Sets the minimum reliability we need to actually shift processed spectra.
-
-
-
Field Detail
-
DEFAULT_MIN_RELIABILITY
public static final float DEFAULT_MIN_RELIABILITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogFrequencyConcertPitch
public LogFrequencyConcertPitch(Object id, int binsPerSemitone)
-
LogFrequencyConcertPitch
public LogFrequencyConcertPitch()
-
-
Method Detail
-
getMinReliability
public float getMinReliability()
Minimum reliability.- Returns:
- minimim reliability
- See Also:
setMinReliability(float)
-
setMinReliability
public void setMinReliability(float minReliability)
Sets the minimum reliability we need to actually shift processed spectra. I.e. if the reliability of the calculated tuning is too low, we do not shift downstream spectra- Parameters:
minReliability
- minimum reliability- See Also:
DEFAULT_MIN_RELIABILITY
-
getReliability
public float getReliability()
Calculated strength of calculated tuning. Value between 0 and 1 - the higher the value the more confident we are in our tuning.- Returns:
- strength
- See Also:
getCentDeviation()
-
connectTo
public <O2> SignalProcessor<LogFrequencySpectrum,O2> connectTo(SignalProcessor<LogFrequencySpectrum,O2> logFrequencySpectrumO2SignalProcessor)
- Specified by:
connectTo
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
-
process
public void process(LogFrequencySpectrum spectrum) throws IOException
- Specified by:
process
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
- Throws:
IOException
-
getCentDeviation
public Byte getCentDeviation()
Deviation of source spectra from concert pitch in cents. May returnnull
, if we are not very confident in the tuning we calculated.- Returns:
- deviation, maybe
null
-
getOutput
public LogFrequencySpectrum getOutput() throws IOException
- Specified by:
getOutput
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
- Throws:
IOException
-
getId
public Object getId()
- Specified by:
getId
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
-
disconnectFrom
public <O2> SignalProcessor<LogFrequencySpectrum,O2> disconnectFrom(SignalProcessor<LogFrequencySpectrum,O2> logFrequencySpectrumO2SignalProcessor)
- Specified by:
disconnectFrom
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
-
getConnectedProcessors
public SignalProcessor<LogFrequencySpectrum,?>[] getConnectedProcessors()
- Specified by:
getConnectedProcessors
in interfaceSignalProcessor<LogFrequencySpectrum,LogFrequencySpectrum>
-
-