32 #include <QElapsedTimer> 33 #include <QMidiMessage> 54 bool init()
override final;
55 bool start()
override final;
66 double secondsSustainBass,
67 double secondsSustainTreble,
68 double secondsRelease);
void signalIntervalString(QVariant str)
Signal emitting the tuned interval sizes in a human-readable form.
bool start() override final
Public slot: Start the tuner, starting the tuner thread.
Universal base class for threaded modules.
void setIntervalSize(int semitones, double cents)
Public Slot: Set interval size This function allows the user to specify the temperament. To this end one specifies the interval sizes relative to the equal temperament in cents. The complete definition of the temperament requires to set all interval sizes, meaning that this slot has to be called 11 times.
const double cutoffMemory
double mPitchAutoCorrectionParameter
Pitch correction parameters.
const double memoryOnSeconds
const uint tuningIntervalMsec
Update interval tuning.
QVector< double > mIntervalWeights
List of 12 interval weights.
TunerAlgorithm mTunerAlgorithm
The tuning algorithm.
void enableTuning(bool enable)
Public Slot: Enable or disable adaptive tuning.
double mMemoryOffFactor
Update factor for memory decay.
void setStaticTuningMode(bool enable, int reference=0)
Slot: Enable or disable static tuning mode.
void signalAveragePitchDrift(double progression)
Signal that periodically transmits the average pitch progression. In the GUI this progression is indi...
bool init() override final
Initialize the Tuner.
void setMemoryLength(double seconds)
Public slot: Set memory parameter.
void resetPitchProgression()
Reset average pitch progression to a given value.
QString mLastMessage
remember last message sent
const uint noteTimeoutSeconds
void setTuningMode(int mode, int wolfsShift)
Public slot: Set tuning mode.
Tuner()
Constructor of the Tuner.
virtual void periodicallyCalledWorker() override final
Periodically called worker function: Update key data.
bool mTuningEnabled
Flag for temporary on/off.
double mDelayParameter
Delay time.
QString f(Eigen::MatrixXd mat)
qint8 mWaitingTimeMsec
Waiting time before tuning event.
void setDelayParameter(double delay)
Public Slot: Set delay parameter.
void signalTension(QVariant mu)
Signal emitting the network tension in the tuned chord, indicating the deviation from just intonation...
int mStaticReferenceKey
Index of static UT reference key.
void handlePitchDrift()
Handle pitch drift.
void setIntervalWeight(int semitones, double weight)
Public Slot: Set interval weight The human perception of various intervals depends on their size...
QVector< double > mIntervalSizes
List of 12 interval sizes.
double mGlobalTargetPitchInCents
Global pitch against 440Hz.
This is the main class of the tuner module.
qint64 getNow()
Private function: Get current elapsed tuner runtime in milliseconds.
void signalTuningCorrections(QMap< int, double > corrections)
Signal sending the tuning results to the microtonal sound device in the form of a map keyindex -> cen...
const uint updateIntervalMsec
Update interval envelope.
void receiveMidiEvent(QMidiMessage event)
Public slot: Receive Midi event (Main input of the tuner)
void setFrequencyOfA4(double f=440)
Public slot: Set the desired target frequency of A4 (concert pitch)
QVector< KeyData > mKeyDataVector
Vector containing all key data.
const double memoryOnFactor
int mWolfsIntervalShift
Placement of the wolfs interval.
void setPitchProgressionCompensationParameter(double lambda)
Public slot: Set the parameter for pitch progression compensation.
void emitPitchCorrections()
Emit the pitch corrections This functions checks to what extent the calculated pitches differ from th...
void signalReadyForReceivingParameters()
Signal telling the GUI that the tuner is ready and that the GUI may send the user-defined parameters ...
QElapsedTimer * pElapsedTimer
Time elapsed since construction.
bool mStaticTuningModeEnabled
Flag: Tune statically.
virtual void finallyCalledWorker() override final
Cleanup of the terminating thread.
const double cutoffIntensity
int mTuningMode
Actual tuning mode.
void setEnvelopeParameters(double secondsSustainBass, double secondsSustainTreble, double secondsRelease)
Set the essential parameters of the envelope.
virtual void initiallyCalledWorker() override final
Initialization of the starting thread.
void tune()
Tune the pitches of the pressed keys (call TunerAlgorithm)