lee suggested PD, i would suggest SuperCollider.
i have written many supercollider patches to do this sort of thing,
but these are all in Mac - i'm still getting to the point of
compiling SC in linux in my "free time" (tm). (though closer now,
with debian unstable +alsa running on an older ppc!)
anyway, in either app:
one continuously running loop that tests (say every 0.1 second) for
an input volume threshold, which, if crossed, starts a timer and
starts writing to a buffer.
my SC versions write start and stop sample numbers into an array to
be accessed later.
second, a loop that tests if there any sample in the buffer, and
plays back accordingly, at rate*2 or whatever, or fft i guess if you
want to shift pitch and not rate.
third a loop that plays the default sample if nothing else is playing..
hope that helps somewhat...
--
_________________________________________________________________
Jonathan Segel -- MAGNETIC -- PO Box 460816 S.F. CA. 94146-0816
4014 Brookdale Ave. Oakland, CA 94619
jsegel(a)magneticmotorworks.com <-----> magsatellite(a)yahoo.com
http://www.MagneticMotorworks.com
tel (510) 534 7825 cell (510) 484 7415 fax (425) 955 4495