mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Minor clean-ups.
This commit is contained in:
parent
5f8069719e
commit
7a3453f48b
32 changed files with 219 additions and 277 deletions
|
|
@ -96,10 +96,7 @@ void SamplerVoice::startNote (const int midiNoteNumber,
|
|||
SynthesiserSound* s,
|
||||
const int /*currentPitchWheelPosition*/)
|
||||
{
|
||||
const SamplerSound* const sound = dynamic_cast <const SamplerSound*> (s);
|
||||
jassert (sound != nullptr); // this object can only play SamplerSounds!
|
||||
|
||||
if (sound != nullptr)
|
||||
if (const SamplerSound* const sound = dynamic_cast <const SamplerSound*> (s))
|
||||
{
|
||||
pitchRatio = pow (2.0, (midiNoteNumber - sound->midiRootNote) / 12.0)
|
||||
* sound->sourceSampleRate / getSampleRate();
|
||||
|
|
@ -127,6 +124,10 @@ void SamplerVoice::startNote (const int midiNoteNumber,
|
|||
else
|
||||
releaseDelta = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
jassertfalse; // this object can only play SamplerSounds!
|
||||
}
|
||||
}
|
||||
|
||||
void SamplerVoice::stopNote (const bool allowTailOff)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue