Just Intonation  Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
tunerkeydata.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 #ifndef TUNERKEYDATA_H
21 #define TUNERKEYDATA_H
22 
23 #include <QVector>
24 
31 
32 struct KeyData
33 {
34  int key;
35  bool pressed;
36  bool newlyPressed;
37  bool emitted;
38  double intensity;
39  double memory;
42  qint64 timeStamp;
43  double pitch;
44  double previousPitch;
45 
46  KeyData() { clear(); }
47 
49  void clear()
50  {
51  key=0;
52  pressed = newlyPressed = emitted = false;
53  intensity = memory = pitch = previousPitch = 0;
54  sustainDampingFactor = 1;
55  releaseDampingFactor = 0;
56  timeStamp = 0;
57  }
58 };
59 
60 using KeyDataVector = QVector<KeyData>;
61 
62 #endif // TUNERKEYDATA_H
void clear()
Function for clearing all fields in the TunerKeyData structure.
Definition: tunerkeydata.h:49
QVector< KeyData > KeyDataVector
Data of all keys of the keyboard.
Definition: tunerkeydata.h:60
Structure holding the tuner&#39;s data of a single key.
Definition: tunerkeydata.h:32
int key
Number of the key.
Definition: tunerkeydata.h:34
bool newlyPressed
Flag indicating a newly pressed key.
Definition: tunerkeydata.h:36
double releaseDampingFactor
Release damping of the key.
Definition: tunerkeydata.h:41
double memory
Psychoacoustic memory M(t)
Definition: tunerkeydata.h:39
bool emitted
Flag indicating first emitted tuning.
Definition: tunerkeydata.h:37
double sustainDampingFactor
Sustain damping of the key.
Definition: tunerkeydata.h:40
bool pressed
Flag indicating a pressed key.
Definition: tunerkeydata.h:35
KeyData()
Constructor, clearing all data.
Definition: tunerkeydata.h:46
double previousPitch
Previously emitted pitch.
Definition: tunerkeydata.h:44
double intensity
Intensity (volume) I(t)
Definition: tunerkeydata.h:38
double pitch
Actual pitch.
Definition: tunerkeydata.h:43
qint64 timeStamp
Time when the key was pressed.
Definition: tunerkeydata.h:42