blob: d702576f479d606add18083a0b76ea100722fd63 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <math.h>
#include <chuck_dl.h>
#include <chuck_def.h>
CK_DLL_TICK(clipper_tick);
CK_DLL_QUERY(SoftClipper)
{
QUERY->setname(QUERY, "SoftClipper");
QUERY->begin_class(QUERY, "SoftClipper", "UGen");
QUERY->add_ugen_func(QUERY, clipper_tick, NULL, 1, 1);
QUERY->end_class(QUERY);
return TRUE;
}
CK_DLL_TICK(clipper_tick)
{
#ifdef __CHUCK_USE_64_BIT_SAMPLE__
*out = atan(in * 2.)/M_PI_2;
#else
*out = atanf(in * 2.)/M_PI_2;
#endif
return TRUE;
}
|