[EDIT] I was typing this while Muddleglum was... pretty much the same thing...
This will be a bit long winded. Sorry!
Since you're specifically talking about using a guitar, you are talking about using a sample or a recorded sound. When you alter the pitch of a sample, the timbre (the quality of the sound - what makes it sound a particular way) changes. If you change the pitch slightly a few semitones, it's no big deal. But if you change it over an octave, you'll notice the sound doesn't sound very good any more. Why do I even mention this? Because it becomes important when you want to have many notes like on a guitar.
Not exactly in answer to your question, because you don't actually need memblocks to do this, you can achieve the result by finding out the sound speed of your recorded sound. If we are assuming a western set of tones, we will assume there are 13 semitone divisions between octaves. If we divide the sound speed by 13, we get a pretty good approximation of the variation in the sample rate for that particular sound for a half-step. The heavy mathematical way uses logs and you'll need a knowledge of the frequency of individual notes. We can get away with pretty good results without having to go through that.
The sound speed in this case, is actually the sample rate. The sample rate is how many pieces (or samples) of the individual sound pass by in 1 second. By changing the sample rate, we change how many pieces of the sound pass by. If we increase the sample rate, more samples pass by, but the sound size hasn't changed so the sound gets "squished" or pitched higher (more vibrations per second). If we lower the sample rate, the opposite occurs; the sound get's "stretched" and therefore the pitch lowers.
Can I finally get to the point of how to change it? you ask yourself. Ok. Here's an example:
load sound "Sound1.wav",1
clone sound 2,1
speed1=get sound speed(1)
sndstep1#=speed1/13.0
for n=1 to 13
set sound speed 1,(n*sndstep1#)+speed1
play sound 1
wait 200
next n
set sound speed 1,(13*sndstep1#)+speed1
loop sound 1
loop sound 2
You can load in any sound wave. I used middle C from a piano I think. I did this so long ago I don't remember. I clone the sound so in the end I could tell if the pitch between octaves was fairly accurate. In this example, it plays all 13 semitones based on 1 sample. It's really better to avoid having so many notes from one sample. For better quality, you should have a sample every 3 or 4 semitones. This will keep the timbre a bit closer to the actual sound of the instrument.
Enjoy your day.