Open gpeles opened 4 years ago
PitchContours* melody algorithms aren't designed for real-time, because they require a segment of audio to gather pitch contours and apply statistics. You can compute the chain up to PitchSalienceFunctionPeaks in real-time though.
For real-time Pitch detection we have a number of PitchYin*
algorithms, but those are suited for monophonic signals.
Thanks for the reply!
What is the minimum duration of the required audio segment?
In the code above I'm trying to implement a hybrid approach, so it's not really 'real-time'. The salience function peaks are calculated in real time using a frame size of 2048 and a hop size of 128 as suggested in the recommended processing chain. But I then store the resulting bins and saliences in two VectorVectorFloat objects (in this.aggregate), and wait to have 128 of those before passing them to the PitchContours and PitchContourMultiMelody algorithms (then, I reset this.aggregate and repeat).
The PitchContours algorithm seems to work fine and generates output. The chain seems to also work well if I replace PitchContoursMultiMelody with PitchContoursMonoMelody. Now I've tried to increase the size of the aggregate from 128 to 256. This works for a bit longer, but also eventually freezes.. The same happens if I increase it to 512 - it works for some time but eventually freezes.
We'll have to look at the freezes. @albincorreya
If the contours look fine, you can try working on shorter segments and see.
Hello,
I'm trying to use the PitchContoursMultiMelody algorithm to implement real-time multi pitch detection. I'm following the recommended processing chain mentioned in the description of the PitchContours algorithm, which seems to work fine, but after I pass the outputs to the PitchContoursMultiMelody the audio worklet seems to freeze either immediately or after a couple of seconds (no errors are thrown). I'm unsure why this happens and would appreciate any help.
Note that I do try to explicitly delete the C++ objects every time the worklet process runs, as suggested by the Emscripten documentation (in case that's a memory issue), but this doesn't seem to make any difference (I don't have much experience with Emscripten so I might have got that wrong).
See my code below: