mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
TimeScale effect improvements, updating to sbsms 2, not including GUI changes (except removing obsolete transient sharpening option). See Bug 485.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#if USE_SBSMS
|
||||
|
||||
#include "TimeScale.h"
|
||||
#include "sbsms.h"
|
||||
|
||||
#include "../ShuttleGui.h"
|
||||
|
||||
@@ -103,12 +104,6 @@ bool EffectTimeScale::TransferParameters( Shuttle & shuttle )
|
||||
return true;
|
||||
}
|
||||
|
||||
inline double InvertedPercentChangeToRatio(double percentChange)
|
||||
{
|
||||
//mchinen hack: invert the ratio so it works with the sbsms bug which requires the reciprocal number.
|
||||
return 1.0/(1.0 + percentChange / 100.0);
|
||||
}
|
||||
|
||||
inline double PercentChangeToRatio(double percentChange)
|
||||
{
|
||||
return 1.0 + percentChange / 100.0;
|
||||
@@ -121,19 +116,16 @@ inline double HalfStepsToPercentChange(double halfSteps)
|
||||
|
||||
inline double PercentChangeToHalfSteps(double percentChange)
|
||||
{
|
||||
// mchinen: hack: take the negative of this so the correct value is displayed
|
||||
// (see the InvertedPercentChangeToRatio hack for why this is needed)
|
||||
return 17.312340490667560888319096172023 * log(PercentChangeToRatio(percentChange));
|
||||
}
|
||||
|
||||
bool EffectTimeScale::Process()
|
||||
{
|
||||
// The pitch part of sbsms is backwards, so use an inverted function
|
||||
double pitchStart = InvertedPercentChangeToRatio(m_PitchPercentChangeStart);
|
||||
double pitchEnd = InvertedPercentChangeToRatio(m_PitchPercentChangeEnd);
|
||||
double pitchStart = PercentChangeToRatio(m_PitchPercentChangeStart);
|
||||
double pitchEnd = PercentChangeToRatio(m_PitchPercentChangeEnd);
|
||||
double rateStart = PercentChangeToRatio(m_RatePercentChangeStart);
|
||||
double rateEnd = PercentChangeToRatio(m_RatePercentChangeEnd);
|
||||
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,m_PreAnalyze);
|
||||
this->EffectSBSMS::setParameters(rateStart,rateEnd,pitchStart,pitchEnd,SlideLinearOutputRate,SlideLinearOutputRate,false,false,false);
|
||||
return this->EffectSBSMS::Process();
|
||||
}
|
||||
|
||||
@@ -298,23 +290,8 @@ void TimeScaleDialog::PopulateOrExchange(ShuttleGui & S)
|
||||
}
|
||||
S.EndStatic();
|
||||
S.EndMultiColumn();
|
||||
|
||||
S.StartStatic(_("Options"));
|
||||
{
|
||||
S.StartHorizontalLay(wxEXPAND);
|
||||
{
|
||||
S.SetStyle(wxSL_HORIZONTAL);
|
||||
/* i18n-hint: Transients are sounds like the onset of cymbals or drums.
|
||||
They can get 'blurred' by sound stretching. This checkbox option
|
||||
may make them sharper again. */
|
||||
m_pCheckBox_PreAnalyze = S.Id(ID_CHECKBOX_PREANALYZE)
|
||||
.AddCheckBox(_("Dynamic Transient Sharpening"), wxT("false"));
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
}
|
||||
S.EndStatic();
|
||||
|
||||
return;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool TimeScaleDialog::TransferDataToWindow()
|
||||
|
Reference in New Issue
Block a user