Skip to content

Commit

Permalink
add clearMessageQueue()
Browse files Browse the repository at this point in the history
  • Loading branch information
madronalabs committed Aug 20, 2024
1 parent 3809515 commit f0515c8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
18 changes: 12 additions & 6 deletions source/DSP/MLDSPFilters.h
Original file line number Diff line number Diff line change
Expand Up @@ -930,10 +930,9 @@ class Allpass1
float x1{0}, y1{0};

public:
float mCoeffs;
float mCoeff{0.f};

Allpass1() : mCoeffs(0.f) {}
Allpass1(float a) : mCoeffs(a) {}
Allpass1(float a) : mCoeff(a) {}
~Allpass1() {}

inline void clear()
Expand All @@ -955,7 +954,7 @@ class Allpass1
{
// one-multiply form. see
// https://ccrma.stanford.edu/~jos/pasp/One_Multiply_Scattering_Junctions.html
float y = x1 + (x - y1) * mCoeffs;
float y = x1 + (x - y1) * mCoeff;
x1 = x;
y1 = y;
return y;
Expand All @@ -980,7 +979,7 @@ class Allpass1
class FractionalDelay
{
IntegerDelay mIntegerDelay;
Allpass1 mAllpassSection;
Allpass1 mAllpassSection{0.f};
float mDelayInSamples{};

public:
Expand Down Expand Up @@ -1012,7 +1011,7 @@ class FractionalDelay
delayInt -= 1;
}
mIntegerDelay.setDelayInSamples(delayInt);
mAllpassSection.mCoeffs = Allpass1::coeffs(delayFrac);
mAllpassSection.mCoeff = Allpass1::coeffs(delayFrac);
}

inline void setMaxDelayInSamples(float d) { mIntegerDelay.setMaxDelayInSamples(floorf(d)); }
Expand Down Expand Up @@ -1475,6 +1474,13 @@ struct Upsampler
{
DSPVector result;
load(result, bufferPtr(readIdx_++));

// TEMP
if(!validate(result))
{
std::cout << "bad!\n";

}
return result;
}

Expand Down
7 changes: 6 additions & 1 deletion source/app/MLActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ class Actor
onMessage(m);
}
}


void clearMessageQueue()
{
_messageQueue.clear();
}

};

inline void registerActor(Path actorName, Actor* actorToRegister)
Expand Down

0 comments on commit f0515c8

Please sign in to comment.