Audacity  3.0.3
Paulstretch.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Paulstretch.cpp
6 
7  Nasca Octavian Paul (Paul Nasca)
8  Some GUI code was taken from the Echo effect
9 
10 *******************************************************************//*******************************************************************/
16 
17 
18 #include "Paulstretch.h"
19 #include "LoadEffects.h"
20 
21 #include <algorithm>
22 
23 #include <math.h>
24 #include <float.h>
25 
26 #include <wx/intl.h>
27 #include <wx/valgen.h>
28 
29 #include "../Shuttle.h"
30 #include "../ShuttleGui.h"
31 #include "../FFT.h"
32 #include "../widgets/valnum.h"
33 #include "../widgets/AudacityMessageBox.h"
34 #include "../Prefs.h"
35 
36 #include "../WaveTrack.h"
37 
38 // Define keys, defaults, minimums, and maximums for the effect parameters
39 //
40 // Name Type Key Def Min Max Scale
41 Param( Amount, float, wxT("Stretch Factor"), 10.0, 1.0, FLT_MAX, 1 );
42 Param( Time, float, wxT("Time Resolution"), 0.25f, 0.00099f, FLT_MAX, 1 );
43 
47 {
48 public:
49  PaulStretch(float rap_, size_t in_bufsize_, float samplerate_);
50  //in_bufsize is also a half of a FFT buffer (in samples)
51  virtual ~PaulStretch();
52 
53  void process(float *smps, size_t nsmps);
54 
55  size_t get_nsamples();//how many samples are required to be added in the pool next time
56  size_t get_nsamples_for_fill();//how many samples are required to be added for a complete buffer refill (at start of the song or after seek)
57 
58 private:
59  void process_spectrum(float *WXUNUSED(freq)) {};
60 
61  const float samplerate;
62  const float rap;
63  const size_t in_bufsize;
64 
65 public:
66  const size_t out_bufsize;
67  const Floats out_buf;
68 
69 private:
71 
72 public:
73  const size_t poolsize;//how many samples are inside the input_pool size (need to know how many samples to fill when seeking)
74 
75 private:
76  const Floats in_pool;//de marimea in_bufsize
77 
78  double remained_samples;//how many fraction of samples has remained (0..1)
79 
81 };
82 
83 //
84 // EffectPaulstretch
85 //
86 
88 { XO("Paulstretch") };
89 
91 
92 BEGIN_EVENT_TABLE(EffectPaulstretch, wxEvtHandler)
93  EVT_TEXT(wxID_ANY, EffectPaulstretch::OnText)
95 
97 {
98  mAmount = DEF_Amount;
99  mTime_resolution = DEF_Time;
100 
101  SetLinearEffectFlag(true);
102 }
103 
105 {
106 }
107 
108 // ComponentInterface implementation
109 
111 {
112  return Symbol;
113 }
114 
116 {
117  return XO("Paulstretch is only for an extreme time-stretch or \"stasis\" effect");
118 }
119 
121 {
122  return wxT("Paulstretch");
123 }
124 
125 // EffectDefinitionInterface implementation
126 
128 {
129  return EffectTypeProcess;
130 }
131 
132 // EffectClientInterface implementation
134  S.SHUTTLE_PARAM( mAmount, Amount );
135  S.SHUTTLE_PARAM( mTime_resolution, Time );
136  return true;
137 }
138 
140 {
141  parms.WriteFloat(KEY_Amount, mAmount);
142  parms.WriteFloat(KEY_Time, mTime_resolution);
143 
144  return true;
145 }
146 
148 {
149  ReadAndVerifyFloat(Amount);
151 
152  mAmount = Amount;
154 
155  return true;
156 }
157 
158 // Effect implementation
159 
160 double EffectPaulstretch::CalcPreviewInputLength(double previewLength)
161 {
162  // FIXME: Preview is currently at the project rate, but should really be
163  // at the track rate (bugs 1284 and 852).
164  auto minDuration = GetBufferSize(mProjectRate) * 2 + 1;
165 
166  // Preview playback may need to be trimmed but this is the smallest selection that we can use.
167  double minLength = std::max<double>(minDuration / mProjectRate, previewLength / mAmount);
168 
169  return minLength;
170 }
171 
172 
174 {
175  CopyInputTracks();
176  m_t1=mT1;
177  int count=0;
178  for( auto track : mOutputTracks->Selected< WaveTrack >() ) {
179  double trackStart = track->GetStartTime();
180  double trackEnd = track->GetEndTime();
181  double t0 = mT0 < trackStart? trackStart: mT0;
182  double t1 = mT1 > trackEnd? trackEnd: mT1;
183 
184  if (t1 > t0) {
185  if (!ProcessOne(track, t0,t1,count))
186  return false;
187  }
188 
189  count++;
190  }
191  mT1=m_t1;
192 
194 
195  return true;
196 }
197 
198 
200 {
201  S.StartMultiColumn(2, wxALIGN_CENTER);
202  {
203  S.Validator<FloatingPointValidator<float>>(
204  1, &mAmount, NumValidatorStyle::DEFAULT, MIN_Amount)
205  /* i18n-hint: This is how many times longer the sound will be, e.g. applying
206  * the effect to a 1-second sample, with the default Stretch Factor of 10.0
207  * will give an (approximately) 10 second sound
208  */
209  .AddTextBox(XXO("&Stretch Factor:"), wxT(""), 10);
210 
211  S.Validator<FloatingPointValidator<float>>(
212  3, &mTime_resolution, NumValidatorStyle::ONE_TRAILING_ZERO, MIN_Time)
213  .AddTextBox(XXO("&Time Resolution (seconds):"), wxT(""), 10);
214  }
215  S.EndMultiColumn();
216 };
217 
219 {
220  if (!mUIParent->TransferDataToWindow())
221  {
222  return false;
223  }
224 
225  return true;
226 }
227 
229 {
230  if (!mUIParent->Validate() || !mUIParent->TransferDataFromWindow())
231  {
232  return false;
233  }
234 
235  return true;
236 }
237 
238 // EffectPaulstretch implementation
239 
240 void EffectPaulstretch::OnText(wxCommandEvent & WXUNUSED(evt))
241 {
242  EnableApply(mUIParent->TransferDataFromWindow());
243 }
244 
246 {
247  // Audacity's fft requires a power of 2
248  float tmp = rate * mTime_resolution / 2.0;
249  tmp = log(tmp) / log(2.0);
250  tmp = pow(2.0, floor(tmp + 0.5));
251 
252  auto stmp = size_t(tmp);
253  if (stmp != tmp)
254  // overflow
255  return 0;
256  if (stmp >= 2 * stmp)
257  // overflow
258  return 0;
259 
260  return std::max<size_t>(stmp, 128);
261 }
262 
263 bool EffectPaulstretch::ProcessOne(WaveTrack *track,double t0,double t1,int count)
264 {
265  const auto badAllocMessage =
266  XO("Requested value exceeds memory capacity.");
267 
268  const auto stretch_buf_size = GetBufferSize(track->GetRate());
269  if (stretch_buf_size == 0) {
270  ::Effect::MessageBox( badAllocMessage );
271  return false;
272  }
273 
274  double amount = this->mAmount;
275 
276  auto start = track->TimeToLongSamples(t0);
277  auto end = track->TimeToLongSamples(t1);
278  auto len = end - start;
279 
280  const auto minDuration = stretch_buf_size * 2 + 1;
281  if (minDuration < stretch_buf_size) {
282  // overflow!
283  ::Effect::MessageBox( badAllocMessage );
284  return false;
285  }
286 
287  if (len < minDuration) { //error because the selection is too short
288 
289  float maxTimeRes = log( len.as_double() ) / log(2.0);
290  maxTimeRes = pow(2.0, floor(maxTimeRes) + 0.5);
291  maxTimeRes = maxTimeRes / track->GetRate();
292 
293  if (this->IsPreviewing()) {
294  double defaultPreviewLen;
295  gPrefs->Read(wxT("/AudioIO/EffectsPreviewLen"), &defaultPreviewLen, 6.0);
296 
297  if ((minDuration / mProjectRate) < defaultPreviewLen) {
299  /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
300  XO("Audio selection too short to preview.\n\n"
301  "Try increasing the audio selection to at least %.1f seconds,\n"
302  "or reducing the 'Time Resolution' to less than %.1f seconds.")
303  .Format(
304  (minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
305  floor(maxTimeRes * 10.0) / 10.0),
306  wxOK | wxICON_EXCLAMATION );
307  }
308  else {
310  /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
311  XO("Unable to Preview.\n\n"
312  "For the current audio selection, the maximum\n"
313  "'Time Resolution' is %.1f seconds.")
314  .Format( floor(maxTimeRes * 10.0) / 10.0 ),
315  wxOK | wxICON_EXCLAMATION );
316  }
317  }
318  else {
320  /* i18n-hint: 'Time Resolution' is the name of a control in the Paulstretch effect.*/
321  XO("The 'Time Resolution' is too long for the selection.\n\n"
322  "Try increasing the audio selection to at least %.1f seconds,\n"
323  "or reducing the 'Time Resolution' to less than %.1f seconds.")
324  .Format(
325  (minDuration / track->GetRate()) + 0.05, // round up to 1/10 s.
326  floor(maxTimeRes * 10.0) / 10.0),
327  wxOK | wxICON_EXCLAMATION );
328  }
329 
330  return false;
331  }
332 
333 
334  auto dlen = len.as_double();
335  double adjust_amount = dlen /
336  (dlen - ((double)stretch_buf_size * 2.0));
337  amount = 1.0 + (amount - 1.0) * adjust_amount;
338 
339  auto outputTrack = track->EmptyCopy();
340 
341  try {
342  // This encloses all the allocations of buffers, including those in
343  // the constructor of the PaulStretch object
344 
345  PaulStretch stretch(amount, stretch_buf_size, track->GetRate());
346 
347  auto nget = stretch.get_nsamples_for_fill();
348 
349  auto bufsize = stretch.poolsize;
350  Floats buffer0{ bufsize };
351  float *bufferptr0 = buffer0.get();
352  bool first_time = true;
353 
354  const auto fade_len = std::min<size_t>(100, bufsize / 2 - 1);
355  bool cancelled = false;
356 
357  {
358  Floats fade_track_smps{ fade_len };
359  decltype(len) s=0;
360 
361  while (s < len) {
362  track->Get((samplePtr)bufferptr0, floatSample, start + s, nget);
363  stretch.process(buffer0.get(), nget);
364 
365  if (first_time) {
366  stretch.process(buffer0.get(), 0);
367  };
368 
369  s += nget;
370 
371  if (first_time){//blend the start of the selection
372  track->Get((samplePtr)fade_track_smps.get(), floatSample, start, fade_len);
373  first_time = false;
374  for (size_t i = 0; i < fade_len; i++){
375  float fi = (float)i / (float)fade_len;
376  stretch.out_buf[i] =
377  stretch.out_buf[i] * fi + (1.0 - fi) * fade_track_smps[i];
378  }
379  }
380  if (s >= len){//blend the end of the selection
381  track->Get((samplePtr)fade_track_smps.get(), floatSample, end - fade_len, fade_len);
382  for (size_t i = 0; i < fade_len; i++){
383  float fi = (float)i / (float)fade_len;
384  auto i2 = bufsize / 2 - 1 - i;
385  stretch.out_buf[i2] =
386  stretch.out_buf[i2] * fi + (1.0 - fi) *
387  fade_track_smps[fade_len - 1 - i];
388  }
389  }
390 
391  outputTrack->Append((samplePtr)stretch.out_buf.get(), floatSample, stretch.out_bufsize);
392 
393  nget = stretch.get_nsamples();
394  if (TrackProgress(count,
395  s.as_double() / len.as_double()
396  )) {
397  cancelled = true;
398  break;
399  }
400  }
401  }
402 
403  if (!cancelled){
404  outputTrack->Flush();
405 
406  track->Clear(t0,t1);
407  track->Paste(t0, outputTrack.get());
408  m_t1 = mT0 + outputTrack->GetEndTime();
409  }
410 
411  return !cancelled;
412  }
413  catch ( const std::bad_alloc& ) {
414  ::Effect::MessageBox( badAllocMessage );
415  return false;
416  }
417 };
418 
419 /*************************************************************/
420 
421 
422 PaulStretch::PaulStretch(float rap_, size_t in_bufsize_, float samplerate_ )
423  : samplerate { samplerate_ }
424  , rap { std::max(1.0f, rap_) }
425  , in_bufsize { in_bufsize_ }
426  , out_bufsize { std::max(size_t{ 8 }, in_bufsize) }
427  , out_buf { out_bufsize }
428  , old_out_smp_buf { out_bufsize * 2, true }
429  , poolsize { in_bufsize_ * 2 }
430  , in_pool { poolsize, true }
431  , remained_samples { 0.0 }
432  , fft_smps { poolsize, true }
433  , fft_c { poolsize, true }
434  , fft_s { poolsize, true }
435  , fft_freq { poolsize, true }
436  , fft_tmp { poolsize }
437 {
438 }
439 
441 {
442 }
443 
444 void PaulStretch::process(float *smps, size_t nsmps)
445 {
446  //add NEW samples to the pool
447  if ((smps != NULL) && (nsmps != 0)) {
448  if (nsmps > poolsize) {
449  nsmps = poolsize;
450  }
451  int nleft = poolsize - nsmps;
452 
453  //move left the samples from the pool to make room for NEW samples
454  for (int i = 0; i < nleft; i++)
455  in_pool[i] = in_pool[i + nsmps];
456 
457  //add NEW samples to the pool
458  for (size_t i = 0; i < nsmps; i++)
459  in_pool[i + nleft] = smps[i];
460  }
461 
462  //get the samples from the pool
463  for (size_t i = 0; i < poolsize; i++)
464  fft_smps[i] = in_pool[i];
466 
467  RealFFT(poolsize, fft_smps.get(), fft_c.get(), fft_s.get());
468 
469  for (size_t i = 0; i < poolsize / 2; i++)
470  fft_freq[i] = sqrt(fft_c[i] * fft_c[i] + fft_s[i] * fft_s[i]);
471  process_spectrum(fft_freq.get());
472 
473 
474  //put randomize phases to frequencies and do a IFFT
475  float inv_2p15_2pi = 1.0 / 16384.0 * (float)M_PI;
476  for (size_t i = 1; i < poolsize / 2; i++) {
477  unsigned int random = (rand()) & 0x7fff;
478  float phase = random * inv_2p15_2pi;
479  float s = fft_freq[i] * sin(phase);
480  float c = fft_freq[i] * cos(phase);
481 
482  fft_c[i] = fft_c[poolsize - i] = c;
483 
484  fft_s[i] = s; fft_s[poolsize - i] = -s;
485  }
486  fft_c[0] = fft_s[0] = 0.0;
487  fft_c[poolsize / 2] = fft_s[poolsize / 2] = 0.0;
488 
489  FFT(poolsize, true, fft_c.get(), fft_s.get(), fft_smps.get(), fft_tmp.get());
490 
491  float max = 0.0, max2 = 0.0;
492  for (size_t i = 0; i < poolsize; i++) {
493  max = std::max(max, fabsf(fft_tmp[i]));
494  max2 = std::max(max2, fabsf(fft_smps[i]));
495  }
496 
497 
498  //make the output buffer
499  float tmp = 1.0 / (float) out_bufsize * M_PI;
500  float hinv_sqrt2 = 0.853553390593f;//(1.0+1.0/sqrt(2))*0.5;
501 
502  float ampfactor = 1.0;
503  if (rap < 1.0)
504  ampfactor = rap * 0.707;
505  else
506  ampfactor = (out_bufsize / (float)poolsize) * 4.0;
507 
508  for (size_t i = 0; i < out_bufsize; i++) {
509  float a = (0.5 + 0.5 * cos(i * tmp));
510  float out = fft_smps[i + out_bufsize] * (1.0 - a) + old_out_smp_buf[i] * a;
511  out_buf[i] =
512  out * (hinv_sqrt2 - (1.0 - hinv_sqrt2) * cos(i * 2.0 * tmp)) *
513  ampfactor;
514  }
515 
516  //copy the current output buffer to old buffer
517  for (size_t i = 0; i < out_bufsize * 2; i++)
518  old_out_smp_buf[i] = fft_smps[i];
519 }
520 
522 {
523  double r = out_bufsize / rap;
524  auto ri = (size_t)floor(r);
525  double rf = r - floor(r);
526 
527  remained_samples += rf;
528  if (remained_samples >= 1.0){
529  ri += (size_t)floor(remained_samples);
531  }
532 
533  if (ri > poolsize) {
534  ri = poolsize;
535  }
536 
537  return ri;
538 }
539 
541 {
542  return poolsize;
543 }
Effect::IsPreviewing
bool IsPreviewing()
Definition: Effect.h:362
EffectPaulstretch::OnText
void OnText(wxCommandEvent &evt)
Definition: Paulstretch.cpp:240
TranslatableString
Definition: Types.h:290
WindowFunc
void WindowFunc(int whichFunction, size_t NumSamples, float *in)
Definition: FFT.cpp:516
CommandParameters
CommandParameters, derived from wxFileConfig, is essentially doing the same things as the Shuttle cla...
Definition: EffectAutomationParameters.h:67
Paulstretch.h
PaulStretch::in_bufsize
const size_t in_bufsize
Definition: Paulstretch.cpp:63
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
EffectPaulstretch::GetType
EffectType GetType() override
Definition: Paulstretch.cpp:127
Effect::EnableApply
virtual bool EnableApply(bool enable=true)
Definition: Effect.cpp:1925
EffectPaulstretch::SetAutomationParameters
bool SetAutomationParameters(CommandParameters &parms) override
Definition: Paulstretch.cpp:147
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
EffectPaulstretch::ProcessOne
bool ProcessOne(WaveTrack *track, double t0, double t1, int count)
Definition: Paulstretch.cpp:263
Effect::MessageBox
int MessageBox(const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
Definition: Effect.cpp:2478
Effect::CopyInputTracks
void CopyInputTracks(bool allSyncLockSelected=false)
Definition: Effect.cpp:2070
Format
Abstract base class used in importing a file.
EffectPaulstretch::DefineParams
bool DefineParams(ShuttleParams &S) override
Definition: Paulstretch.cpp:133
Effect::mT1
double mT1
Definition: Effect.h:466
PaulStretch::PaulStretch
PaulStretch(float rap_, size_t in_bufsize_, float samplerate_)
Definition: Paulstretch.cpp:422
XO
#define XO(s)
Definition: Internat.h:32
PaulStretch::samplerate
const float samplerate
Definition: Paulstretch.cpp:59
PaulStretch::rap
const float rap
Definition: Paulstretch.cpp:62
ShuttleParams
Shuttle that deals with parameters. This is a base class with lots of virtual functions that do nothi...
Definition: Shuttle.h:61
PaulStretch::fft_tmp
const Floats fft_tmp
Definition: Paulstretch.cpp:80
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
floatSample
@ floatSample
Definition: Types.h:722
EffectPaulstretch::mAmount
float mAmount
Definition: Paulstretch.h:58
EffectPaulstretch::mTime_resolution
float mTime_resolution
Definition: Paulstretch.h:59
CommandParameters::WriteFloat
bool WriteFloat(const wxString &key, float f)
Definition: EffectAutomationParameters.h:156
EffectPaulstretch::GetBufferSize
size_t GetBufferSize(double rate)
Definition: Paulstretch.cpp:245
PaulStretch::out_buf
const Floats out_buf
Definition: Paulstretch.cpp:67
PaulStretch::fft_c
const Floats fft_c
Definition: Paulstretch.cpp:80
RealFFT
void RealFFT(size_t NumSamples, const float *RealIn, float *RealOut, float *ImagOut)
Definition: FFT.cpp:231
WaveTrack::EmptyCopy
Holder EmptyCopy(const SampleBlockFactoryPtr &pFactory={}) const
Definition: WaveTrack.cpp:574
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
EffectPaulstretch::GetDescription
TranslatableString GetDescription() override
Definition: Paulstretch.cpp:115
eWinFuncHann
@ eWinFuncHann
Definition: FFT.h:113
WaveTrack::Get
bool Get(samplePtr buffer, sampleFormat format, sampleCount start, size_t len, fillFormat fill=fillZero, bool mayThrow=true, sampleCount *pNumWithinClips=nullptr) const
Definition: WaveTrack.cpp:1895
EffectPaulstretch::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: Paulstretch.cpp:228
EffectPaulstretch::CalcPreviewInputLength
double CalcPreviewInputLength(double previewLength) override
Definition: Paulstretch.cpp:160
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:457
PaulStretch::out_bufsize
const size_t out_bufsize
Definition: Paulstretch.cpp:66
PaulStretch::process_spectrum
void process_spectrum(float *WXUNUSED(freq))
Definition: Paulstretch.cpp:59
samplePtr
char * samplePtr
Definition: Types.h:737
EffectPaulstretch::GetAutomationParameters
bool GetAutomationParameters(CommandParameters &parms) override
Definition: Paulstretch.cpp:139
FFT
void FFT(size_t NumSamples, bool InverseTransform, const float *RealIn, const float *ImagIn, float *RealOut, float *ImagOut)
Definition: FFT.cpp:132
EffectPaulstretch::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: Paulstretch.cpp:199
XXO
#define XXO(s)
Definition: Internat.h:45
WaveTrack::Clear
void Clear(double t0, double t1) override
Definition: WaveTrack.cpp:654
TrackKind::Time
@ Time
Effect::mT0
double mT0
Definition: Effect.h:465
PaulStretch::old_out_smp_buf
const Floats old_out_smp_buf
Definition: Paulstretch.cpp:70
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
Param
Param(Amount, float, wxT("Stretch Factor"), 10.0, 1.0, FLT_MAX, 1)
PaulStretch::get_nsamples_for_fill
size_t get_nsamples_for_fill()
Definition: Paulstretch.cpp:540
PaulStretch::fft_smps
const Floats fft_smps
Definition: Paulstretch.cpp:80
EffectPaulstretch::Process
bool Process() override
Definition: Paulstretch.cpp:173
Effect::ReplaceProcessedTracks
void ReplaceProcessedTracks(const bool bGoodResult)
Definition: Effect.cpp:2192
WaveTrack::Paste
void Paste(double t0, const Track *src) override
Definition: WaveTrack.cpp:1171
ShuttleGui::Validator
ShuttleGui & Validator(const Factory &f)
Definition: ShuttleGui.h:685
EffectPaulstretch::ManualPage
wxString ManualPage() override
Definition: Paulstretch.cpp:120
PaulStretch::process
void process(float *smps, size_t nsmps)
Definition: Paulstretch.cpp:444
EffectPaulstretch::TransferDataToWindow
bool TransferDataToWindow() override
Definition: Paulstretch.cpp:218
Effect::mOutputTracks
std::shared_ptr< TrackList > mOutputTracks
Definition: Effect.h:464
PaulStretch::remained_samples
double remained_samples
Definition: Paulstretch.cpp:78
LoadEffects.h
EffectPaulstretch::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Paulstretch.cpp:110
WaveTrack::TimeToLongSamples
sampleCount TimeToLongSamples(double t0) const
Convert correctly between an (absolute) time in seconds and a number of samples.
Definition: WaveTrack.cpp:1767
BuiltinEffectsModule::Registration
Definition: LoadEffects.h:40
Effect::mUIParent
wxWindow * mUIParent
Definition: Effect.h:477
PaulStretch::fft_freq
const Floats fft_freq
Definition: Paulstretch.cpp:80
anonymous_namespace{Paulstretch.cpp}::reg
BuiltinEffectsModule::Registration< EffectPaulstretch > reg
Definition: Paulstretch.cpp:90
M_PI
#define M_PI
Definition: Distortion.cpp:29
PaulStretch::poolsize
const size_t poolsize
Definition: Paulstretch.cpp:73
PaulStretch::fft_s
const Floats fft_s
Definition: Paulstretch.cpp:80
PaulStretch::get_nsamples
size_t get_nsamples()
Definition: Paulstretch.cpp:521
EffectType
EffectType
Definition: EffectInterface.h:55
EffectPaulstretch::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Paulstretch.h:20
PaulStretch::in_pool
const Floats in_pool
Definition: Paulstretch.cpp:76
END_EVENT_TABLE
END_EVENT_TABLE()
Effect::TrackProgress
bool TrackProgress(int whichTrack, double frac, const TranslatableString &={})
Definition: Effect.cpp:2024
PaulStretch::~PaulStretch
virtual ~PaulStretch()
Definition: Paulstretch.cpp:440
ArrayOf< float >
EffectPaulstretch::~EffectPaulstretch
virtual ~EffectPaulstretch()
Definition: Paulstretch.cpp:104
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638
ReadAndVerifyFloat
#define ReadAndVerifyFloat(name)
Definition: Effect.h:633
EffectPaulstretch::m_t1
double m_t1
Definition: Paulstretch.h:60
PaulStretch
Class that helps EffectPaulStretch. It does the FFTs and inner loop of the effect.
Definition: Paulstretch.cpp:47
WaveTrack::GetRate
double GetRate() const
Definition: WaveTrack.cpp:360
EffectPaulstretch
An Extreme Time Stretch and Time Smear effect.
Definition: Paulstretch.h:18