Clear cc events on advanceTime
This commit is contained in:
parent
dbe544515f
commit
1d74968bf0
2 changed files with 8 additions and 1 deletions
|
|
@ -51,6 +51,12 @@ void sfz::MidiState::setSampleRate(float sampleRate) noexcept
|
||||||
void sfz::MidiState::advanceTime(int numSamples) noexcept
|
void sfz::MidiState::advanceTime(int numSamples) noexcept
|
||||||
{
|
{
|
||||||
internalClock += numSamples;
|
internalClock += numSamples;
|
||||||
|
for (auto& ccEvents: cc) {
|
||||||
|
ASSERT(!ccEvents.empty()); // CC event vectors should never be empty
|
||||||
|
ccEvents.front().second = ccEvents.back().second;
|
||||||
|
ccEvents.front().first = 0;
|
||||||
|
ccEvents.resize(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sfz::MidiState::setSamplesPerBlock(int samplesPerBlock) noexcept
|
void sfz::MidiState::setSamplesPerBlock(int samplesPerBlock) noexcept
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Advances the internal clock of a given amount of samples.
|
* @brief Advances the internal clock of a given amount of samples.
|
||||||
* You should call this at each callback.
|
* You should call this at each callback. This will flush the events
|
||||||
|
* in the midistate memory.
|
||||||
*
|
*
|
||||||
* @param numSamples the number of samples of clock advance
|
* @param numSamples the number of samples of clock advance
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue