Just Intonation  Version 1.3.0 (18)
Explore scale-independent dynamically adapting tuning in just intonation
midimicrotonalhelper.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright 2016-2017 Karolin Stange, Christoph Wick, and Haye Hinrichsen
3  *
4  * This file is part of JustIntonation.
5  *
6  * JustIntonation is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by the
8  * Free Software Foundation, either version 3 of the License, or (at your
9  * option) any later version.
10  *
11  * JustIntonation is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14  * for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with JustIntonation. If not, see http://www.gnu.org/licenses/.
18  *****************************************************************************/
19 
20 //=============================================================================
21 // Microtonal Midi Helper Class
22 //=============================================================================
23 
24 #ifndef MICROTONALHELPER_H
25 #define MICROTONALHELPER_H
26 
27 #include "system/log.h"
28 
29 class MidiMicrotonal;
30 
35 
36 class MidiMicrotonalHelper : public QObject, public Log
37 {
38  Q_OBJECT
39 public:
40  MidiMicrotonalHelper(MidiMicrotonal *midimicrotone);
41 
42  void setInstrument (int instrument);
43  void turnNoteOn (int channel, int key, int volume, double delta);
44  void turnNoteOff (int channel, int key, double delta);
45  void afterTouch (int channel, int key, int volume, double delta);
46  void controlChange (int channel, int control, int value, double delta);
47  void bankSelect (int bank, double delta);
48  void allNotesOff();
49  void resetAllControllers();
50  void localControl (bool on);
51  void tune (int key, double pitch);
52 
53 public slots:
54  void sendInitialMidiCommands (void);
55 
56 private:
57  void playNote (bool on, int mappedChannel, int key, int vol, double delta);
58  void setPitchBend (int channel, double pitch);
59 
60 private:
62  QVector<bool> mMappedChannelIsUsed;
63  QVector<int> mKeyOfMappedChannel;
66  QVector<double> mCurrentPitch;
68  const int cDrumChannel = 9;
69 };
70 
71 #endif // MICROTONALHELPER_H
void resetAllControllers()
Reset all controllers.
QVector< bool > mMappedChannelIsUsed
Indicates usage of channel.
MidiMicrotonalHelper(MidiMicrotonal *midimicrotone)
Constructor, resetting the member variables.
void setPitchBend(int channel, double pitch)
void allNotesOff()
Turn all notes off.
void bankSelect(int bank, double delta)
MidiMicrotonalHelper::bankSelect.
void controlChange(int channel, int control, int value, double delta)
Polyphonic Key Pressure (Aftertouch).
MidiMicrotonal * pMidiMicrotonal
Pointer back.
void setInstrument(int instrument)
Set the instrument (program)
void playNote(bool on, int mappedChannel, int key, int vol, double delta)
int mSequentialNumber
Increasing tag.
Class for converting an ordinary Midi stream into a microtonal one.
void turnNoteOn(int channel, int key, int volume, double delta)
Turn note on.
void localControl(bool on)
Enable local control.
void sendInitialMidiCommands(void)
Send initial Midi commands.
void tune(int key, double pitch)
MidiMicrotonalHelper::tune.
void afterTouch(int channel, int key, int volume, double delta)
Polyphonic Key Pressure (Aftertouch).
const int cDrumChannel
Take out drum channel.
Auxiliary class for microtonal conversion.
Base class for managing log messages.
Definition: log.h:83
int mInstrument
The selected instrument.
QVector< double > mCurrentPitch
Pitch.
void turnNoteOff(int channel, int key, double delta)
Turn note off.
QVector< int > mSequentialNumberOfMappedChannel
Tag storage.
QVector< int > mKeyOfMappedChannel
Associated key.