#include <jack/jack.h>#include <cshellsynth/atomic-types.h>#include <cshellsynth/filter.h>Go to the source code of this file.
Data Structures | |
| struct | cs_distort_t |
Defines | |
| #define | cs_distort_destroy(cs_distort) cs_filter_destroy((cs_filter_t *) (cs_distort)) |
| #define | cs_distort_set_in(self, in) cs_filter_set_in(self, in) |
| #define | CS_EXP 1 |
| #define | CS_HYP 2 |
| #define | CS_ATAN 3 |
| #define | CS_TUBE 4 |
Functions | |
| int | cs_distort_init (cs_distort_t *self, const char *client_name, jack_options_t flags, char *server_name) |
| void | cs_distort_set_kind (cs_distort_t *self, int kind) |
| void | cs_distort_set_gain (cs_distort_t *self, float gain) |
| void | cs_distort_set_sharpness (cs_distort_t *self, float sharpness) |
Distortion filter
Ruby version: Filters::Distortion
Limits input according to one of the following equations, where s is sharpness, g is gain, and x is the original input.
Lower values of sharpness make the sound less "warm" and vice versa.
For Exponential:
-s(gx - 1)
log(e + 1)
1 - --------------------
-s
log(e + 1)
With a symmetrical equation for a negative x.
For Hyperbolic:
gx
--------------
s 1/s
(|gx| + 1)
For Arctangent:
2atan(sgx)
----------
π
| #define cs_distort_destroy | ( | cs_distort | ) | cs_filter_destroy((cs_filter_t *) (cs_distort)) |
Destroy distortion filter
| #define cs_distort_set_in | ( | self, | |||
| in | ) | cs_filter_set_in(self, in) |
| int cs_distort_init | ( | cs_distort_t * | self, | |
| const char * | client_name, | |||
| jack_options_t | flags, | |||
| char * | server_name | |||
| ) |
Initialize distortion filter
See cs_filter_init
| void cs_distort_set_gain | ( | cs_distort_t * | self, | |
| float | gain | |||
| ) |
Set gain
Ruby version: gain=
| gain | the gain, from 0 to inf. This is exactly equivalent to raising/lowering the amplitude before the distortion stage. |
| void cs_distort_set_kind | ( | cs_distort_t * | self, | |
| int | kind | |||
| ) |
Set which kind of distortion to use.
Ruby version: kind=
Ruby version of values is Filters::Distortion::Exponential, Filters::Distortion::Hyperbolic, and Filters::Distortion::Arctangent
| kind | CS_EXP, CS_HYP, CS_ATAN |
| void cs_distort_set_sharpness | ( | cs_distort_t * | self, | |
| float | sharpness | |||
| ) |
Set sharpness
Ruby version: sharpness=
| sharpness | how sharply the transfer curve bends towards 1.0. Lower values sound "warmer" and vice versa. |
1.6.3