Just Intonation  Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
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  *****************************************************************************/
20 //=============================================================================
21 // Microtonal Midi Helper Class
22 //=============================================================================
27 #include "system/log.h"
29 class MidiMicrotonal;
36 class MidiMicrotonalHelper : public QObject, public Log
37 {
39 public:
40  MidiMicrotonalHelper(MidiMicrotonal *midimicrotone);
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);
53 public slots:
54  void sendInitialMidiCommands (void);
56 private:
57  void playNote (bool on, int mappedChannel, int key, int vol, double delta);
58  void setPitchBend (int channel, double pitch);
60 private:
62  QVector<bool> mMappedChannelIsUsed;
63  QVector<int> mKeyOfMappedChannel;
66  QVector<double> mCurrentPitch;
68  const int cDrumChannel = 9;
69 };
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)
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)
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
void turnNoteOff(int channel, int key, double delta)
Turn note off.
QVector< int > mSequentialNumberOfMappedChannel
Tag storage.
QVector< int > mKeyOfMappedChannel
Associated key.