36 |
#include "../gig/Filter.h" |
#include "../gig/Filter.h" |
37 |
#include "../common/VoiceBase.h" |
#include "../common/VoiceBase.h" |
38 |
#include "../gig/SynthesisParam.h" |
#include "../gig/SynthesisParam.h" |
39 |
|
#include "../sfz/EGADSR.h" |
40 |
|
#include "SF2SignalUnitRack.h" |
41 |
|
|
42 |
namespace LinuxSampler { namespace sf2 { |
namespace LinuxSampler { namespace sf2 { |
43 |
class Engine; |
class Engine; |
53 |
virtual ~Voice(); |
virtual ~Voice(); |
54 |
void SetOutput(AudioOutputDevice* pAudioOutputDevice); |
void SetOutput(AudioOutputDevice* pAudioOutputDevice); |
55 |
void SetEngine(LinuxSampler::Engine* pEngine); |
void SetEngine(LinuxSampler::Engine* pEngine); |
56 |
|
virtual SignalUnitRack* GetSignalUnitRack(); |
57 |
|
|
58 |
protected: |
protected: |
59 |
virtual SampleInfo GetSampleInfo(); |
virtual SampleInfo GetSampleInfo(); |
80 |
virtual double GetVelocityRelease(uint8_t MIDIKeyVelocity); |
virtual double GetVelocityRelease(uint8_t MIDIKeyVelocity); |
81 |
virtual double GetSampleAttenuation(); |
virtual double GetSampleAttenuation(); |
82 |
virtual void ProcessGroupEvent(RTList<Event>::Iterator& itEvent); |
virtual void ProcessGroupEvent(RTList<Event>::Iterator& itEvent); |
83 |
|
virtual void AboutToTrigger(); |
84 |
|
|
85 |
private: |
private: |
86 |
::LinuxSampler::gig::EGADSR EG1; // TODO: add a fine-tuned version for SF2, or maybe use sfz v1 instead of gig |
::LinuxSampler::sfz::EGADSR EG1; |
87 |
::LinuxSampler::gig::EGADSR EG2; // TODO: add a fine-tuned version for SF2, or maybe use sfz v1 instead of gig |
::LinuxSampler::gig::EGADSR EG2; // TODO: use sfz v1 instead of gig |
88 |
|
::sf2::Region* pPresetRegion; |
89 |
|
SF2SignalUnitRack SignalRack; |
90 |
|
|
91 |
public: // FIXME: just made public for debugging (sanity check in Engine::RenderAudio()), should be changed to private before the final release |
public: // FIXME: just made public for debugging (sanity check in Engine::RenderAudio()), should be changed to private before the final release |
92 |
// Attributes |
// Attributes |
102 |
|
|
103 |
EngineChannel* GetSf2EngineChannel(); |
EngineChannel* GetSf2EngineChannel(); |
104 |
|
|
105 |
|
friend class EGUnit; |
106 |
|
friend class VolEGUnit; |
107 |
|
friend class ModEGUnit; |
108 |
|
friend class VibLfoUnit; |
109 |
|
friend class EndpointUnit; |
110 |
|
friend class SF2SignalUnitRack; |
111 |
|
|
112 |
protected: |
protected: |
113 |
virtual uint8_t CrossfadeAttenuation(uint8_t& CrossfadeControllerValue) { |
virtual uint8_t CrossfadeAttenuation(uint8_t& CrossfadeControllerValue) { |
114 |
/*uint8_t c = std::max(CrossfadeControllerValue, pRegion->AttenuationControllerThreshold); |
/*uint8_t c = std::max(CrossfadeControllerValue, pRegion->AttenuationControllerThreshold); |