-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues with pitch detector #14
Comments
just a thought? could the 'issue' be related to that fact that each test i do is harmonically related - one octave above the previous test? |
hmm, ok, predict_frequency() seems more likely to give me the correct frequency but still doesn't like high frequencies
|
Could you post some audio test files I can try to run the PD on? I think your lowest to highest frequency (100-10000) is beyond the range of the PD. Normally, you don't want a range that high. Real instruments don't have that range after all. I think the limit is something like 5 octaves. I probably should give a warning or error in such a case. |
I don't generate/read from files - they are sin waves created with algo (not hard ;) ). whilst the limit is 10000, I'm actually only using between 220-7040hz, so 5 octaves. also get_frequency() is even lower than that... should I be using get_frequency()? what's the limit? is this an implementation limitation (e.g. float/double accuracy , or number of samples per cycle?) or a theoretical limitation on the algo used for the FFT? obviously, if this is not going to work, then I guess I should move on to find an FFT/PD thats more suited to this application? btw: Im also finding, if I re-create a PitchDetector its crashing with a SIG fault. btw2: when you compile, there are warnings about the default copy ctor being used, due to member _pd with PitchDetector - not sure if these are related to SIG fault. |
SEGV fault...
|
Can you record those into files, maybe using a DAW? There's no way I can test this unless you give me a way to reproduce exactly what you have. There may be other factors other than just synthesizing sine waves. I do test using generated sine waves already. Oh and the min-limit..max-limit is the range. So your range is already way beyond the limits regardless if you are only testing a subset of the range. Anyway, there can be other factors, so I really need a way to recreate your setup and settings in a test. (Edit: You can skip this if you instead give me an mcve. See comment below). |
Again there is no way to know without reproducing your scenario. Can you at least post a minimal, complete and verifiable example (mcve) test code that I can run here? Minimal test code, meaning it is one cpp file with code, stripped down to its minimum that still exhibits the problem, that anyone can immediately run without any extra hardware or software dependencies other than the library itself and the std libraries. https://stackoverflow.com/help/minimal-reproducible-example So basically, you have two distinct problems 1) the PD pitch tracking 2) Creating a PD with a shared_ptr. Please post two MVCEs separately, don't bundle them into one. |
Updates:
I'm very eager to see your MVCEs! |
I'm still very eager to see your MVCEs, but in the meantime, I pushed some refinements for handling higher frequencies and wider ranges. See if that works for you. The requirement of <= 4 octaves capture range still holds and is now checked and an exception is thrown if the precondition is not met. Commit: c818171 @TheTechnobear , please tell me if you are still going to pursue the requested MVCEs. If not, then I'll have to close this issue. |
I guess not... But feel free to reopen in case you do. |
Hi there,
Im trying to use your pitch detector to calibrate a eurorack module.
(Bela - using ARM)
in my current tests, this involves simply outputting a sin wave, which i then read back in and get pitch detector to tell me the frequency (which in this case i know)
but Im having a few issues...
e.g. one output (but Ive tried also sorts of different things.
here you can see....
at 440hz, it didnt adjust, and stayed at 220hz
and above about 1000hz, it stops, despite me giving a 10000hz upper limit.
this test is with creating one pitch detector...
but Ive also tried a lot of different variations on this...
either with a fixed range, or change the range depending upon the frequency im expecting.
but nothing really seems to make it predicable.
I wonder if Im doing something wrong?
in its simplest form, all I'm doing is:
(variations of this, are to set low/hi frequency to half/double test frequency)
later :
and finally :
am I correct in saying 'theoretically' I should be able to just let pitch detector track the frequency, and there is no requirement to reset it, or create a new one - when the frequency changes?!
fyi:
ive tried to wait different 'times' (so how many samples are passed to PD) , and this doesn't appear to help.... (anything form 32000 samples, to 80000 samples)
my pitch range is 220hz to 7040hz (so 5 octaves over 220hz)
should is_ready indicate if the pitch has 'stabilised'?
fyi: its pretty straightforward code, as ive not got pass 'proof of concept' stage... since pitch detection is pretty vital.
https://github.com/TheTechnobear/BelaPatches/blob/dev/c%2B%2B/autocal/render.cpp
Id be grateful for any pointers that might help
Thanks
Mark
The text was updated successfully, but these errors were encountered: