COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 12-01-2015, 02:12 PM   #1
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default How to apply resample.h pitch shifting in real-time?

What parameter do I need to tweak in resample.h in order to get "changing playback rate" effect in real time, like in Reaper?
mviljamaa is offline   Reply With Quote
Old 12-01-2015, 02:15 PM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mviljamaa View Post
What parameter do I need to tweak in resample.h in order to get "changing playback rate" effect like in Reaper?
What are you actually planning to do? You do of course realize that you can't do that kind of pitch changing without an existing buffer or file of audio, right? (So it can't really be strictly "real time".)

But if that's clear to you already, the void SetRates(double rate_in, double rate_out) method changes the rate.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-01-2015, 02:18 PM   #3
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

I'm planning to replicate the Reaper "playback rate" slider.

So does SetRates(double rate_in, double rate_out) always take the original SR as the first param.? In which case I need to adjust the rate_out to get pitch shifting. Or does it take the SR to which audio was converted into the last time resampling was performed?
mviljamaa is offline   Reply With Quote
Old 12-01-2015, 02:26 PM   #4
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mviljamaa View Post
I'm planning to replicate the Reaper "playback rate" slider.

So does SetRates(double rate_in, double rate_out) always take the original SR as the first param.? In which case I need to adjust the rate_out to get pitch shifting. Or does it take the SR to which audio was converted into the last time resampling was performed?
Replicate the playback rate slider how and in which kind of context? (I just want to prevent you from trying to do something that isn't going to be possible in a typical VST/AU plugin context...)

For example rs->SetRates(44100.0, 88200.0); would make the resampler output audio that is an octave lower than the original if you play the result back at 44100.0 hz. So the input rate should typically stay the same and the output rate would be variable.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-01-2015, 02:27 PM   #5
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

Like in a sampler where you have the pitch wheel. Which can be tweaked in real-time and e.g. the output can be recorded.

Yea, but after rs->SetRates(44100.0, 88200.0); then does the next call (the next time the pitch is adjusted) have to be rs->SetRates(88200.0, 32000.0); or rs->SetRates(44100.0, 32000.0);.
mviljamaa is offline   Reply With Quote
Old 12-01-2015, 02:31 PM   #6
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Quote:
Originally Posted by mviljamaa View Post
Yea, but after rs->SetRates(44100.0, 88200.0); then does the next call (the next time the pitch is adjusted) have to be rs->SetRates(88200.0, 32000.0); or rs->SetRates(44100.0, 32000.0);.
No. The input rate should stay the same.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 12-04-2015, 12:06 PM   #7
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

So I'm wondering what's the buffering scheme like for pitch shifting using offline files?
To replicate the behaviour of Reaper's "playback rate".

How do I calculate the amount of samples resample.h will produce? For a given shift.
mviljamaa is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:16 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.