34 |
float Pitch; ///< as linear frequency ratio (1.0 being neutral) |
float Pitch; ///< as linear frequency ratio (1.0 being neutral) |
35 |
float Pan; ///< between -1.0 (most left) and +1.0 (most right) and 0.0 being neutral. |
float Pan; ///< between -1.0 (most left) and +1.0 (most right) and 0.0 being neutral. |
36 |
int64_t PanSources; ///< Might be used for calculating an average pan value in differential way: amount of times the Pan value had been changed and shall be calculated relatively upon. |
int64_t PanSources; ///< Might be used for calculating an average pan value in differential way: amount of times the Pan value had been changed and shall be calculated relatively upon. |
37 |
|
float Cutoff; ///< between 0.0 and 1.0 |
38 |
|
float Resonance; ///< between 0.0 and 1.0 |
39 |
} Override; |
} Override; |
40 |
/// Sampler format specific informations and variables. |
/// Sampler format specific informations and variables. |
41 |
union _Format { |
union _Format { |
51 |
Override.Pitch = 1.f; |
Override.Pitch = 1.f; |
52 |
Override.Pan = 0.f; |
Override.Pan = 0.f; |
53 |
Override.PanSources = 0; |
Override.PanSources = 0; |
54 |
|
Override.Cutoff = 1.f; |
55 |
|
Override.Resonance = 1.f; |
56 |
Format = _Format(); |
Format = _Format(); |
57 |
} |
} |
58 |
}; |
}; |
59 |
|
|
60 |
/** |
/** |
61 |
* Contains the voices caused by one specific note, as well as basic |
* Contains the voices caused by one specific note, as well as basic |
62 |
* informations about the note itself. |
* informations about the note itself. You can see a Note object as one |
63 |
|
* specific event in time where one or more voices were spawned at the same |
64 |
|
* time and all those voices due to the same cause. |
65 |
|
* |
66 |
|
* For example when you press down and hold the sustain pedal, and then |
67 |
|
* trigger the same note on the keyboard multiple times, for each key |
68 |
|
* strokes a separate Note instance is created. |
69 |
|
* |
70 |
|
* If your instrument contains a real-time instrument script, then that |
71 |
|
* script might also trigger additional voices programmatically (by |
72 |
|
* calling the built-in script function play_note()). Each time the script |
73 |
|
* calls play_note() a new Note instance is created and the script may then |
74 |
|
* further control the voices of specific notes independently from each |
75 |
|
* other. For example for each key stroke on your keyboard the instrument |
76 |
|
* script might trigger 3 additional notes programmatically and assign a |
77 |
|
* different tuning filter parameters for each one of the 3 notes |
78 |
|
* independently. |
79 |
*/ |
*/ |
80 |
template<class V> |
template<class V> |
81 |
class Note : public NoteBase { |
class Note : public NoteBase { |
107 |
Override.Pitch = 1.f; |
Override.Pitch = 1.f; |
108 |
Override.Pan = 0.f; |
Override.Pan = 0.f; |
109 |
Override.PanSources = 0; |
Override.PanSources = 0; |
110 |
|
Override.Cutoff = 1.f; |
111 |
|
Override.Resonance = 1.f; |
112 |
Format = _Format(); |
Format = _Format(); |
113 |
if (pActiveVoices) { |
if (pActiveVoices) { |
114 |
typename RTList<V>::Iterator itVoice = pActiveVoices->first(); |
typename RTList<V>::Iterator itVoice = pActiveVoices->first(); |