Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Algorithm to copy the recorded pitches into the tuning curve. More...
#include <resettorecording.h>
Public Member Functions | |
ResetToRecording (const Piano &piano, const AlgorithmFactoryDescription &description) | |
Constructor of the copy algorithm. More... | |
Public Member Functions inherited from Algorithm | |
Algorithm (const Piano &piano, const AlgorithmFactoryDescription &desciption) | |
virtual | ~Algorithm () |
virtual void | workerFunction () overridefinal |
Virtual worker function, executed within the new thread. More... | |
Public Member Functions inherited from SimpleThreadHandler | |
SimpleThreadHandler () | |
Constructor. More... | |
virtual | ~SimpleThreadHandler () |
virtual destructor calls stop More... | |
virtual void | start () |
Start the thread. More... | |
virtual void | stop () |
Stop the thread. More... | |
Protected Member Functions | |
virtual void | algorithmWorkerFunction () overridefinal |
Worker function in which the computation thread is carried out. More... | |
Protected Member Functions inherited from Algorithm | |
void | updateTuningCurve (int keynumber, double frequency) |
bool | terminateThread () |
void | showCalculationProgress (double fraction) |
Transmit the current percentage of progress to the messaging system. More... | |
void | showCalculationProgress (const Key &key, double start=0, double range=1) |
Transmit the current percentage of progress to the messaging system. More... | |
Protected Member Functions inherited from SimpleThreadHandler | |
virtual void | exceptionCaught (const EptException &e) |
EPT exception handling. More... | |
void | setCancelThread (bool b) |
Cancel-flag setter method, thread-safe. More... | |
bool | cancelThread () const |
Cancel-flag getter method, thread-safe. More... | |
void | msleep (double milliseconds) |
Sleep function for staying idle. More... | |
bool | isThreadRunning () const |
Flag to check if the thread is running. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from SimpleThreadHandler | |
static void | setThreadName (std::string s) |
Specify the name of the thread. More... | |
Protected Types inherited from Algorithm | |
using | Keys = Keyboard::Keys |
using | SpectrumType = Key::SpectrumType |
Protected Attributes inherited from Algorithm | |
const size_t | NumberOfBins = Key::NumberOfBins |
Piano | mPiano |
Copy of the piano. More... | |
const AlgorithmFactoryDescription & | mFactoryDescription |
Keyboard & | mKeyboard |
Reference to the keyboard. More... | |
Keys & | mKeys |
Reference to the keys. More... | |
const int | mNumberOfKeys |
The number of keys. More... | |
const int | mKeyNumberOfA4 |
Number of A4. More... | |
Algorithm to copy the recorded pitches into the tuning curve.
This algorith simply copies the recorded pitches. This works also in the case where the keys were only partially recorded. If A4 has been recorded and the ConcertPitch is different, the pitches will be shifted to the wanted ConcertPitch. Therefore, to get an unshifted copy, the ConcertPitch in the settings should be the same as the recorded A4. If A4 was recorded it is assumed that A4=440Hz.
This algorithm shows the coder how algorithms can be implemented. It can also be used by the users to copy or shift an existing tune.
Definition at line 47 of file resettorecording.h.
resettorecording::ResetToRecording::ResetToRecording | ( | const Piano & | piano, |
const AlgorithmFactoryDescription & | description | ||
) |
Constructor of the copy algorithm.
piano | : Reference to a copy of the piano |
description | : String describing the algorithm |
Definition at line 46 of file resettorecording.cpp.
|
finaloverrideprotectedvirtual |
Worker function in which the computation thread is carried out.
Implements Algorithm.
Definition at line 60 of file resettorecording.cpp.