135 |
PanLeftSmoother.trigger(pEngineChannel->GlobalPanLeft, subfragmentRate); |
PanLeftSmoother.trigger(pEngineChannel->GlobalPanLeft, subfragmentRate); |
136 |
PanRightSmoother.trigger(pEngineChannel->GlobalPanRight, subfragmentRate); |
PanRightSmoother.trigger(pEngineChannel->GlobalPanRight, subfragmentRate); |
137 |
|
|
|
finalSynthesisParameters.dPos = RgnInfo.SampleStartOffset; // offset where we should start playback of sample (0 - 2000 sample points) |
|
|
Pos = RgnInfo.SampleStartOffset; |
|
|
|
|
138 |
// Check if the sample needs disk streaming or is too short for that |
// Check if the sample needs disk streaming or is too short for that |
139 |
long cachedsamples = GetSampleCacheSize() / SmplInfo.FrameSize; |
long cachedsamples = GetSampleCacheSize() / SmplInfo.FrameSize; |
140 |
DiskVoice = cachedsamples < SmplInfo.TotalFrameCount; |
DiskVoice = cachedsamples < SmplInfo.TotalFrameCount; |
141 |
|
|
142 |
|
SetSampleStartOffset(); |
143 |
|
|
144 |
if (DiskVoice) { // voice to be streamed from disk |
if (DiskVoice) { // voice to be streamed from disk |
145 |
if (cachedsamples > (GetEngine()->MaxSamplesPerCycle << CONFIG_MAX_PITCH)) { |
if (cachedsamples > (GetEngine()->MaxSamplesPerCycle << CONFIG_MAX_PITCH)) { |
146 |
MaxRAMPos = cachedsamples - (GetEngine()->MaxSamplesPerCycle << CONFIG_MAX_PITCH) / SmplInfo.ChannelCount; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK) |
MaxRAMPos = cachedsamples - (GetEngine()->MaxSamplesPerCycle << CONFIG_MAX_PITCH) / SmplInfo.ChannelCount; //TODO: this calculation is too pessimistic and may better be moved to Render() method, so it calculates MaxRAMPos dependent to the current demand of sample points to be rendered (e.g. in case of JACK) |
294 |
|
|
295 |
return 0; // success |
return 0; // success |
296 |
} |
} |
297 |
|
|
298 |
|
void AbstractVoice::SetSampleStartOffset() { |
299 |
|
finalSynthesisParameters.dPos = RgnInfo.SampleStartOffset; // offset where we should start playback of sample (0 - 2000 sample points) |
300 |
|
Pos = RgnInfo.SampleStartOffset; |
301 |
|
} |
302 |
|
|
303 |
/** |
/** |
304 |
* Synthesizes the current audio fragment for this voice. |
* Synthesizes the current audio fragment for this voice. |