How I Did It
Tools I Used
Guitar: I only have quite old and cheap one (brand: JamMate)
Effects device: Digitech Genesis 3 (http://digitech.com/en/products/genesis3). An RCA adapter goes into computer's Line in jack.
Software: Audacity
Process
I used a metronome from my computer's speakers while playing with headphones connected to the effects device. I recorded a few phrases and cut out a sample of it that I was content with, trying to cut at an appropriate location so that when duplicating the sample it would remain on beat. I think I used the metronome track as a guide.