Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
MidiMicrotonal Class Reference

Class for converting an ordinary Midi stream into a microtonal one. More...

#include <midimicrotonal.h>

Inheritance diagram for MidiMicrotonal:
Inheritance graph
Collaboration diagram for MidiMicrotonal:
Collaboration graph

Public Slots

void receiveMidiEvent (const QMidiMessage event)
 Input slot: Here the module receives the stream of incoming Midi events. More...
 
void receiveTuningCorrections (QMap< int, double > corrections)
 Input slot: Receive tuning corrections from the tuner (<key,cent>) More...
 
void allNotesOff ()
 Slot: Turns all notes off. More...
 
void setMidiOutputChannel (int channel)
 Slot: Set the instrument channel of the external Midi device. More...
 
void reInitializeConvertedMidiStream ()
 Slot: Re-initialize the output stream. More...
 

Signals

void sendMidiEvent (QMidiMessage event)
 Output signal: This is the converted outgoing stream of Midi events. More...
 
void onClosedMidiLoopDetected ()
 onClosedMidiLoopDetected More...
 

Public Member Functions

 MidiMicrotonal ()
 Constructor, resetting member variables. More...
 
bool init ()
 Initialization, no functionality. More...
 
bool exit ()
 Shutdown, no functionality. More...
 
bool start ()
 Start the microtonal converter. More...
 
bool stop ()
 Stop the microtonal converter. More...
 
void suspend ()
 Suspend the microtonal converter. More...
 
void resume ()
 Resume from suspend mode. More...
 
void activate (bool active)
 Activate or deactivate the module. More...
 
bool isWorking ()
 
void setVerbosity (int verbosity)
 Set the verbosity level of the class-specific messages. More...
 
int getVerbosity ()
 Get the actual verbosity level. More...
 

Static Public Attributes

static const QMidiMessage cLoopMarker
 Closed-loop marking event. More...
 

Private Attributes

MidiMicrotonalHelper mMidiMicrotonalHelper
 
bool mRunning
 
bool mActive
 
bool mSuspended
 
int mLastChannelModeMessage
 
QMutex mMutex
 
QTimer mTimer
 

Detailed Description

Class for converting an ordinary Midi stream into a microtonal one.

Definition at line 62 of file midimicrotonal.h.

Constructor & Destructor Documentation

MidiMicrotonal::MidiMicrotonal ( )

Constructor, resetting member variables.

Definition at line 35 of file midimicrotonal.cpp.

Here is the call graph for this function:

Member Function Documentation

void MidiMicrotonal::activate ( bool  active)

Activate or deactivate the module.

Parameters
active: true if on, false otherwise

Definition at line 171 of file midimicrotonal.cpp.

Here is the call graph for this function:

void MidiMicrotonal::allNotesOff ( )
slot

Slot: Turns all notes off.

Definition at line 307 of file midimicrotonal.cpp.

Here is the call graph for this function:

bool MidiMicrotonal::exit ( )

Shutdown, no functionality.

Returns
true

Definition at line 87 of file midimicrotonal.cpp.

int Log::getVerbosity ( )
inherited

Get the actual verbosity level.

Returns
: Verbosity level (1...4)

Definition at line 118 of file log.cpp.

bool MidiMicrotonal::init ( )

Initialization, no functionality.

Returns
True

Definition at line 75 of file midimicrotonal.cpp.

bool MidiMicrotonal::isWorking ( )
inline

Definition at line 144 of file midimicrotonal.h.

void MidiMicrotonal::onClosedMidiLoopDetected ( )
signal

onClosedMidiLoopDetected

Signal sent when a closed Midi loop has been detected. If the application is connected to a virtual loop device (such as "Midi Through"), the emitted Midi commands immediately bounce back, leading to a short-circuit of Midi commands freezing the application. To this end the Midi output regularly sends markers which are detected on the input side. If a marker is detected, this signal is sent which should be used to disconnect the Midi output.

void MidiMicrotonal::receiveMidiEvent ( const QMidiMessage  event)
slot

Input slot: Here the module receives the stream of incoming Midi events.

The input slot processes the event only if the module has been started. It is executed in the thread that instantiated the module.

Definition at line 192 of file midimicrotonal.cpp.

Here is the call graph for this function:

void MidiMicrotonal::receiveTuningCorrections ( QMap< int, double >  corrections)
slot

Input slot: Receive tuning corrections from the tuner (<key,cent>)

Parameters
corrections: QMap<int,double> holding the keys and the corresponding cent deviation.

Definition at line 282 of file midimicrotonal.cpp.

Here is the call graph for this function:

void MidiMicrotonal::reInitializeConvertedMidiStream ( )
slot

Slot: Re-initialize the output stream.

This slot is called when the MIDI output device changes

Definition at line 336 of file midimicrotonal.cpp.

Here is the call graph for this function:

void MidiMicrotonal::resume ( )

Resume from suspend mode.

Definition at line 152 of file midimicrotonal.cpp.

void MidiMicrotonal::sendMidiEvent ( QMidiMessage  event)
signal

Output signal: This is the converted outgoing stream of Midi events.

void MidiMicrotonal::setMidiOutputChannel ( int  channel)
slot

Slot: Set the instrument channel of the external Midi device.

While Midi is polyphononic, the remapped Midi produced by this class can play only one instrument, which is set here.

Parameters
channel: 0...127

Definition at line 324 of file midimicrotonal.cpp.

Here is the call graph for this function:

void Log::setVerbosity ( int  verbosity)
inherited

Set the verbosity level of the class-specific messages.

Parameters
verbosity: Verbosity level (1...4)

Definition at line 107 of file log.cpp.

bool MidiMicrotonal::start ( )

Start the microtonal converter.

Returns
true

Definition at line 99 of file midimicrotonal.cpp.

bool MidiMicrotonal::stop ( )

Stop the microtonal converter.

Returns
true

Definition at line 116 of file midimicrotonal.cpp.

Here is the call graph for this function:

void MidiMicrotonal::suspend ( )

Suspend the microtonal converter.

If a closed Midi loop is detected the converter is suspended. In the suspend mode the input slot receiveMidiEvent() ignores any input.

Definition at line 139 of file midimicrotonal.cpp.

Member Data Documentation

const QMidiMessage MidiMicrotonal::cLoopMarker
static

Closed-loop marking event.

The application sends this MIDI command to the output Midi device from time to time. If this marker is received by the Midi input, this indicates that the externally connected device simply forwards the output back to the input, which would lead to a dangerous feedback loop of Midi commend. This marker serves as a tag to discover such feedback loops and to disconnect the output device in such a case.

Definition at line 143 of file midimicrotonal.h.

bool MidiMicrotonal::mActive
private

Definition at line 136 of file midimicrotonal.h.

int MidiMicrotonal::mLastChannelModeMessage
private

Definition at line 138 of file midimicrotonal.h.

MidiMicrotonalHelper MidiMicrotonal::mMidiMicrotonalHelper
private

Definition at line 134 of file midimicrotonal.h.

QMutex MidiMicrotonal::mMutex
private

Definition at line 139 of file midimicrotonal.h.

bool MidiMicrotonal::mRunning
private

Definition at line 135 of file midimicrotonal.h.

bool MidiMicrotonal::mSuspended
private

Definition at line 137 of file midimicrotonal.h.

QTimer MidiMicrotonal::mTimer
private

Definition at line 140 of file midimicrotonal.h.


The documentation for this class was generated from the following files: