24 #ifndef ENTROPYMINIMIZER_H
25 #define ENTROPYMINIMIZER_H
105 void writeSpectrum(
int k, std::string filename,
int pitch=0);
110 #endif // ENTROPYMINIMIZER_H
int getTolerance(int keynumber)
Allowed tolerance of the tuning curve during the Monte Carlo process.
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
SpectrumType mAccumulator
Accumulator holding the sum of all spectra.
std::vector< int > mPitch
Vector of pitches (in cents)
std::vector< double > mInitialPitch
Vector of initial pitches.
Class describing the piano keyboard, holding a collection of keys.
bool mRecalculateEntropy
Flag for entropy recalculation (after manual intervention by the user)
Key::SpectrumType SpectrumType
void ComputeInitialTuningCurve()
Compute initial condition of the tuning curve.
static double mtof(int m)
Convert array index in cent spacing to frequency in Hz.
void writeAccumulator(std::string filename)
int mRecalculateKey
Number of manually changed key.
bool performAuditoryPreprocessing()
Auditory preprocessing.
Class describing a single piano key.
void algorithmWorkerFunction() overridefinal
Main calculation, running in an independent thread.
void setAllSpectralComponents()
void addReferenceSpectrum(double intensity)
void addToAccumulator(SpectrumType &spectrum, int shift, double intensity)
Add or subtract a spectrum to the accumulator.
int mUpperCutoff
Upper cutoff for fluctuations.
static double IndexToFrequency(double m)
Convert continuous slot index to frequency in Hz.
virtual void handleMessage(MessagePtr m) overridefinal
Message listener and dispatcher for mouse clicks in the tuning curve.
int getRecordedPitchET440AsInt(int keynumber)
Get recorded pitch.
double mRecalculateFrequency
Frequency of manually changed key.
static double ftom(double f)
Convert frequency to array index in cent spacing.
static double FrequencyToRealIndex(double f)
Convert frequency to real-valued logbin index.
Namespace for all entropy minimizer components.
void updateTuningcurve()
Update the entire tuning curve.
int getPitchET440(int keynumber, double f)
Get pitch from frequ.
Iterative entropy minimization algorithm.
void modifySpectralComponent(int key, int pitch)
The Algorithm class is a basic abstract class for any algorithm.
double getElement(SpectrumType &spectrum, int m)
Truncate logspectrum at the cutoffs and return an element.
EntropyMinimizer(const Piano &piano, const AlgorithmFactoryDescription &desciption)
Constructor.
double getRecordedPitchET440(int keynumber)
Get recorded pitch.
void minimizeEntropy()
Entropy minimizer.
double computeEntropy()
Compute the entropy of the current normalized accumulator content.
int mLowerCutoff
Lower cutoff for fluctuations.
void writeSpectrum(int k, std::string filename, int pitch=0)