11namespace tracktion {
inline namespace engine
52 #if TRACKTION_ENABLE_TIMESTRETCH_ELASTIQUE
54 #elif TRACKTION_ENABLE_TIMESTRETCH_RUBBERBAND
56 #elif TRACKTION_ENABLE_TIMESTRETCH_SOUNDTOUCH
117 void initialise (
double sourceSampleRate,
int samplesPerBlock,
151 int processData (
const float*
const* inChannels,
int numSamples,
float*
const* outChannels);
169 int flush (
float*
const* outChannels);
176 int samplesPerBlockRequested = 0;
const String & toString() const noexcept
The Engine is the central class for all tracktion sessions.
Handles time/pitch stretching using various supported libraries.
void initialise(double sourceSampleRate, int samplesPerBlock, int numChannels, Mode, ElastiqueProOptions, bool realtime)
Initialises the TimeStretcher ready to perform timestretching.
int getFramesNeeded() const
Returns the expected number of frames required to generate some output.
bool isInitialised() const
Returns true if this has been fully initialised.
void reset()
Resets the TimeStretcher ready for a new set of audio data, maintains mode, speed and pitch ratios.
static bool isMelodyne(Mode)
Returns true if the given Mode is a Melodyne mode.
static bool canProcessFor(Mode)
Checks that the given Mode is a valid mode and not disabled.
static juce::String getNameOfMode(Mode)
Returns the name of a given Mode for display purposes.
int getMaxFramesNeeded() const
Returns the maximum number of frames that will ever be returned by getFramesNeeded.
int processData(const float *const *inChannels, int numSamples, float *const *outChannels)
Processes some input frames and fills some output frames with the applied speed ratio and pitch shift...
static Mode getModeFromName(Engine &, const juce::String &name)
Returns the Mode for a given name.
int flush(float *const *outChannels)
Flushes the end of the stream when input data is exhausted but there is still output data available.
TimeStretcher()
Creates an TimeStretcher using the default mode.
static Mode checkModeIsAvailable(Mode)
Checks if the given mode is available for use.
bool setSpeedAndPitch(float speedRatio, float semitones)
Sets the timestretch speed ratio and semitones pitch shift.
~TimeStretcher()
Destructor.
Mode
Holds the various algorithms to which can be used (if enabled).
@ elastiqueTonal
Defunct, don't use.
@ elastiqueDirectPro
Elastique Direct Pro good all round (.
@ rubberbandMelodic
RubberBand tailored to melodic sounds prioritising pitch accuracy.
@ soundtouchNormal
SoundTouch normal quality, lower CPU use.
@ elastiquePro
Elastique Pro good all round (.
@ defaultMode
Default mode.
@ disabled
No algorithm enabled.
@ elastiqueMonophonic
Elastique which can sound better for monophonic sounds.
@ elastiqueDirectEfficient
Elastique Direct lower quality and lower CPU usage.
@ elastiqueDirectMobile
Elastique Direct lower quality and lower CPU usage, optimised for mobile.
@ rubberbandPercussive
RubberBand tailored to percussive sounds prioritising transient accuracy.
@ melodyne
Melodyne, only used for clip timestretching.
@ elastiqueEfficient
Elastique lower quality and lower CPU usage.
@ elastiqueTransient
Defunct, don't use.
@ elastiqueMobile
Elastique lower quality and lower CPU usage, optimised for mobile.
@ soundtouchBetter
SoundTouch better quality, higher CPU use.
static juce::StringArray getPossibleModes(Engine &, bool excludeMelodyne)
Returns the names of the availabel Modes.
A set of options that can be used in conjunction with the elastiquePro Mode to fine tune the algorith...
int envelopeOrder
Sets a spectral envelope shift factor.
bool operator!=(const ElastiqueProOptions &) const
Compare these options with another set.
bool preserveFormants
Preserve formats.
juce::String toString() const
Save the current options as a string.
bool midSideStereo
Optomise algorthim for mid/side channel layouts.
bool operator==(const ElastiqueProOptions &) const
Compare these options with another set.
bool syncTimeStrPitchShft
Synchronises timestretch and pitchshifting.
ElastiqueProOptions()=default
Create a default set of options.