So I’m loving the 10b example! This is exactly the kind of thing that @weefuzzy helped me with ages ago that would take some kind of centile, then a mean of that, etc… The new approach works worlds better though.
I’ve gone and made a reduced version of the patch to test this with a bunch of sounds that I think are problematic.
First, a couple of questions/thoughts.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Is the idea with this ‘newschool’ approach of removing entries via fluid.bufthresh~
that when you have a descriptor space, you literally ignore queries that check for pitch if there is no valid entry?
I’ll rephrase that as an example. Say I have a corpus of sounds, and 10% of them have no valid pitch data (via getting zeroed out by fluid.bufthresh~
when creating a fluid.dataset~
). I am now feeding it live audio and want to query based on loudness, timbre, and pitch. Will all the ones with no pitch data get completely ignored?
Similar question for the input side. Say my input frame has no valid pitch data, but everything in my corpus does. Will that return no data?
(Obviously code is code, and one can make these decisions, I’m just generally asking about the paradigm/intention of having intentionally malformed entries)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
The reason I’m asking is because with some of my examples (code and audio below), there isn’t great pitch data, but sometimes there still is pitch data. So I was thinking of taking stats for the confidence and finding the max of that, and then adjusting threshold based on that (and perhaps std). So basically trying to get the “best” pitch information out of that frame.
Where I can see this being problematic is the “best pitch” for that segment may actually be shit as compared to another entry in a dataset which may have the same final number(s).
Perhaps a solution to this would be having a summary confidence statistic. A straight mean would be shit for lots of reasons, but perhaps something like what % of the length is above the given threshold. If it’s 5% (or 0.05) then I know that even though I have the most representative pitch from that sample, I have a low confidence that it is in fact that pitch.
This confidence-confidence (would that be a derivative of confidence, or is that specifically limited to change-over-time) would be a metadata-esque value that can be used in the query but not in an LPT descriptor space.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
This one is a more technical question.
Harmonics…
I’ve gotten mixed results with this so far, so I’m thinking it might be an even/odd harmonic thing as some of the metal sounds I’m testing with have funky harmonic structures.
I guess this comes down to the underlying algorithm, but when averaged over time, or more specifically, when taking confidence as a weighting factor, it may decide that what it hears as a harmonic is more confidently heard than a fundamental. So almost the opposite problem that could arise if doing loudness-weighted pitch analysis.
A similar thing would potentially be the case if there are multiple pitches (or a gliss?) within the analysis window. The confidence may be high for many of those pitches, and a mean may produce a…well, mean value which may not actually be in the set of pitches.
For all my tested in my example I’m using median to hopefully mitigate against that, but the problem still stands.
So is there a way to perhaps balance loudness and confidence to get at the fundamental?
Or perhaps does the YIN (or other?) algorithms spit out a list of harmonic peaks, and then that could be weighed in together with the harmonics.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Ok, enough chat. Here’s the code example:
----------begin_max5_patcher----------
2165.3oc4asraiaCEccxWAgPQWT3Jv2TLqxxtn+ACJFnHS6nLxRFRx4wLn4a
ujTOhcr7XJYJiAnAH1NzR5xy4d48EY9ws2D7Pwqpp.vcfu.t4leb6M2XGxLv
Ms+8MAaheMIKtxdYAIEa1nxqCVz7c0pWqsiSBAayheCjVCdHN4ace+ph7573
MJ607WprmU0oIw6+sqhSreKpcr7caRyyT0U6O3135jGSyW+0RURcyzkIiBgK
.LJ07FhBMug4gPv+r2SuJ861mN1708BnXWcmD5FMcocJV7vS+IGEXF6eu8Vy
KKtPhAGpIj70f5BPbdb1a54yryMRogLn1WwPl+XFnOYFTHH4wcIeCrJMSUAR
yAOpJuBrClgLLBGS7M+vjSgedI9Y0phxMu2AtG1sZkprG7aS0PH7EU55G0Rd
HvxNMXivxvHBgPITo8GFaAfDwBERIRRoPBQxkRtlAXbKsP2iHNDw71QaFp9s
spFYDrJqHVqe+oeHKsx9dP+CeehiMEhKW8h9lOxtRKwkaTUUfm+dQwFfV+Ag
H.JLXrqhHhPDmyYbFz9CUScHINDhDPbjPFQfHJinGjgs1P3SRcnSQcCSGdcc
VikiZI32AU0koa2pVN3hr+NttvGquDTKswgc+Hz9hzK1jTMmg3PFTxnRpl1P
BKsgNIsMvZLDSLExYYZRc3yopWFqU.25kfxjgFsOF0DsYTSYAdecRRQVQYyy
19vfgBnLBRjXDiGwwByPHIGJhnDDQf0j0BfUf9aMhkN1pCTC1nhyuSaXrT+x
2TubG3a6JquCnIG8KpkoluU+Du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LaTE4G
-----------end_max5_patcher-----------
And here are a handful of files that I’ve picked that show off different problems I’ve talked about.
examples.zip (856.3 KB)