openAVproductions / openAV-Luppp

Luppp is a live performance tool, created by OpenAV productions.
http://openavproductions.com/luppp
GNU General Public License v3.0
257 stars 45 forks source link

Implement rubberband and fix clip sync #277

Closed georgkrause closed 5 years ago

georgkrause commented 5 years ago

This branch will enable on the fly tempo changes again. There are two problems to be solved:

This branch currently solve both issues by implementing rubberband for the timestretching and change the way the clips are synced to each other. I did some minor testing and more is welcome. Please report any issues.

This is work in progress and should be considered as unstable.

AppImages for testing can be found here: https://github.com/openAVproductions/openAV-Luppp/releases/tag/continuous-rubberband

Stuff to test:

georgkrause commented 5 years ago

@sub26nico

With Luppp-ceec6d2-x86_64.AppImage, it doesn't work all. And the tap tempo during transport doesn't work properly (maybe my mouse?).

sub26nico commented 5 years ago

So I've tested with appimage Luppp-ceec6d2-x86_64.AppImage.

georgkrause commented 5 years ago

@sub26nico Thanks a lot for this deep test!

Problem number 1 (Glitch on clip start) could be solved by feeding the stretcher already when recording. I will try to do this soon. For the audio quality I need to test this on my own first, but I am quite sure rubberband provides results in different quality, depending if you are using it in realtime mode or not. Can you provide me some loops and BPM-values where they glitch? This way I can do some tests in different modes.

The high CPU usage is quite problematic, we should at least provide a setting to disable rubberband to prevent crashes on stage when you hit the button by accident.

All in all I would like to discuss your test results, ping me on IRC if you have time :)

georgkrause commented 5 years ago

@sub26nico Glitches should be fix, although I don't think they are introduced by rubberband but were there before (could be checked in 1.2.1 but not urgently needed).

I tried to reduce DSP load at least when no tempo change is applied, but this causes other issues and was not really your problem. Load optimizations are another topic I need to dig into and I have currently no idea how to improve the situation here.

georgkrause commented 5 years ago

Other thing I noticed: Setting other number of beats doesn't work anymore.

sub26nico commented 5 years ago

@georgkrause , ok, I'll test as soon as possible.

georgkrause commented 5 years ago

@sub26nico @coderkun @harryhaaren small discussion: right click on a clip and setting Beats is kind of confusing for me, its more like setting the playspeed of the clip. eg if the clip is 4 beats long, and i select 8, its played back with half speed. But the clip data actually does not change. So I would like to change this to play speed. (this will be at least the way I will change the implementation to enable this feature again, so it would make sense to unify implementation and naming)

georgkrause commented 5 years ago

I am going to close this. Rubberband is not going to work here, at least I can't manage it or have no more ideas.

The problem is, each track would need its own stretcher to allow arbitrary records (eg on different tempos or imports with different bpms). This adds so much CPU overhead, that its nearly impossible to run Luppp with low latencies on average hardware, which is a no-go from my point of view. Other solution would be to make sure all clips run on a common internal BPM and when changing the tempo there is only one stretcher which stretches everything. But this would also mean we need to recompute recordings on other BPMs than the common internal to be converted to the internal BPM. This means we need two stretcher: record and master. This might work out, but from my point of view the quality of rubberband is not good enough.

All in all, this feature was not requested nor is it needed by me. I will port the clip sync to another PR to get tempo ramps into Luppp. There wont be any pitch correction, though. Move on to other stuff afterwards. Ideas still welcome.