Pitch detection from live audio using sonic pi

Hi Everyone,

I an new to this thread and have been working on a drum machine/looper pedal for guitar using live_audio.

I was wondering if there is any way to detect pitch using audio input? My plan is to detect pitch of the notes played on the guitar and then generate chords/bass/backing track on sonic pi based on the notes played.