Time and pitch stretching API.
More...
#include <src/dsp/stretcher.h>
|
|
| Stretcher (const Stretcher &)=delete |
|
Stretcher & | operator= (const Stretcher &)=delete |
|
| Stretcher (Stretcher &&)=delete |
|
Stretcher & | operator= (Stretcher &&)=delete |
| signed_frame_t | stretch (const float *in_samples_l, const float *in_samples_r, size_t in_samples_size, float *out_samples_l, float *out_samples_r, size_t out_samples_wanted) |
| | Perform stretching.
|
|
unsigned int | get_latency () const |
| | Get latency in number of samples.
|
|
void | set_time_ratio (double ratio) |
| zrythm::utils::audio::AudioBuffer | stretch_interleaved (zrythm::utils::audio::AudioBuffer &in_samples) |
| | Perform stretching.
|
|
| static std::unique_ptr< Stretcher > | create_rubberband (units::sample_rate_t samplerate, unsigned channels, double time_ratio, double pitch_ratio, bool realtime) |
| | Create a new Stretcher using the rubberband backend.
|
Time and pitch stretching API.
Definition at line 17 of file stretcher.h.
◆ Backend
| Enumerator |
|---|
| Rubberband | Rubberband.
|
| Paulstretch | Paulstretch.
|
| SBSMS | SBSMS - Subband Sinusoidal Modeling Synthesis.
|
Definition at line 20 of file stretcher.h.
◆ create_rubberband()
| std::unique_ptr< Stretcher > zrythm::dsp::Stretcher::create_rubberband |
( |
units::sample_rate_t | samplerate, |
|
|
unsigned | channels, |
|
|
double | time_ratio, |
|
|
double | pitch_ratio, |
|
|
bool | realtime ) |
|
static |
Create a new Stretcher using the rubberband backend.
- Parameters
-
| samplerate | The new samplerate. |
| time_ratio | The ratio to multiply time by (eg if the BPM is doubled, this will be 0.5). |
| pitch_ratio | The ratio to pitch by. This will normally be 1.0 when time-stretching). |
| realtime | Whether to perform realtime stretching (lower quality but fast enough to be used real-time). |
- Exceptions
-
| std::runtime_error | If parameters are invalid. |
◆ stretch()
| signed_frame_t zrythm::dsp::Stretcher::stretch |
( |
const float * | in_samples_l, |
|
|
const float * | in_samples_r, |
|
|
size_t | in_samples_size, |
|
|
float * | out_samples_l, |
|
|
float * | out_samples_r, |
|
|
size_t | out_samples_wanted ) |
Perform stretching.
- Parameters
-
| in_samples_l | The left samples. |
| in_samples_r | The right channel samples. If this is nullptr, the audio is assumed to be mono. |
| in_samples_size | The number of input samples per channel. |
- Returns
- The number of output samples generated per channel.
◆ stretch_interleaved()
Perform stretching.
- Warning
- Not real-time safe, does allocations.
- Parameters
-
| in_samples | Input samples (interleaved). |
- Returns
- The output samples (interleaved).
The documentation for this class was generated from the following file: