Just Intonation
Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
|
Class describing a tone that is currently being played. More...
#include <tone.h>
Public Types | |
enum | Type { SUSTAIN_ENDING, SUSTAIN_NONENDING, RELEASETONE, UNDEFINED } |
enum | State { IDLE, PLAYING, RELEASE_REQUESTED, RELEASED, OFF_PLAYING, TERMINATED } |
Public Member Functions | |
Tone () | |
Defautl constructor, resetting the member variables. More... | |
Tone (int key, int scaleindex, Wave &sample, double volume, Type type=UNDEFINED) | |
Constructor of a Tone which allows to set certain properties. More... | |
Wave & | getSample () |
Private Attributes | |
State | mState |
Phase in which the tone is playing. More... | |
int | mKey |
Key index (Midi) ranging from 0 to 127. More... | |
quint32 | mTime |
time in units of 1/4096/SampleRate sec More... | |
double | mVolume |
overall volume ranging from 0 to 1 More... | |
qint16 | left |
qint16 | right |
store last PCM values, init to zero More... | |
Wave * | pSample |
Pointer to the wave. More... | |
Type | mType |
Type of the wave. More... | |
int | mScaleIndex |
Index to the used scale. More... | |
Friends | |
class | Sampler |
Sampler class is allowed to access private elements. More... | |
class | SoundGenerator |
SoundGenerator class is allowed to access private elements. More... | |
class | TuningManager |
TuningManager class is allowed to access private elements. More... | |
Class describing a tone that is currently being played.
This class describes the properties of a tone that is currently played by the Sampler.
The microtonal tuning is controlled by two essential variables named mTime and mIncrement. The standard value of mIncrement is 0x1000=4096 which corresponds to the standard frequency of the tone. For each frame (i.e. for each PCM value) the sampler increases the mTime-Variable by mIncrement. Microtonal tuning is achieved by changing mIncrement. For example, going from 0x1000 to 0x1001 the frequency in increased by the ratio 1/0x1000 = 1/4096.
enum Tone::State |
Enumerator | |
---|---|
IDLE |
Undefined. |
PLAYING |
Tone is playing in normal mode. |
RELEASE_REQUESTED |
The key has been released. Tone is requested to switch to the release mode. |
RELEASED |
Release mode: tone is decaying. |
OFF_PLAYING |
Tone is playing a special off-sound after key has been released. |
TERMINATED |
Tone has terminated and can be removed from the queue. |
enum Tone::Type |
Tone::Tone | ( | ) |
Constructor of a Tone which allows to set certain properties.
key | : Number of the key in MIDI norm (0..127) |
scaleindex | : Number of the scale from which the waveform is loaded |
sample | : Reference to the waveform (redundant but for performance) |
volume | : Volume of the tone |
type | : Type of the tone |
|
friend |
|
friend |
SoundGenerator class is allowed to access private elements.
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |