pitch tracking for electric bass with pfft~
I’d like to build a kind of bass-to-midi-device via pfft~.
I tried all those pfft-objects like the ZSA-library and the Tristan Jehan-library. I tried onset detection, flatness- and bari-center-objects…
But they all seem to have problems with the low frequencies of an electric bass.
An idea I suggested to a similar forum question a little while ago is to try using gizmo~ to pitch-shift the signal up an octave and then use fiddle~/sigmund~/pitch~ for tracking. With electric bass you’ll have to pitch-up by more than one octave, but it should provide useable results.
IMHO any pitch-tracking built in max/msp will have to be quite complex and heavy on your cpu in order to approach the accuracy of tracking that those externals provide, and it’s likely that you would run into the same low-frequency limitations and have to try pitch-shifting the detector signal anyway. Although if it’s for a uni project or something similar then it would definitely be an interesting thing to learn to do!
while zsa.descriptors library clearly does not have the most advanced pitch recognition algorithm (it’s really primitive), you might want to give it another try with a bigger window size.
I have used fiddle~ with good success for the last (too many) years. I set the window size to 2048 which is an ok compromise between latency and accuracy, and I track down to the low G.
The input sound is very important too. Try different combinations of pickups and tone, that is making a huge difference on the accuracy and stability.
thank you guys!
I used some sample bass clips that I recorded to work with and I transposed them 2 octaves higher with abletons warp mode complex. Then it worked pretty good. I’ll try gizmo~ to do that in real time.
I thought about what Information in generall I have and there are two advanteges of that special situation:
1. there are no other sound onfluences you would have with a microphone.
2. I know the color/spectre of the sound.
Isn’t there a way to analyses the overtones of the given electric bass and then assume what note is played by the overtones?
A table like base note 100%, 1. overtone 70%, 2. overtone 35%. Wouldn’t that help in pitch tracking? I know a electric bass can be played in many ways but all in a certain range…
By the way: it’s not for uni, it’s for the stage. I want my bases player to play my moog little phatty via his electric bass while I’m controlling his sound.
It all depends how daring you are: I am about to present a paper on my performance patch which use a bass to drive concatenative synthesis (Diemo Schwarz’s CataRT, free from the IRCAM website) and playing synth bass through it is one of a billion possibilities…
it’s always fun to see people working on the same things that I do…
So I can’t wait to read your paper!
Maybe we can help each other…
What would be important for me is that the base player feels natural and can control the sound intuitivly. So one more parameter for controlling the synth sound that you could grab from the bass audio is the brightness of the pizz: e.g. when the bass player slaps it will have much more high frequnecies at the beginning than if he plucks the string normaly. (that could be realized with slope~.)
let’s stay in contact.
maybe this could be interesting for you
@ andrea: thank you for that hint, but I cannot find any answers to that post?!
Maybe we can have a little exchange of ideas:
I considered the structure of a bass note: you have a loud pluck with an undefined pitch and a lot of high frequencies. And a little later you have a note with a clear pitch.
According to that there should be two main parts of analyzing a bass note. a detection of the beginning of the note and a pitch detection that should start a little afterwards.
Also the synth sound should refer to that. Maybe there is a percussive sample at the beginning triggered by the bass sound transient. And then there is a real pitch with a attack of a few ms.
what do you think?
I would suggest first looking into a multi-phonic pickup to separate the different strings before doing any analysis. Proprietary systems are available for bass along with some amazing processors. Or you could ‘roll your own’ – small naked singe pickups are available or even make your own . .
This will provide you with 4 essentially monophonic signals to process enabling easier amore predictable pitch tracking and the ability to track chords.
Ultimately the time/freq issue is generally always going to be a problem at lower frqs. The fastest commercial system I am aware of actually used fret sensing to speed up the process. And there is a guitar processor that uses a trained recognition system that looks at the attack phase to speed up pitch estimation.
Just a few ideas – I play virtual/midi guitar myself . . .
@vanille bechamel: Thank you, but I’m on windows.
Just for those who might be interested in: I’ve found a way to get proper transients in two ways:
1. I take away all the high frequencies, transpose it two octaves higher and get the ratio of energy of two frames. So if there is a real base note I’ll get it.
2. I take away all the low frequencies and transpose it two octaves lower. So I get all the noise of the fingers and the strings in a hearable range. Again I calculate the ratio of the energy of two frames. So I get transients of plucking.
The problem of that method is that you’ll get a transient each time the finger touches the string. And that’s quiet often. (It’s like you want to get a mouse_off event but instead you get the mouse_on AND the mouse_on event)
I will go on and search for pitches right after getting a transient. (Because it makes no sense to search for a proper pitch in the moment of plucking)
If anybody want I could share my work.
I’m curious how fzero~ will work in this situation. Bass is a hard instrument to track, but fzero~ doesn’t have some of the problems that fft’s have with low frequencies.