49 if(strstr(
loc,
"Pnumformants"))
51 else if(strstr(
loc,
"Pstages"))
53 else if(strstr(
loc,
"Pcenterfreq"))
55 else if(strstr(
loc,
"Pgain"))
57 else if(strstr(
loc,
"Pq"))
59 else if(strstr(
loc,
"Poctavesfreq"))
75 case 0:fl_line_style(FL_SOLID);
break;
76 case 1:fl_line_style(FL_DOT);
break;
77 case 2:fl_line_style(FL_DASH);
break;
81 if ((freqx>0.0)&&(freqx<1.0))
82 fl_line(
x()+(
int) (freqx*
w()),
y(),
83 x()+(
int) (freqx*
w()),
y()+
h());
99 osc->renameLink(
loc+
"Pvowels", new_base+
"Pvowels",
this);
100 osc->renameLink(
loc+
"Pnumformants", new_base+
"Pnumformants",
this);
101 osc->renameLink(
loc+
"Pstages", new_base+
"Pstages",
this);
102 osc->renameLink(
loc+
"Pcenterfreq", new_base+
"Pcenterfreq",
this);
103 osc->renameLink(
loc+
"Poctavesfreq", new_base+
"Poctavesfreq",
this);
104 osc->renameLink(
loc+
"Pgain", new_base+
"Pgain",
this);
105 osc->renameLink(
loc+
"Pq", new_base+
"Pq",
this);
115 const int ox=
x(),oy=
y(),
lx=
w(),ly=
h();
118 fl_rectf(ox,oy,
lx,ly);
124 fl_line_style(FL_SOLID);
128 if ((freqx>0.0)&&(freqx<1.0))
129 fl_line(ox+(
int) (freqx*
lx),oy,
130 ox+(
int) (freqx*
lx),oy+ly);
132 for(
int i=1;
i<10;
i++){
149 fl_line_style(FL_DOT);
150 int GY=10;
if (ly<GY*3) GY=-1;
151 for (
int i=1;
i<GY;
i++){
152 int tmp=(
int)(ly/(
float)GY*
i);
153 fl_line(ox+2,oy+tmp,ox+
lx-2,oy+tmp);
157 fl_font(FL_HELVETICA,10);
165 fl_draw(tmpstr,ox+1,oy+1,40,12,FL_ALIGN_LEFT,
NULL,0);
167 snprintf(tmpstr,20,
"%d dB",(
int)(
rap2dB(1
e-9 +
170 fl_draw(tmpstr,ox+1,oy+15,40,12,FL_ALIGN_LEFT,
NULL,0);
177 fl_line_style(FL_SOLID);
181 fl_line_style( FL_SOLID, 2 );
184 for(
int i=1;
i<
lx;
i++){
186 if ((iy>=0)&&(oiy>=0)&&(iy<ly)&&(oiy<
lx))
187 fl_vertex(ox+
i,oy+ly-iy);
191 fl_line_style(FL_SOLID,0);
204 return (
Pgain / 64.0f - 1.0f) * 30.0f;
209 return expf(powf((
float)
Pq / 127.0f, 2) * logf(1000.0f)) - 0.9f;
217 return 10000.0f * powf(10, -(1.0f -
Pcenterfreq / 127.0f) * 2.0f);
255 for(
int i = 0;
i < nfreqs; ++
i)
264 filter_q = (filter_q > 1.0f ? powf(filter_q, 1.0f / (
Pstages + 1)) : filter_q);
270 const float SampleRate = 48000.0f;
273 if(filter_freq <= (SampleRate / 2 - 100.0f)) {
274 const float omega = 2 *
PI * filter_freq / SampleRate;
275 const float sn = sinf(omega);
276 const float cs = cosf(omega);
277 const float alpha = sn / (2 * filter_q);
278 const float tmp = 1 + alpha;
279 c[0] = alpha / tmp *sqrt(filter_q + 1);
281 c[2] = -alpha / tmp *sqrt(filter_q + 1);
282 d[1] = -2 * cs / tmp * (-1);
283 d[2] = (1 - alpha) / tmp * (-1);
289 for(
int i = 0;
i < nfreqs; ++
i) {
293 if(
freq > SampleRate / 2) {
294 for(
int tmp =
i; tmp < nfreqs; ++tmp)
300 const float fr =
freq / SampleRate *
PI * 2.0f;
303 float x =
c[0],
y = 0.0f;
304 for(
int n = 1;
n < 3; ++
n) {
305 x += cosf(
n * fr) *
c[
n];
306 y -= sinf(
n * fr) *
c[
n];
308 float h =
x *
x +
y *
y;
311 for(
int n = 1;
n < 3; ++
n) {
312 x -= cosf(
n * fr) *
d[
n];
313 y += sinf(
n * fr) *
d[
n];
317 freqs[
i] += powf(
h, (
Pstages + 1.0f) / 2.0f) * filter_amp;
322 for(
int i = 0;
i < nfreqs; ++
i) {
323 if(freqs[
i] > 0.000000001f)
340 return powf(0.1f, (1.0f -
amp / 127.0f) * 4.0f);
345 return powf(25.0f, (
q - 32.0f) / 64.0f);
#define rap2dB(rap)
Definition globals.h:222
CAdPlugDatabase::CRecord::RecordType type
Definition adplugdb.cpp:93
* e
Definition inflate.c:1404
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
unsigned v[N_MAX]
Definition inflate.c:1584
unsigned d
Definition inflate.c:940
int lx[BMAX+1]
Definition inflate.c:1578
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
#define PI
Definition eel_mdct.h:18
int n
Definition crypt.c:458
return c
Definition crypt.c:175
memcpy(hh, h, RAND_HEAD_LEN)
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
typedef int(UZ_EXP MsgFn)()