summaryrefslogtreecommitdiff
path: root/chugins/Clipper.cpp
blob: 7c80793be47aa4e7e2c683dd3a81d6cb43b681dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <chuck_dl.h>
#include <chuck_def.h>

CK_DLL_TICK(clipper_tick);

CK_DLL_QUERY(Clipper)
{
	QUERY->setname(QUERY, "Clipper");

	QUERY->begin_class(QUERY, "Clipper", "UGen");
	QUERY->add_ugen_func(QUERY, clipper_tick, NULL, 1, 1);
	QUERY->end_class(QUERY);

	return TRUE;
}

CK_DLL_TICK(clipper_tick)
{
	*out = in > 1. ? 1. : (in < -1. ? -1. : in);

	return TRUE;
}