Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- data Options = Options {}
- data Process
- data Stretch
- data Transients
- data Detector
- = Compound
- | Percussive
- | Soft
- data Phase
- data Threading
- data Window
- data Smoothing
- data Formant
- data Pitch
- data Channels
- class (Enum o, Bounded o) => Option o where
- optionEnum :: o -> Int
- setOption :: Option o => o -> Int -> Int
- getOption :: Option o => Int -> o
- toOptions :: Int -> Options
- fromOptions :: Options -> Int
- defaultOptions :: Options
- percussiveOptions :: Options
Documentation
Processing options for the timestretcher. The preferred
options should normally be set when calling new
.
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
.
Offline | Run the stretcher in offline mode. In this mode the input data needs to
be provided twice, once to |
RealTime | Run the stretcher in real-time mode. In this mode only
|
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.
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 |
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.
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
|
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
|
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
|
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.
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). |
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.
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. |
Threading
flags control the threading
model of the stretcher. These options may not be changed after
construction.
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 |
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.
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. |
Smoothing
flags control the use of
window-presum FFT and time-domain smoothing. These options may
not be changed after construction.
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 |
Formant
flags control the handling of
formant shape (spectral envelope) when pitch-shifting. These
options may be changed at any time.
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. |
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.
HighSpeed | Use a method with a CPU cost
that is relatively moderate and predictable. This may
sound less clear than |
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. |
Channels
flags control the method used for
processing two-channel audio. These options may not be changed
after construction.
Apart | Each channel is processed
individually, though timing is synchronised and phases are
synchronised at transients (depending on the |
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 |
class (Enum o, Bounded o) => Option o where Source
A more limited enumeration class, without the extra functionality of
Haskell's Enum
.
optionEnum :: o -> Int Source
Note that optionEnum
returns different values from toEnum
.
fromOptions :: Options -> Int Source
defaultOptions :: Options Source
Intended to give good results in most situations.