I thought this would be trivial to achieve but I can't seem to figure out how to go about it...
Basically I would like to record a 1s sample and slow it down, or speed it up. Just like a tape recorder, where the pitch also changes.
The best I could get until now is using the method as shown here:
mem delay 32767
skp run, loop
sof 0, -0.25
wrax rmp0_rate,0
wrax rmp0_range, 0
loop:
sof 0,0
rdax adcl, 1.0
wra delay, 0.0
cho rdal, rmp0
wrax addr_ptr, 0
rmpa 1.0
wrax dacr, 1.0
wrax dacl, 0.0
This code was posted by Frank for a reverse delay. Changing the ramp rate gives me the results I want, but it only allows for a 1/4s long sample.
If someone could give me some pointers on how to get the same for 1 sec, that would be great
You may want to try the record/play code from http://www.spinsemi.com/forum/viewtopic ... ght=record and add a pitch shift into the playback routine to shift up/down. The example is stereo but it should be easy to rip out one channel and double the delay for the remaining one.
Yeah, you are correct. Problem is there is no way to change the playback speed in software it will have to be done via a pitch shift in some manner. Basically the code you posted at the top of this thread is half of a pitch shift so try it in the playback routine.
got around to test the concept. It does work. No need to deal with the ramp function. The sound will get very grainy as you slow it down. Nice spooky vibe when playback is done in reverse at half (or quarter) tempo. Octave down stuff.