28 |
RTList<note_id_t>* pChildNotes; ///< Note ID list of "child" notes of this note. These are special notes that must be released once this note gets released. |
RTList<note_id_t>* pChildNotes; ///< Note ID list of "child" notes of this note. These are special notes that must be released once this note gets released. |
29 |
Event cause; ///< Copy of the original event (usually a note-on event) which caused this note. |
Event cause; ///< Copy of the original event (usually a note-on event) which caused this note. |
30 |
event_id_t eventID; ///< Unique ID of the actual original @c Event which caused this note. |
event_id_t eventID; ///< Unique ID of the actual original @c Event which caused this note. |
31 |
|
sched_time_t triggerSchedTime; ///< Engine's scheduler time when this note was launched. |
32 |
/// Optional synthesis parameters that might be overridden (by calling real-time instrument script functions like change_vol(), change_pitch(), etc.). |
/// Optional synthesis parameters that might be overridden (by calling real-time instrument script functions like change_vol(), change_pitch(), etc.). |
33 |
struct _Override { |
struct _Override { |
34 |
float Volume; ///< as linear amplification ratio (1.0 being neutral) |
float Volume; ///< as linear amplification ratio (1.0 being neutral) |
35 |
float Pitch; ///< as linear frequency ratio (1.0 being neutral) |
float Pitch; ///< as linear frequency ratio (1.0 being neutral) |
36 |
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. |
37 |
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. |
38 |
|
float Cutoff; ///< between 0.0 and 1.0 |
39 |
|
float Resonance; ///< between 0.0 and 1.0 |
40 |
|
float Attack; ///< between 0.0 and 1.0 |
41 |
|
float Decay; ///< between 0.0 and 1.0 |
42 |
|
float Release; ///< between 0.0 and 1.0 |
43 |
} Override; |
} Override; |
44 |
/// Sampler format specific informations and variables. |
/// Sampler format specific informations and variables. |
45 |
union _Format { |
union _Format { |
55 |
Override.Pitch = 1.f; |
Override.Pitch = 1.f; |
56 |
Override.Pan = 0.f; |
Override.Pan = 0.f; |
57 |
Override.PanSources = 0; |
Override.PanSources = 0; |
58 |
|
Override.Cutoff = 1.f; |
59 |
|
Override.Resonance = 1.f; |
60 |
|
Override.Attack = 1.f; |
61 |
|
Override.Decay = 1.f; |
62 |
|
Override.Release = 1.f; |
63 |
Format = _Format(); |
Format = _Format(); |
64 |
} |
} |
65 |
}; |
}; |
66 |
|
|
67 |
/** |
/** |
68 |
* Contains the voices caused by one specific note, as well as basic |
* Contains the voices caused by one specific note, as well as basic |
69 |
* informations about the note itself. |
* informations about the note itself. You can see a Note object as one |
70 |
|
* specific event in time where one or more voices were spawned at the same |
71 |
|
* time and all those voices due to the same cause. |
72 |
|
* |
73 |
|
* For example when you press down and hold the sustain pedal, and then |
74 |
|
* trigger the same note on the keyboard multiple times, for each key |
75 |
|
* strokes a separate Note instance is created. |
76 |
|
* |
77 |
|
* If your instrument contains a real-time instrument script, then that |
78 |
|
* script might also trigger additional voices programmatically (by |
79 |
|
* calling the built-in script function play_note()). Each time the script |
80 |
|
* calls play_note() a new Note instance is created and the script may then |
81 |
|
* further control the voices of specific notes independently from each |
82 |
|
* other. For example for each key stroke on your keyboard the instrument |
83 |
|
* script might trigger 3 additional notes programmatically and assign a |
84 |
|
* different tuning filter parameters for each one of the 3 notes |
85 |
|
* independently. |
86 |
*/ |
*/ |
87 |
template<class V> |
template<class V> |
88 |
class Note : public NoteBase { |
class Note : public NoteBase { |
114 |
Override.Pitch = 1.f; |
Override.Pitch = 1.f; |
115 |
Override.Pan = 0.f; |
Override.Pan = 0.f; |
116 |
Override.PanSources = 0; |
Override.PanSources = 0; |
117 |
|
Override.Cutoff = 1.f; |
118 |
|
Override.Resonance = 1.f; |
119 |
|
Override.Attack = 1.f; |
120 |
|
Override.Decay = 1.f; |
121 |
|
Override.Release = 1.f; |
122 |
Format = _Format(); |
Format = _Format(); |
123 |
if (pActiveVoices) { |
if (pActiveVoices) { |
124 |
typename RTList<V>::Iterator itVoice = pActiveVoices->first(); |
typename RTList<V>::Iterator itVoice = pActiveVoices->first(); |