You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a really neat library and I'm hoping to use the pitch detector algorithm. The regular tPitchDetector seems to work as expected (though I did find the API a bit confusing). I wanted to test tDualPitchDetector to see if it is more accurate, but it doesn't seem to work at all. I don't really understand how the algorithm works but it seems like tPeriodDetection is not finishing its work and returns a period of 0, which is a problem in this line Lfloat f1 = 1.0f / tPeriodDetection_getPeriod(&p->_pd1);
I'm assuming this is an issue in the way I'm using the algorithm, however my code does work fine when I use tPitchDetector:
I’ll check this out, there may be something messed up about the dual pitch
detector
Composer, musician, instrument designer
scattershot.org * @snyderphonics
On Mon, Feb 19, 2024 at 2:05 PM Binyamin Friedman ***@***.***> wrote:
This is a really neat library and I'm hoping to use the pitch detector
algorithm. The regular tPitchDetector seems to work as expected (though I
did find the API a bit confusing). I wanted to test tDualPitchDetector to
see if it is more accurate, but it doesn't seem to work at all. I don't
really understand how the algorithm works but it seems like
tPeriodDetection is not finishing its work and returns a period of 0, which
is a problem in this line Lfloat f1 = 1.0f /
tPeriodDetection_getPeriod(&p->_pd1);
I'm assuming this is an issue in the way I'm using the algorithm, however
my code does work fine when I use tPitchDetector:
LEAF leaf;tDualPitchDetector pitchDetector;
const size_t memorySize = 50000;char memory[memorySize];LEAF_init(&leaf, float(sampleRate), memory, memorySize, []() -> float { return Random().nextFloat(); });tDualPitchDetector_init(&pitchDetector, 50, 20000, &leaf);for (int i = 0; i < numSamples; i++)
{
bool ready = audioBuffer->getNumChannels() == 2 ?
tDualPitchDetector_tick(&pitchDetector, (audioBuffer->getSample(0, sampleStart + i) + audioBuffer->getSample(1, sampleStart + i)) / 2.f) :
tDualPitchDetector_tick(&pitchDetector, audioBuffer->getSample(0, sampleStart + i));
if (ready)
break;
}pitch = double(tDualPitchDetector_predictFrequency(&pitchDetector));tDualPitchDetector_free(&pitchDetector);
—
Reply to this email directly, view it on GitHub
<#17>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGAY7GY4WVE32BRERPRCX3YUOO6FAVCNFSM6AAAAABDP6A5ZOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2DEOJYHEZDOOA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
This is a really neat library and I'm hoping to use the pitch detector algorithm. The regular tPitchDetector seems to work as expected (though I did find the API a bit confusing). I wanted to test tDualPitchDetector to see if it is more accurate, but it doesn't seem to work at all. I don't really understand how the algorithm works but it seems like tPeriodDetection is not finishing its work and returns a period of 0, which is a problem in this line
Lfloat f1 = 1.0f / tPeriodDetection_getPeriod(&p->_pd1);
I'm assuming this is an issue in the way I'm using the algorithm, however my code does work fine when I use tPitchDetector:
The text was updated successfully, but these errors were encountered: