24 #ifndef SOUNDGENERATOR_H
25 #define SOUNDGENERATOR_H
30 #include "../midi/midiadapter.h"
31 #include "../../piano/piano.h"
32 #include "../../messages/messagelistener.h"
80 #endif // SOUNDGENERATOR_H
void preCalculateSoundOfAllKeys()
Calculate the sound of all keys in advance.
std::shared_ptr< Message > MessagePtr
Global type of a shared message pointer.
void handleMessage(MessagePtr m) overridefinal
Sound generator message listener and dispatcher.
Class for managing the sound generation in the EPT.
OperationMode
Operation mode of the tuner.
void stopResonatingReferenceSound()
Stop the resonating reference sound.
int mResonatingKey
Keynumber of the resonating sound.
double mResonatingVolume
Volume of the resonating sound.
void preCalculateSoundOfKey(const int keynumber)
Calculate the sound of a given key in advance, using the spectrum of the given key.
Synthesizer mSynthesizer
Instance of the synthesizer.
SoundGeneratorMode
Mode for sound generation.
const Piano * mPiano
Pointer to the piano.
SoundGenerator(AudioPlayerAdapter *audioAdapter)
Constructor, initializes the member variables.
void exit()
Synthesizer shutdown.
OperationMode mOperationMode
Copy of the operation mode.
void playResonatingSineWave(int keynumber, double frequency, double volume)
Play a permanent sine wave as a resonating background sound for tuning.
virtual void exit() overridefinal
Exit, shut down writer interface.
int mSelectedKey
Copy of selected key.
int mNumberOfKeys
Copy of the number of keys.
void playResonatingReferenceSound(int keynumber)
Play a resonating reference sound in the tuning mode.
Produce a sound which imitates the string.
void handleMidiKeypress(MidiAdapter::Data &data)
Handle MIDI keypress.
Produce a simple sine wave as reference.
void init()
Initialize (no functionality)
std::map< double, double > Spectrum
Abstract adapter class for PCM-based audio output drivers.
int mKeyNumberOfA4
Copy of A-key position.
void changeVolumeOfResonatingReferenceSound(double level)
Change the volume of the resonating reference sound.
Structure of the data associated with a MIDI event.