Mpv: [question] how adjust pitch with rubberband

Created on 24 Oct 2017  路  11Comments  路  Source: mpv-player/mpv

Windows 10
mpv latest

how to increase or decrease pitch with key presses

input.conf...

1 af set rubberband=pitch-scale=1.1

this works with set, but i cannot increase or decrease pitch with more presses

(add causes stutter and multiply does not seem to work)

Most helpful comment

@abvincita, this is my current setting in mpv.conf:
af=@rb:!rubberband

And input.conf:
ALT+t af toggle @rb
ALT+4 af-command rb multiply-pitch 0.9438743126816935
ALT+5 af-command rb set-pitch 1.0
ALT+6 af-command rb multiply-pitch 1.059463094352953

So "Alt+t" activates the rubberband filter (disabled by default).

All 11 comments

This would require a lua script analogous to acompressor.lua to modify filter parameters based on keybindings.

Note that rubberband offers an api to change the pitch dynamically without reinserting the filter. If you insert the filter with

--af=@rb:rubberband

you can send input commands like

1 af-command rb set-pitch 1.1

Thank you for your reply.

That now explains why I could not get it working.

This is my compromise solution that seems to work reliably

7 af set rubberband=pitch-scale=1.05
8 af set rubberband=pitch-scale=1

I also fought with this for awhile. So I added this to mpv.conf file:
af=@rb:rubberband

And this to input.conf:
ALT+4 af-command rb multiply-pitch 0.9438743126816935
ALT+5 af-command rb set-pitch 1.0
ALT+6 af-command rb multiply-pitch 1.059463094352953

So with Alt+4 and Alt+6 you can go down or up by semitones and Alt+5 brings us back to default pitch.

Hi @jmv1, how did you get the multiply-pitch to work? I followed your steps and I can get the set-pitch to work (with values such as 1.0, 0.95 and 1.05) but not the multiply-pitch. When I hit the shortcut, it just does nothing, no error either.

I'm using v0.27.2 on MacOS.
Is it possible that the version I'm using hasn't had the multiply-pitch feature yet? I wonder if it's related to #5387?

Hi @abvincita, this was tested on latest git builds on Windows machine. I did however bump on to the same problem on MacOS. Where did you downloaded the binaries? I think you might need at least 0.28. Also if you use homebrew you can enable rubberband with build time option.

On a sidenote I noticed that if rubberband filter is enabled in config it causes issues with tracks with multi channel audio, so I made it so that I activate only as needed basis with key combination.

@abvincita Yes, your version is too old.

@jmv1 I got the binaries from homebrew, and I did install it using the --with-rubberband option. I can use other rubberband commands such as set-pitch and pitch-scale, just not the multiply-pitch.

And by "activate only as needed basis with key combination", do you mean you mapped the af=@rb:rubberband command into a key in input.conf instead of putting it in the mpv.conf?

@Argon- just saw your comment, thanks for confirming! Glad it's not just me making things not working haha

You can compile a more recent version with brew using:

brew install ffmpeg --HEAD
brew install mpv --HEAD

@abvincita, this is my current setting in mpv.conf:
af=@rb:!rubberband

And input.conf:
ALT+t af toggle @rb
ALT+4 af-command rb multiply-pitch 0.9438743126816935
ALT+5 af-command rb set-pitch 1.0
ALT+6 af-command rb multiply-pitch 1.059463094352953

So "Alt+t" activates the rubberband filter (disabled by default).

Thank you to you both @Argon- and @jmv1!

I reinstalled mpv using --HEAD as Argon- suggested and yep my multiply-pitch is working now!
I also followed jmv1's config to toggle the rubberband instead of always on. I like this config too as I won't accidentally invoke the pitch change shortcuts. Really happy with my setup now, thanks 馃槃

@abvincita No problem, glad that you got everything worked out. 馃槉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szg0000 picture szg0000  路  3Comments

yuvadm picture yuvadm  路  3Comments

SPDurkee picture SPDurkee  路  3Comments

ww7 picture ww7  路  3Comments

ghost picture ghost  路  3Comments