rubberband-0.1.0.1: Binding to the C++ audio stretching library Rubber Band

Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.RubberBand.Option

Synopsis

Documentation

data Options Source

Processing options for the timestretcher. The preferred options should normally be set when calling new.

data Process Source

Process flags determine how the timestretcher will be invoked. These options may not be changed after construction.

The Process setting is likely to depend on your architecture: non-real-time operation on seekable files: Offline; real-time or streaming operation: RealTime.

Constructors

Offline

Run the stretcher in offline mode. In this mode the input data needs to be provided twice, once to study, which calculates a stretch profile for the audio, and once to process, which stretches it.

RealTime

Run the stretcher in real-time mode. In this mode only process should be called, and the stretcher adjusts dynamically in response to the input audio.

data Stretch Source

Stretch flags control the profile used for variable timestretching. Rubber Band always adjusts the stretch profile to minimise stretching of busy broadband transient sounds, but the degree to which it does so is adjustable. These options may not be changed after construction.

Constructors

Elastic

Only meaningful in offline mode, and the default in that mode. The audio will be stretched at a variable rate, aimed at preserving the quality of transient sounds as much as possible. The timings of low activity regions between transients may be less exact than when the precise flag is set.

Precise

Although still using a variable stretch rate, the audio will be stretched so as to maintain as close as possible to a linear stretch ratio throughout. Timing may be better than when using Elastic, at slight cost to the sound quality of transients. This setting is always used when running in real-time mode.

data Transients Source

Transients flags control the component frequency phase-reset mechanism that may be used at transient points to provide clarity and realism to percussion and other significant transient sounds. These options may be changed after construction when running in real-time mode, but not when running in offline mode.

Constructors

Crisp

Reset component phases at the peak of each transient (the start of a significant note or percussive event). This, the default setting, usually results in a clear-sounding output; but it is not always consistent, and may cause interruptions in stable sounds present at the same time as transient events. The Detector flags can be used to tune this to some extent.

Mixed

Reset component phases at the peak of each transient, outside a frequency range typical of musical fundamental frequencies. The results may be more regular for mixed stable and percussive notes than Crisp, but with a "phasier" sound. The balance may sound very good for certain types of music and fairly bad for others.

Smooth

Do not reset component phases at any point. The results will be smoother and more regular but may be less clear than with either of the other Transients flags.

data Detector Source

Detector flags control the type of transient detector used. These options may be changed after construction when running in real-time mode, but not when running in offline mode.

Constructors

Compound

Use a general-purpose transient detector which is likely to be good for most situations. This is the default.

Percussive

Detect percussive transients. Note that this was the default and only option in Rubber Band versions prior to 1.5.

Soft

Use an onset detector with less of a bias toward percussive transients. This may give better results with certain material (e.g. relatively monophonic piano music).

data Phase Source

Phase flags control the adjustment of component frequency phases from one analysis window to the next during non-transient segments. These options may be changed at any time.

Constructors

Laminar

Adjust phases when stretching in such a way as to try to retain the continuity of phase relationships between adjacent frequency bins whose phases are behaving in similar ways. This, the default setting, should give good results in most situations.

Independent

Adjust the phase in each frequency bin independently from its neighbours. This usually results in a slightly softer, phasier sound.

data Threading Source

Threading flags control the threading model of the stretcher. These options may not be changed after construction.

Constructors

Auto

Permit the stretcher to determine its own threading model. Usually this means using one processing thread per audio channel in offline mode if the stretcher is able to determine that more than one CPU is available, and one thread only in realtime mode. This is the defafult.

Never

Never use more than one thread.

Always

Use multiple threads in any situation where Auto would do so, except omit the check for multiple CPUs and instead assume it to be true.

data Window Source

Window flags control the window size for FFT processing. The window size actually used will depend on many factors, but it can be influenced. These options may not be changed after construction.

Constructors

Standard

Use the default window size. The actual size will vary depending on other parameters. This option is expected to produce better results than the other window options in most situations.

Short

Use a shorter window. This may result in crisper sound for audio that depends strongly on its timing qualities.

Long

Use a longer window. This is likely to result in a smoother sound at the expense of clarity and timing.

data Smoothing Source

Smoothing flags control the use of window-presum FFT and time-domain smoothing. These options may not be changed after construction.

Constructors

SmoothingOff

Do not use time-domain smoothing. This is the default.

SmoothingOn

Use time-domain smoothing. This will result in a softer sound with some audible artifacts around sharp transients, but it may be appropriate for longer stretches of some instruments and can mix well with a Window setting of Short.

data Formant Source

Formant flags control the handling of formant shape (spectral envelope) when pitch-shifting. These options may be changed at any time.

Constructors

Shifted

Apply no special formant processing. The spectral envelope will be pitch shifted as normal. This is the default.

Preserved

Preserve the spectral envelope of the unshifted signal. This permits shifting the note frequency without so substantially affecting the perceived pitch profile of the voice or instrument.

data Pitch Source

Pitch flags control the method used for pitch shifting. These options may be changed at any time. They are only effective in realtime mode; in offline mode, the pitch-shift method is fixed.

Constructors

HighSpeed

Use a method with a CPU cost that is relatively moderate and predictable. This may sound less clear than HighQuality, especially for large pitch shifts. This is the default.

HighQuality

Use the highest quality method for pitch shifting. This method has a CPU cost approximately proportional to the required frequency shift.

HighConsistency

Use the method that gives greatest consistency when used to create small variations in pitch around the 1.0-ratio level. Unlike the previous two options, this avoids discontinuities when moving across the 1.0 pitch scale in real-time; it also consumes more CPU than the others in the case where the pitch scale is exactly 1.0.

data Channels Source

Channels flags control the method used for processing two-channel audio. These options may not be changed after construction.

Constructors

Apart

Each channel is processed individually, though timing is synchronised and phases are synchronised at transients (depending on the Transients setting). This gives the highest quality for the individual channels but a relative lack of stereo focus and unrealistic increase in "width". This is the default.

Together

The first two channels (where two or more are present) are considered to be a stereo pair and are processed in mid-side format; mid and side are processed individually, with timing synchronised and phases synchronised at transients (depending on the Transients setting). This usually leads to better focus in the centre but a loss of stereo space and width. Any channels beyond the first two are processed individually.

class (Enum o, Bounded o) => Option o where Source

A more limited enumeration class, without the extra functionality of Haskell's Enum.

Methods

optionEnum :: o -> Int Source

Note that optionEnum returns different values from toEnum.

setOption :: Option o => o -> Int -> Int Source

getOption :: Option o => Int -> o Source

defaultOptions :: Options Source

Intended to give good results in most situations.