Class HarteConcertPitch
- java.lang.Object
-
- com.tagtraum.audiokern.audioprocessor.HarteConcertPitch
-
- All Implemented Interfaces:
SignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
public class HarteConcertPitch extends Object implements SignalProcessor<LinearFrequencySpectrum,MultiBandSpectrum>
Adjusts spectra so that they are in "concert pitch", i.e. A4 is at 440Hz. This implementation is similar to the concept proposed by Chris Harte in Towards automatic extraction of harmony information from music signals. PhD Thesis, Queen Mary University of London (2010).- See Also:
- Concert pitch on Wikipedia
-
-
Constructor Summary
Constructors Constructor Description HarteConcertPitch()
HarteConcertPitch(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()
MultiBandSpectrum
getOutput()
int
hashCode()
void
process(LinearFrequencySpectrum spectrum)
String
toString()
-
-
-
Constructor Detail
-
HarteConcertPitch
public HarteConcertPitch(Object id, int lowerBoundaryMidi, int upperBoundaryMidi, int binsPerSemitone)
-
HarteConcertPitch
public HarteConcertPitch()
-
-
Method Detail
-
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>
-
-