Class LinearFrequencyConcertPitch
- java.lang.Object
-
- com.tagtraum.audiokern.audioprocessor.LinearFrequencyConcertPitch
-
- All Implemented Interfaces:
SignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
public class LinearFrequencyConcertPitch extends Object implements SignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
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 LinearFrequencyConcertPitch()
LinearFrequencyConcertPitch(Object id, int lowerBoundaryMidi, int upperBoundaryMidi, int binsPerSemitone)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <O2> SignalProcessor<MultiBandSpectrum,O2>
connectTo(SignalProcessor<MultiBandSpectrum,O2> processor)
<O2> SignalProcessor<MultiBandSpectrum,O2>
disconnectFrom(SignalProcessor<MultiBandSpectrum,O2> processor)
boolean
equals(Object o)
void
flush()
Byte
getCentDeviation()
Deviation of source spectra from concert pitch in cents.SignalProcessor<MultiBandSpectrum,?>[]
getConnectedProcessors()
Object
getId()
float
getMinReliability()
Minimum reliability.MultiBandSpectrum
getOutput()
float
getReliability()
Calculated strength of calculated tuning.int
hashCode()
void
process(LinearFrequencySpectrum spectrum)
void
setMinReliability(float minReliability)
Sets the minimum reliability we need to actually shift processed spectra.String
toString()
-
-
-
Field Detail
-
DEFAULT_MIN_RELIABILITY
public static final float DEFAULT_MIN_RELIABILITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LinearFrequencyConcertPitch
public LinearFrequencyConcertPitch(Object id, int lowerBoundaryMidi, int upperBoundaryMidi, int binsPerSemitone)
-
LinearFrequencyConcertPitch
public LinearFrequencyConcertPitch()
-
-
Method Detail
-
getMinReliability
public float getMinReliability()
Minimum reliability.- Returns:
- minimum 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<MultiBandSpectrum,O2> connectTo(SignalProcessor<MultiBandSpectrum,O2> processor)
- Specified by:
connectTo
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
-
process
public void process(LinearFrequencySpectrum spectrum) throws IOException
- Specified by:
process
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
- 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 MultiBandSpectrum getOutput() throws IOException
- Specified by:
getOutput
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
- Throws:
IOException
-
getId
public Object getId()
- Specified by:
getId
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
-
disconnectFrom
public <O2> SignalProcessor<MultiBandSpectrum,O2> disconnectFrom(SignalProcessor<MultiBandSpectrum,O2> processor)
- Specified by:
disconnectFrom
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
-
getConnectedProcessors
public SignalProcessor<MultiBandSpectrum,?>[] getConnectedProcessors()
- Specified by:
getConnectedProcessors
in interfaceSignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
-
-