Doubling the frequency of a sound fragment in real time? I'm given given a stream of sound, as a serie of little buffers . 

Is it possible to make this stream sound one octave up ? Or an arbitrary number of semitones up ? My goal is to add it to the original sound and to pass this through a reverb to create a "shimmer" effect .

My research so far was in the direction of doubling the frequency by creating a new buffer, and copying every other sample of the old one. This works, but I have a lot of noise and artefacts. I guess this is because the buffer length is not an exact multiple of the frequency but I can't change the buffer length and I have no prior knowledge of the frequency of the sound. 

I don't think this is the place to post C/C++ code so I won't do it but I guess you get my idea. 

I'm not looking for a high quality sound at all, i.e, a perfect, one octave up, reproduction of the sound,but at least something decent. 

Any ideas please ?
After loads of research, I found a really good article about Short Time Fourier Transform (STFT), which can apply FT to a really small buffer, change it's frequency and apply IFT. There's even an implementation in C. You can find it here : http://blogs.zynaptiq.com/bernsee/pitch-shifting-using-the-ft/

As a "side effect", you also know the pitch of your signal in almost real time 

HTH