How to detect string when pitch-tracking on electric guitar?
Hi I'm a noob in audio related coding and I'm working in a pitch tracking
DLL that I will use to try to create a sort of open-source version of the
video-game Rocksmith as a learning experience.
So far I have managed to get the FFT to work so I can detect pitch
frequency (Hz) then by using an algorithm and the table below I can manage
to determine the octave (2th to 6th) and the note (C to B) for played
note.
The next step is to detect the string so I can determine the fret.
I've been thinking about it and in theory I can work with this, I will
know when the user is playing the right note but the game could be "Hack"
because by just using the Hz the game is not able to detect if a note is
played in the right string. For example 5th string + 1th fret = C4
261.63Hz is equals to 6th string + 5th fret = C4 261.63Hz.
The chances of having an user playing a note in the wrong string and
getting it right is low, but I think it would be really good to know the
string so I can provide to the users some error feedback when they play
the wrong string (Like you should go a string up or down).
Do you know what can I do to detect the string? Thanks in advance :)
[edit]
The guitar and strings that we are using affect the timbre so analyzing
the timbre seems to not be a easy way of detecting strings:
"Variations in timbre on your guitar are produced by an enormous number of
factors from pickup design and position, the natural resonances and
damping in your guitar due to the wood used (that's a different sort of
timber!) and its construction and shape, the gauge and age of your
strings, your playing technique, where you fret and pluck the string, and
so on."
No comments:
Post a Comment