Rubberband LV2 plugin versus built-in pitch shift

I ran into something interesting and would like to get thoughts here. I have a karaoke file which I imported into Ardour. I needed to both slow it down and lower the pitch, so I followed my normal procedure and used the stretch tool to slow it down and added the Rubberband pitch-shift LV2 plugin to do the pitch shift.

Interestingly, the audio sounded slightly off. On a hunch, I tried the pitch shift tool built-in to Ardour (which also uses Rubberband) and that sounded much better.

I’m curious why this happened to be the case and whether the built-in tool uses different settings from the plugin or something. I tend to prefer the plugin because I can interactively play with the pitch correction (to figure out the best pitch), but I’m wondering if using the built-in tool is actually a better idea, or at least what the differences are.

A plugin only sees a short window of audio at a time as audio passes though in realtime. This can be insufficient context for good quality pitch shifting.

The pitch-shift tool in Ardour allows to analyze the whole data first before applying the actual effect.

2 Likes

Huh, that’s interesting, thanks!

My workflow going forward will probably use the plugin to get a sense of which pitch works best for me and then pitch-shift using the built-in tool. That should get me the best of both worlds :slight_smile:

1 Like

@x42 I’ve gotten more curious about Rubberband so I was looking at the CLI documentation which led me to realize there are two different algorithms they use (R2 and R3). When using the CLI, you can pick either one based on how you invoke the tool, but I presume when talking about integrations the software integrating it (Ardour, in this case) makes those choices.

Just out of curiosity, which algorithm does Ardour invoke? I know some of the pitch-shifting options map directly to checkboxes and drop-downs in Ardour, but there seem to be lots of choices here and not all of them map to options within Ardour as far as I know?

Hah, at the end they point to this file, reading it now! Looking at that I realized that one of my main fears (of repeatedly changing pitches affecting quality) is unfounded since it seems to go back to the original (unscaled) audio for the source? Cool!

Since you reference the Ardour’s source already, let me also point you to:

and the code below to around line 350.

Note that Ardour can also use Soundtouch as alternative to to Rubberband, and for time-streching Staffpad is used by default (so far Staffpad is not used for pitch-shifting).

Hence options are somewhat abstracted and not a 1:1 mapping to underlying rubberband.

1 Like