2015-06-08 11:44:06 -07:00
|
|
|
#include <string.h>
|
2014-02-05 23:28:33 -08:00
|
|
|
|
2015-06-06 23:03:04 -07:00
|
|
|
#include "util.hpp"
|
2015-06-08 11:44:06 -07:00
|
|
|
#include "Param.hpp"
|
|
|
|
#include "Crap.hpp"
|
|
|
|
|
|
|
|
struct Crap_noise
|
|
|
|
:public AdjustAll<Crap> {
|
2015-12-06 09:49:12 -08:00
|
|
|
static const ulong id = 0xEC57A71C;
|
|
|
|
static const char *label;
|
|
|
|
static const char *name;
|
|
|
|
static const char *author;
|
|
|
|
static const char *copyright;
|
|
|
|
static const ulong parameters = 0;
|
2015-06-08 11:44:06 -07:00
|
|
|
|
|
|
|
unsigned int mirand_L, mirand_R;
|
|
|
|
|
|
|
|
inline
|
|
|
|
Crap_noise()
|
|
|
|
: mirand_L(123), mirand_R(456)
|
|
|
|
{}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
process(
|
|
|
|
double *in_L, double *in_R,
|
|
|
|
double *out_L, double *out_R,
|
|
|
|
ulong count)
|
|
|
|
{
|
|
|
|
for (ulong i = 0; i < count; i++)
|
|
|
|
out_L[i] = whitenoise(mirand_L);
|
|
|
|
for (ulong i = 0; i < count; i++)
|
|
|
|
out_R[i] = whitenoise(mirand_R);
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
process(
|
|
|
|
float *in_L, float *in_R,
|
|
|
|
float *out_L, float *out_R,
|
|
|
|
ulong count)
|
|
|
|
{
|
|
|
|
for (ulong i = 0; i < count; i++)
|
|
|
|
out_L[i] = whitenoise(mirand_L);
|
|
|
|
for (ulong i = 0; i < count; i++)
|
|
|
|
out_R[i] = whitenoise(mirand_R);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
construct_params(Param *params)
|
|
|
|
{}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
resume()
|
|
|
|
{}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
pause()
|
|
|
|
{}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
adjust_all(Param *params)
|
|
|
|
{}
|
|
|
|
};
|
2015-06-08 12:25:44 -07:00
|
|
|
|
2015-12-06 09:49:12 -08:00
|
|
|
const char *Crap_noise::label = "crap_noise";
|
|
|
|
const char *Crap_noise::name = "crap noise generator";
|
|
|
|
const char *Crap_noise::author = "Connor Olding";
|
|
|
|
const char *Crap_noise::copyright = "MIT";
|