Code for self-tuning a bass guitar