Hi, I am trying to create an emulation of a hardware looper pedal that, among other things, can record and playback at half speed. In the device’s manual they refer to the sample rate as their way of implementing this, but I don’t think we have that option in the plugin context?
My current thinking of how to do this is to play each sample twice when reading from the buffer. Does that make sense? Is there an existing pattern for this?
Thanks!
How to implement half speed playback & recording in PNS?
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 6336 posts since 8 Sep, 2004 from Paris (France)
The quick & dirty way to do it is to simply repeat each sample twice during playback. This will divide the speed by two!
-
- KVRer
- Topic Starter
- 16 posts since 14 Jun, 2024
nice, that's what i've ended up doing, it works well!
Code: Select all
if(currentlyPlaying)
{
if(halfSpeedMode && halfToggle) {
// flip halftoggle, don't update index
// This the workaround for not being able to change the sample rate
// we're just playing the same sample twice
halfToggle = !halfToggle;
}
else {
// update index to next sample
currentPlayingIndex++;
halfToggle = !halfToggle;
}
-
Blue Cat Audio Blue Cat Audio https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=39981
- KVRAF
- 6336 posts since 8 Sep, 2004 from Paris (France)