Entropy Piano Tuner
1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
|
Drawer for the tuning indicator. More...
#include <tuningindicatordrawer.h>
Public Member Functions | |
TuningIndicatorDrawer (GraphicsViewAdapter *graphics) | |
~TuningIndicatorDrawer () | |
void | toggleSpectralAndStroboscopeMode () |
Toggle between spectral and stroboscopic operation mode. More... | |
Public Member Functions inherited from DrawerBase | |
DrawerBase (GraphicsViewAdapter *graphics, double intervall=1.0/24.0) | |
Constructor of a drawer. More... | |
~DrawerBase () | |
void | redraw (bool force=false) |
Function to completely redraw the scene. More... | |
bool | requestRedraw (bool force=false) |
Check whether the content has to be redrawn. More... | |
Protected Member Functions | |
virtual void | draw () overridefinal |
Main drawing function. More... | |
virtual void | clear () overridefinal |
Clear the shared pointer to the FFT. More... | |
virtual void | handleMessage (MessagePtr m) override |
Message listener. More... | |
Private Types | |
using | ComplexVector = std::vector< std::complex< double >> |
Private Attributes | |
const Piano * | mPiano |
Pointer to the piano. More... | |
int | mNumberOfKeys |
Total number of keys. More... | |
int | mSelectedKey |
Number of selected key, -1 if none. More... | |
int | mRecognizedKey |
Number of recognized key, -1 if none. More... | |
OperationMode | mOperationMode |
Current operation mode of the EPT. More... | |
FFTDataPointer | mFFTData |
Pointer to the Fourier transform data. More... | |
FrequencyDetectionResult | mFrequencyDetectionResult |
Copy of frequency detection result. More... | |
ComplexVector | mDataVector |
Data vector holding complex phases for stroboscope. More... | |
Additional Inherited Members | |
Protected Attributes inherited from DrawerBase | |
GraphicsViewAdapter * | mGraphics |
Pointer to the graphics view adapter. More... | |
Drawer for the tuning indicator.
This class draws the content of the tuning indicator in the tuning mode. It is completely driven by messages. There are two operation modes depending on the settings: (a) the spectral mode, where a zoomed part of the spectrum is displayed which has to be brought to the center, and (b) the stroboscopic mode, where a stroboscopic interference pattern is shown in rainbow colors.
Definition at line 44 of file tuningindicatordrawer.h.
|
private |
Definition at line 67 of file tuningindicatordrawer.h.
TuningIndicatorDrawer::TuningIndicatorDrawer | ( | GraphicsViewAdapter * | graphics | ) |
Definition at line 37 of file tuningindicatordrawer.cpp.
|
inline |
Definition at line 48 of file tuningindicatordrawer.h.
|
finaloverrideprotectedvirtual |
Clear the shared pointer to the FFT.
Reimplemented from DrawerBase.
Definition at line 157 of file tuningindicatordrawer.cpp.
|
finaloverrideprotectedvirtual |
Main drawing function.
This is the main drawing function for the tuning indicator. In the stroboscopic mode the complex phases of the partials are simply fowarded to the function drawStroboscope of the GraphicsViewAdapter. This means that the drawing of the stroboscope is done by the implementation for the sake of fast response. In the spectral mode the drawing is carried out by the present function.
Implements DrawerBase.
Definition at line 180 of file tuningindicatordrawer.cpp.
|
overrideprotectedvirtual |
Message listener.
The message listener handles the incoming messages and takes the corresponding action.
m | : Pointer to the incoming message |
Implements MessageListener.
Definition at line 61 of file tuningindicatordrawer.cpp.
void TuningIndicatorDrawer::toggleSpectralAndStroboscopeMode | ( | ) |
Toggle between spectral and stroboscopic operation mode.
Definition at line 140 of file tuningindicatordrawer.cpp.
|
private |
Data vector holding complex phases for stroboscope.
Definition at line 68 of file tuningindicatordrawer.h.
|
private |
Pointer to the Fourier transform data.
Definition at line 64 of file tuningindicatordrawer.h.
|
private |
Copy of frequency detection result.
Definition at line 65 of file tuningindicatordrawer.h.
|
private |
Total number of keys.
Definition at line 59 of file tuningindicatordrawer.h.
|
private |
Current operation mode of the EPT.
Definition at line 62 of file tuningindicatordrawer.h.
|
private |
Pointer to the piano.
Definition at line 58 of file tuningindicatordrawer.h.
|
private |
Number of recognized key, -1 if none.
Definition at line 61 of file tuningindicatordrawer.h.
|
private |
Number of selected key, -1 if none.
Definition at line 60 of file tuningindicatordrawer.h.