aubio 0.5.0-alpha
Loading...
Searching...
No Matches
Typedefs | Functions
timestretch.h File Reference

time stretching object More...

Go to the source code of this file.

Typedefs

typedef struct _aubio_timestretch_t aubio_timestretch_t
 time stretching object
 

Functions

void aubio_timestretch_do (aubio_timestretch_t *o, fvec_t *out, uint_t *read)
 execute time stretching on an input signal frame
 
void del_aubio_timestretch (aubio_timestretch_t *o)
 deletion of the time stretching object
 
aubio_timestretch_tnew_aubio_timestretch (const char_t *method, smpl_t stretch, uint_t hop_size, uint_t samplerate)
 creation of the time stretching object
 
sint_t aubio_timestretch_push (aubio_timestretch_t *o, fvec_t *in, uint_t length)
 push length samples from in to time stretching object
 
sint_t aubio_timestretch_get_available (aubio_timestretch_t *o)
 get number of currently available samples from time stretching object
 
uint_t aubio_timestretch_get_latency (aubio_timestretch_t *o)
 get the latency of the time stretching object, in samples
 
uint_t aubio_timestretch_get_samplerate (aubio_timestretch_t *o)
 get the samplerate of the time stretching object
 
uint_t aubio_timestretch_set_stretch (aubio_timestretch_t *o, smpl_t stretch)
 set the stretching ratio of the time stretching object
 
smpl_t aubio_timestretch_get_stretch (aubio_timestretch_t *o)
 get the transposition of the time stretching object, in semitones
 
uint_t aubio_timestretch_set_pitchscale (aubio_timestretch_t *o, smpl_t pitchscale)
 set the pitch scale of the time stretching object
 
smpl_t aubio_timestretch_get_pitchscale (aubio_timestretch_t *o)
 get the pitchscale of the time stretching object
 
uint_t aubio_timestretch_set_transpose (aubio_timestretch_t *o, smpl_t transpose)
 set the transposition of the time stretching object, in semitones
 
smpl_t aubio_timestretch_get_transpose (aubio_timestretch_t *o)
 get the transposition of the time stretching object, in semitones
 
uint_t aubio_timestretch_reset (aubio_timestretch_t *o)
 reset the time stretching object
 

Detailed Description

time stretching object

aubio_timestretch_t can be used to open a source file, read samples from it, time-stretch them, and write out the modified samples.

The time-stretching factor can be changed at any time using aubio_timestretch_set_stretch().

A transposition can also be applied and changed at any time with aubio_timestretch_set_transpose().

Definition in file timestretch.h.

Typedef Documentation

◆ aubio_timestretch_t

typedef struct _aubio_timestretch_t aubio_timestretch_t

time stretching object

Definition at line 46 of file timestretch.h.

Function Documentation

◆ aubio_timestretch_do()

void aubio_timestretch_do ( aubio_timestretch_t * o,
fvec_t * out,
uint_t * read )

execute time stretching on an input signal frame

Parameters
otime stretching object as returned by new_aubio_timestretch()
outtimestretched output of size [hop_size]
readnumber of frames actually wrote out
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_available()

sint_t aubio_timestretch_get_available ( aubio_timestretch_t * o)

get number of currently available samples from time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
number of currently available samples
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_latency()

uint_t aubio_timestretch_get_latency ( aubio_timestretch_t * o)

get the latency of the time stretching object, in samples

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
latency of the time stretching object in samples
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_pitchscale()

smpl_t aubio_timestretch_get_pitchscale ( aubio_timestretch_t * o)

get the pitchscale of the time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
pitchscale of the time stretching object
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_samplerate()

uint_t aubio_timestretch_get_samplerate ( aubio_timestretch_t * o)

get the samplerate of the time stretching object

Call after new_aubio_timestretch() was called with 0 to match the original samplerate of the input file.

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
samplerate of the time stretching object
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_stretch()

smpl_t aubio_timestretch_get_stretch ( aubio_timestretch_t * o)

get the transposition of the time stretching object, in semitones

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
time stretching ratio of the time stretching object, in the range [0.025; 10.]
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_get_transpose()

smpl_t aubio_timestretch_get_transpose ( aubio_timestretch_t * o)

get the transposition of the time stretching object, in semitones

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
transposition of the time stretching object, in semitones
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_push()

sint_t aubio_timestretch_push ( aubio_timestretch_t * o,
fvec_t * in,
uint_t length )

push length samples from in to time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
ininput vector of new samples to push to time stretching object
lengthnumber of new samples to push from input vector
Returns
number of currently available samples
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_reset()

uint_t aubio_timestretch_reset ( aubio_timestretch_t * o)

reset the time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
Returns
0 on success, non-zero otherwise
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_set_pitchscale()

uint_t aubio_timestretch_set_pitchscale ( aubio_timestretch_t * o,
smpl_t pitchscale )

set the pitch scale of the time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
pitchscalenew pitch scale of the time stretching object

pitchscale is a frequency ratio. It should be in the range [0.25, 4].

Returns
0 if successfull, non-zero otherwise
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_set_stretch()

uint_t aubio_timestretch_set_stretch ( aubio_timestretch_t * o,
smpl_t stretch )

set the stretching ratio of the time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
stretchnew time stretching ratio of the time stretching object (should be in the range [0.025; 10.])
Returns
0 if successfull, non-zero otherwise
Examples
effects/test-timestretch.c.

◆ aubio_timestretch_set_transpose()

uint_t aubio_timestretch_set_transpose ( aubio_timestretch_t * o,
smpl_t transpose )

set the transposition of the time stretching object, in semitones

Parameters
otime stretching object as returned by new_aubio_timestretch()
transposenew pitch transposition of the time stretching object, expressed in semitones (should be in the range [-24;+24])
Returns
0 if successfull, non-zero otherwise
Examples
effects/test-timestretch.c.

◆ del_aubio_timestretch()

void del_aubio_timestretch ( aubio_timestretch_t * o)

deletion of the time stretching object

Parameters
otime stretching object as returned by new_aubio_timestretch()
Examples
effects/test-timestretch.c.

◆ new_aubio_timestretch()

aubio_timestretch_t * new_aubio_timestretch ( const char_t * method,
smpl_t stretch,
uint_t hop_size,
uint_t samplerate )

creation of the time stretching object

Parameters
methodtime stretching algorithm ("default")
stretchinitial time stretching factor
hop_sizeblock size at which the frames should be produced
sampleratesampling rate of the signal
Returns
newly created aubio_timestretch_t
Examples
effects/test-timestretch.c.