30 , pSoundGenerator(&soundgenerator)
31 , pAudioOutput(&audiooutput)
33 , mModulationWheel(-1)
35 , mTemperamentIndex(1)
42 #define STATUS if (mVerbosity >= 4) qDebug() << "MidiHandler:" 43 #define MESSAGE if (mVerbosity >= 3) qDebug() << "MidiHandler:" 44 #define WARNING if (mVerbosity >= 2) qWarning()<<"MidiHandler: WARNING:" 45 #define ERROR if (mVerbosity >= 1) qCritical() << "MidiHandler: ERROR:" 62 request.
channel =
event.byte0() & 0x0F;
63 request.
key =
event.byte1();
64 request.
intensity =
static_cast<double>(
event.byte2())/127.0;
73 switch (event.byte0() & 0xF0)
90 switch (event.byte1())
97 if (event.byte2() > 0x60 and tempindex != 1) tempindex = 1;
98 if (event.byte2() < 0x20 and tempindex != 0) tempindex = 0;
103 qDebug() <<
"Modulation wheel switches to temperament " << tempindex;
111 double volume = 0.3 + 0.7 *
event.byte2() / 127.0;
131 if (event.byte1() > 113)
134 LOGSTATUS <<
"Added drum on channel" << (
event.byte0()&0x0F);
bool isActive() const
Return true if thread is running and not suspended.
Universal base class for threaded modules.
Class managing the generation of sound.
void signalSostenutoPedal(bool pressed)
Structure containing the data for a play-note request.
void changeTargetFrequency(QVariant df)
void registerRequest(Request &request)
Register a single request to play a note in the queue.
void setVolume(double volume)
Set the global volume of the audio device.
void signalSoftPedal(bool pressed)
int channel
MIDI channel (0..15)
int key
Key index according to MIDI norm (0..127)
void receiveMidiEvent(const QMidiMessage &event)
MidiHandler(SoundGenerator &soundgenerator, AudioOutput &audiooutput)
void setQmlTemperamentIndex(QVariant index)
void registerAllNotesOff()
AudioOutput * pAudioOutput
SoundGenerator * pSoundGenerator
QVector< quint8 > mDrumChannels
void setThreadName(const QString name)
Set thread name (Linux only)
Play a note with parameters listed below.
void signalSustainPedal(bool pressed)
int data
multipurpose data (do we really need that)