Reduce or increase pitch WITH preserving duration

I saw the topic titled “Re: Reduce or increase pitch without preserving duration”, so I presumed the “Change Pitch” Audacity native plugin would reduce or increase pitch with preserving original duration of the selected area. I am using 2.3.2 Audacity version, but when I want to change pitch of, say, a 0.5" area to a 10% pitch change, I get the pitch changed area reduced to 0.446". It does not keep its original duration once pitch changed. And if I ask for a -10% pitch change of the original area, I get the area pitch changed plus a silence of 0,007", so again not with the original duration.
I need the pitch changed with preserving the original duration, so that the resulting music, with its possible tied notes and harmony is also preserved.
If I take the original selection, export it and use ffmpeg or rubberband to get the pitch change, it does it perfectly, a beautiful pitch change to the exact percentage requested and with the same duration, whether the percentage is positive or negative.
The rubberband command is very simple :

rubberband  -p 2.0 <originalSelection.wav>  <modifiedSelection.wav>

increases pitch by 2 semitones with same tempo, same duration.
Is there a way to call that command from Audacity or via some new nyquist plugin ?
Or is this duration problem correction part of next Audacity release ?

If you need to keep the exact length with Audacity’s Change Pitch effect, enable the “Use high quality stretching” option.

Nyquist does have a pitch shift function, but it is pretty low quality in the version that Audacity currently uses. I’m looking forward to Nyquist being updated in Audacity because the latest version of Nyquist (not yet available in Audacity) has much better pitch shifting than the current Nyquist version.

Thanks Steve. I didn’t realize this option was preserving selection duration after the pitch change.
Just by curiosity, would there be a way to use rubberband via a nyquist code ?

No, but If you have access to a Linux operating system, there is a LADSPA version of RubberBand that works with Audacity.
I’ve just run a quick test, and Audacity’s Change Pitch effect seems to give better sound quality.

Thanks a lot, Steve. Alas, I dont have a Linux system. But I hope the rubberband way of changing pitch and tempo will be taken in some near future into the Audacity code or at least will get a channel allowing its use in Audacity.

That’s not going to happen. To run RubberBand in Audacity on Windows, you would need a Windows version of the RubberBand LADSPA plug-in. I was not able to find a Windows version of the LADSPA plug-in, and suspect that there isn’t one.