Pitch tracking electric bass?

Ludvig Ward's icon

So I'm trying to do accurate and not insanely delayed pitch tracking for electric bass, but it seems like a pretty difficult task to overcome. I've used fzero~ so far, with kind of alright results but it's still glitchy and unreliable (and slow!). I know that electric bass is a very difficult instrument to pitch track, because of the low notes, the overtones and so on...

Does anyone know of a good way to do this? I feel like it has to be possible in one way or another, since so many pedal manufacturers have gotten it figured out.

Source Audio's icon

For speed, reduce vector size to 128/64 to start with.
There are plenty of pitch trackers arround.
vb.pitch (mac only) sigmund, fiddle,
yin, psy ircam stuff etc.

But in any case you need to play clean single notes, limit freq range to what is needed, do maybe a bit of filtering,
and set good threshold for detection output.

Ludvig Ward's icon

I'm assuming vector size is the same as buffer size? For fzero~, no less than 2048 provides a reasonable result. Tried using sigmund and fiddle, but didn't get it to work at all, they always produced a lot of extra notes that weren't there in the audio. Like, it sounded like they tried to output every single overtone at the same time

Source Audio's icon

I meant audio driver I/O and signal size.

here is yin example to test

Yin-bass.zip
application/zip 88.00 KB

Ludvig Ward's icon

Oh ok I see, total noob here so I didn't know about those settings!
Gonna give that a try later. For now it seems like fzero~ works better than the other ones when it comes to electric bass

Ludvig Ward's icon

...seems like I can't change the i/o vector size, the driver is Live because I'm in max4live. How do you change that?

Source Audio's icon

I am sorry, but I don't use Live.

I think you find it in Preferences / Audio - Buffer size.

Ludvig Ward's icon

no worries, after some googling it seems like it's actually a pretty difficult thing to fix. My live buffer is pretty quick, don't remember the exact value but it's definitely not 4096 which is what max4live is running

Roman Thilenius's icon


vectorsize is fixed and small in max4live. you can change that for a process using poly~.

buffer size refers to the hardware driver IO. this is the main system latency reason, but wont make the analysis better.

afaik all known methods to track pitch sucks at bass. musically acceptable results start at around 200Hz. you could fix that by certain tricks, but all of them will involve that you raise the latency of the system again, which of course is not what you want for playing live.

Ludvig Ward's icon

After some reading I've understood that sub bass tones take longer to recognize, simply because the actual wave of a bass tone cycles so slowly. Wouldn't it theoretically be possible to have some form of pitch tracker that rather listens to the upper harmonics instead? If that's a thing, I think that would drastically increase both the speed and the accuracy of the pitch tracking

Roman Thilenius's icon


what would not work, for the reason you correctly pointed out, is to transpose it up first :) because that causes the same problems as directly analyzing does.

upper harmonics, sure, but i dont think a contrabass or fretless e-bass will give you that.

with monophonic played organ samples it might work. you would pitch track not only the loudest but the 5 loudest areas/tones (like the fiddle~ object does), and then dont take the loudest but the other ones.

Pierre Alexandre Tremblay's icon

Hello

Bass player here I feel you. A few things are at play here, without being too geeky, pitch tracking is (more often than not) based on windowed spectral transform, to know the pitch material in there. You need enough samples in the window to capture a significant portion of the fundamental, which is long and slow because it is low frequency. So that will impose a latency on the input.

The most accurate algo out there is the ircam yin, which is also implemented in fluid.pitch~ but in all the cases, try a fft size / window size of 2048 (which should be accurate down to your low A reliably and lower if your bass has a strong harmonic content)) - you could also try distorting the input to yin (using atan) to see if that helps - in theory it might but I have not tried after all these years - one for later today :)

I hope this helps