Opened 7 years ago

Closed 20 months ago

Last modified 3 months ago

#203 closed Feature Request (fixed)

Time stretching

Reported by: monn2 Owned by: alexmarsev
Priority: normal Milestone: 1.7.10
Component: General Version:
Severity: minor Keywords: time stretching
Cc: alexmarsev Evaluation:

Description

My enlish is realy poor, so i'd rather paste a link here:
http://en.wikipedia.org/wiki/Audio_timescale-pitch_modification
+ at a same time change a video playback rate

(a lot of players already support this feature (second table):
http://en.wikipedia.org/wiki/Comparison_of_video_player_software#Features )

i'm not sure what compomnent i should choose, so please, correct it..

Change History (25)

comment:1 Changed 7 years ago by tetsuo55

  • Component changed from MPC_HC_CORE to Patch Welcome

comment:2 Changed 4 years ago by mike giovinazzo

As this is the original ticket for time stretching / pitch shift correction, I'll try to consolidate some info to help.

ticket:1004, ticket:1246 and ticket:2759 are dupes or partial dupes of this ticket:203. Although ticket:1004 was set to fixed/solved, pitch correction was part of the description and was not implemented.

I'm aware of two good free (LGPL 2.1) libraries which implement this feature:

SoundTouch is based on the WSOLA algorithm, which appears to be better for music in a range of about 0.5x to 2.0x.

Sonic is based on the PICOLA algorithm, works with speeds up to 6x, and is clearly superior for speech (see examples on that page). I find it ok for music as well. There is a main.c on that page which provides example usage.

It seems to me that more people would benefit from libsonic being implemented. The current workaround by using ReClock has poor results, and it seems like many users including myself are left to use VLC (which uses http://scaletempo.sourceforge.net, a WSOLA based filter) for this feature.

comment:3 Changed 4 years ago by thevbm

  • Cc alexmarsev added

@mike giovinazzo Thanks for report, closed #1246 and #2759 as dupes.

@alexmarsev any light that you can shed on this?

comment:4 follow-up: Changed 4 years ago by alexmarsev

@mike giovinazzo You want it purely for "increase/decrease speed" option? Like, for it to do same thing as of now but with better audio quality?

Last edited 4 years ago by alexmarsev (previous) (diff)

comment:5 in reply to: ↑ 4 Changed 4 years ago by mike giovinazzo

@alexmarsev Unless I'm mistaken, MPC-HC currently changes the overall rate of audio playback when playback speed is changed. That is, it changes both the tempo and the pitch - the same effect that occurs when playing a record at the wrong RPM. It does this with good quality to my estimation.

The feature discussed in these tickets, and the one I hope could be implemented, is modifying only the tempo to match playback speed while maintaining the original pitch. An example of this is in this sample which had its tempo modified by 2x in libsonic http://dev.vinux-project.org/sonic/sonic.wav. I understand this is done by sonicSetSpeed(stream, speed); in libsonic. Kind regards.

comment:6 Changed 4 years ago by alexmarsev

  • Owner set to alexmarsev
  • Status changed from new to accepted

Ok, I'll put it in my todo list.
That feature will need some non-trivial changes to the filter chain, and there's already some massive work with much higher priority going on it. After that is done, I'll look into it.

Last edited 4 years ago by alexmarsev (previous) (diff)

comment:7 Changed 4 years ago by mike giovinazzo

Thanks so much for the consideration! :) I'm sorry I can't help besides donating a bit.

comment:8 Changed 4 years ago by chris hoekstra

I don't suppose any progress has been made on adding pitch shift correction either with the libsonic library or another solution? On a daily basis I am grumbling because I have to switch over to VLC instead of MPC to watch something faster than 1.0x because the pitch is off in MPC.

I was hoping that the higher priority "massive work" had been completed and this could be cranked out fairly quickly and included in the nightlies.

Just a gentle push and thanks for all the stellar work over the years!

comment:9 Changed 4 years ago by alexmarsev

In plans as a part of MpcAudioRenderer revival, will work on it after we release a stable, which should be soon. While this pitch shift feature in itself is not that hard to implement, it just doesn't fit in the current architecture and placing it into AudioSwitcher would be outright hackish.

comment:10 Changed 3 years ago by avalanche1

So... no work on this part for 11 months..?
Still being the reason a lot of ppl using VLC over MPC

comment:11 Changed 2 years ago by justme

Meanwhile... now even the Youtube player can do this...

comment:12 Changed 2 years ago by wooo weee

Yes it is an useful feature. Mpc uses low cpu and doesn't screw up the gpu decode unlike gomplayer so I'd really prefer to use mpc for timestretching video. Would be nice if this could be raised to a higher priority as its been 5 years, and whatever other features being worked on are not things that will change fundamental experience like a missing feature since the player is so polished as it is.

Thanks!

comment:13 Changed 2 years ago by tobindax

This needs to absolutely happen. Is it abandoned at the moment?

comment:14 Changed 23 months ago by tobindax

It's interesting that Android apps have it. But not the PC.

comment:15 in reply to: ↑ description Changed 22 months ago by andwan0

Please I vouch for the need for this. This is essential since the original poster English is not good so he requires the use of slow-video speed to enjoy movies.

comment:16 follow-up: Changed 20 months ago by alexmarsev

  • Milestone set to next release
  • Resolution set to fixed
  • Status changed from accepted to closed

Implemented as part of new Internal Audio Renderer. Will be included in the next nightly build. The renderer is WASAPI only, so no Windows XP support unfortunately.

comment:17 in reply to: ↑ 16 Changed 20 months ago by laggingreflex

I'm on the latest nightly build 1.7.9.145 but I still don't see this feature. Speeding up/down (with ctrl+up/down) still results in higher/lower pitched audio.

comment:18 Changed 20 months ago by underground78

You need to select the "Internal audio renderer" in Options > Playback > Output. It's not the default option of now.

comment:19 follow-up: Changed 18 months ago by mike giovinazzo

It seems that SoundTouch was used for this. Now that the filter chain work has been done, would it be difficult to add an option to use or replace SoundTouch with Sonic? Having used both for a long time, it seems to me that Sonic produces far more comprehensible audio outside of the narrow 0.8-1.25x or so range.

Here is the github link to the current project.

https://github.com/waywardgeek/sonic

In any case, thank you for the hard work already done.

comment:20 Changed 17 months ago by thevbm

  • Milestone changed from next release to 1.7.10

Milestone renamed

comment:21 Changed 17 months ago by rambomhtri

Wooooow, I've been waiting for this in MPC-HC for almost 5 years. Few things to look at:
1. When you are playing audio files, if you speed up/down, the UI does not show any message of the new playback speed. Nevertheless, if it's a video, MPC-HC shows in the upper right corner the new speed for a few seconds.
2. It would be nice to show in the Toolbar the actual speed, like "x1.00", or "x0.30". Like next to "Playing", on the right of it.
3. The sound worsens noticeably when you slow down the speed to x0.50 or less, because it starts to appear like an echo of the whole thing. This doesn't happen in VLC. For a musician like me, the echo is really bad for learning a fast solo or something like that, cause I don't know which notes are actually played and which ones are echoed.

PD: Now you just need to add an A-B repeat loop, and I can uninstall VLC from my PC since MPC-HC would be better in all aspects (or almost all of them).

Thank you SO MUCH for finally implement this fantastic feature!

Last edited 17 months ago by rambomhtri (previous) (diff)

comment:22 in reply to: ↑ 19 ; follow-up: Changed 16 months ago by alexmarsev

Replying to mike giovinazzo:
Replying to rambomhtri:
Alright, I will see if I can improve time-stretching quality. Either through fine-tuning SoundTouch or switching to some other library.

Replying to rambomhtri:
"Playing x1.23" in Status Bar makes sense, thanks. Will do it.

comment:23 in reply to: ↑ 22 Changed 16 months ago by rambomhtri

Replying to alexmarsev:

Replying to mike giovinazzo:
Replying to rambomhtri:
Alright, I will see if I can improve time-stretching quality. Either through fine-tuning SoundTouch or switching to some other library.

Replying to rambomhtri:
"Playing x1.23" in Status Bar makes sense, thanks. Will do it.

Thank you again, alexmarsev, you're awesome!

comment:24 Changed 3 months ago by ThereIsNoUsername

Is this really implemented in MPC-HC (64-bit) 1.7.10 (d911f14)?

Because it kind of sounds like Donald Duck when I select "Increase Rate" from the Play menu.

comment:25 Changed 3 months ago by clsid2

You need a newer version:
https://nightly.mpc-hc.org/

And select the Internal Audio Renderer in output settings.

Note: See TracTickets for help on using tickets.