aubio: synth/wavetable.h File Reference

aubio 0.4.9

Loading...
Searching...
No Matches
Typedefs | Functions
wavetable.h File Reference

Wavetable synthesis. More...

Go to the source code of this file.

## Typedefs
typedef struct _aubio_wavetable_t | aubio_wavetable_t
| wavetable object

## Functions
aubio_wavetable_t * | new_aubio_wavetable (uint_t samplerate, uint_t hop_size)
| create new wavetable object
uint_t | aubio_wavetable_load (aubio_wavetable_t *o, const char_t *uri)
| load source in wavetable
void | aubio_wavetable_do (aubio_wavetable_t *o, const fvec_t *input, fvec_t *output)
| process wavetable function
void | aubio_wavetable_do_multi (aubio_wavetable_t *o, const fmat_t *input, fmat_t *output)
| process wavetable function, multiple channels
uint_t | aubio_wavetable_get_playing (const aubio_wavetable_t *o)
| get current playing state
uint_t | aubio_wavetable_set_playing (aubio_wavetable_t *o, uint_t playing)
| set current playing state
uint_t | aubio_wavetable_play (aubio_wavetable_t *o)
| play sample from start
uint_t | aubio_wavetable_stop (aubio_wavetable_t *o)
| stop wavetable
uint_t | aubio_wavetable_set_freq (aubio_wavetable_t *o, smpl_t freq)
| set wavetable frequency
smpl_t | aubio_wavetable_get_freq (const aubio_wavetable_t *o)
| get wavetable frequency
uint_t | aubio_wavetable_set_amp (aubio_wavetable_t *o, smpl_t amp)
| set wavetable amplitude
smpl_t | aubio_wavetable_get_amp (const aubio_wavetable_t *o)
| get wavetable amplitude
void | del_aubio_wavetable (aubio_wavetable_t *o)
| destroy aubio_wavetable_t object

## Detailed Description

Wavetable synthesis.

This file creates a wavetable and plays it at different frequency.

The _do function adds the new samples to the input, and write the result as the output.

Definition in file wavetable.h.

## Typedef Documentation

## ◆ aubio_wavetable_t

typedef struct _aubio_wavetable_t aubio_wavetable_t

wavetable object

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.

Definition at line 42 of file wavetable.h.

## Function Documentation

## ◆ aubio_wavetable_do()

void aubio_wavetable_do | ( | aubio_wavetable_t * | o,
|  | const fvec_t * | input,
|  | fvec_t * | output )

process wavetable function

Parameters

  o | wavetable, created by new_aubio_wavetable()
  input | input of the wavetable, to be added to the output
  output | output of the wavetable

This function adds the new samples from the playing wavetable to the output.

If input is not NULL and different from output, then the samples from input are added to the output.

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.

## ◆ aubio_wavetable_do_multi()

void aubio_wavetable_do_multi | ( | aubio_wavetable_t * | o,
|  | const fmat_t * | input,
|  | fmat_t * | output )

process wavetable function, multiple channels

Parameters

  o | wavetable, created by new_aubio_wavetable()
  input | input of the wavetable, to be added to the output
  output | output of the wavetable

This function adds the new samples from the playing wavetable to the output.

If input is not NULL and different from output, then the samples from input are added to the output.

## ◆ aubio_wavetable_get_amp()

smpl_t aubio_wavetable_get_amp | ( | const aubio_wavetable_t * | o | ) |

get wavetable amplitude

Parameters

  o | wavetable, created by new_aubio_wavetable()

Returns
  current amplitude

## ◆ aubio_wavetable_get_freq()

smpl_t aubio_wavetable_get_freq | ( | const aubio_wavetable_t * | o | ) |

get wavetable frequency

Parameters

  o | wavetable, created by new_aubio_wavetable()

Returns
  current frequency, in Hz

## ◆ aubio_wavetable_get_playing()

uint_t aubio_wavetable_get_playing | ( | const aubio_wavetable_t * | o | ) |

get current playing state

Parameters

  o | wavetable, created by new_aubio_wavetable()

Returns
  0 if not playing, 1 if playing

## ◆ aubio_wavetable_load()

uint_t aubio_wavetable_load | ( | aubio_wavetable_t * | o,
|  | const char_t * | uri )

load source in wavetable

TODO: This function is not implemented yet. See new_aubio_sampler() instead.

Parameters

  o | wavetable, created by new_aubio_wavetable()
  uri | the uri of the source to load

Returns
  0 if successful, non-zero otherwise

## ◆ aubio_wavetable_play()

uint_t aubio_wavetable_play | ( | aubio_wavetable_t * | o | ) |

play sample from start

Parameters

  o | wavetable, created by new_aubio_wavetable()

Returns
  0 if successful, 1 otherwise

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.

## ◆ aubio_wavetable_set_amp()

uint_t aubio_wavetable_set_amp | ( | aubio_wavetable_t * | o,
|  | smpl_t | amp )

set wavetable amplitude

Parameters

  o | wavetable, created by new_aubio_wavetable()
  amp | new amplitude value for the wavetable

Returns
  0 if successful, 1 otherwise

Examples
  examples/aubiopitch.c.

## ◆ aubio_wavetable_set_freq()

uint_t aubio_wavetable_set_freq | ( | aubio_wavetable_t * | o,
|  | smpl_t | freq )

set wavetable frequency

Parameters

  o | wavetable, created by new_aubio_wavetable()
  freq | new frequency value for the wavetable

Returns
  0 if successful, 1 otherwise

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.

## ◆ aubio_wavetable_set_playing()

uint_t aubio_wavetable_set_playing | ( | aubio_wavetable_t * | o,
|  | uint_t | playing )

set current playing state

Parameters

  o | wavetable, created by new_aubio_wavetable()
  playing | 0 for not playing, 1 for playing

Returns
  0 if successful, 1 otherwise

## ◆ aubio_wavetable_stop()

uint_t aubio_wavetable_stop | ( | aubio_wavetable_t * | o | ) |

stop wavetable

Parameters

  o | wavetable, created by new_aubio_wavetable()

Returns
  0 if successful, 1 otherwise

Examples
  examples/aubioonset.c, examples/aubiotrack.c, and synth/test-wavetable.c.

## ◆ del_aubio_wavetable()

void del_aubio_wavetable | ( | aubio_wavetable_t * | o | ) |

destroy aubio_wavetable_t object

Parameters

  o | wavetable, created by new_aubio_wavetable()

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.

## ◆ new_aubio_wavetable()

aubio_wavetable_t * new_aubio_wavetable | ( | uint_t | samplerate,
|  | uint_t | hop_size )

create new wavetable object

Parameters

  samplerate | the sampling rate of the new wavetable
  hop_size | the block size of the new wavetable

Returns
  the newly created aubio_wavetable_t

Examples
  examples/aubioonset.c, examples/aubiopitch.c, examples/aubiotrack.c, and synth/test-wavetable.c.