Source

musagi-stqn / gef_gapan.h

Full commit
  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
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
#ifndef gef_gapan_h
#define gef_gapan_h

#include "gear_effect.h"

class gef_gapan : public gear_effect
{
private:

	struct gapan_params
	{
		float gain;
		float pan;
		bool dist_on;
		int dist_type;
		float dist_amp;
		float reverb;
		float reverbdepth;
		float reverbfidelity;
		float reverbpts[256];
		float fcut;
		float fres;
		float fhp;
	};
	
	struct gapan_old2params
	{
		float gain;
		float pan;
		bool dist_on;
		int dist_type;
		float dist_amp;
		float reverb;
		float reverbdepth;
		float reverbfidelity;
		float reverbpts[256];
		float fcut;
		float fres;
	};
	
	struct gapan_oldparams
	{
		float gain;
		float pan;
		bool dist_on;
		int dist_type;
		float dist_amp;
		float reverb;
		float reverbdepth;
		float reverbfidelity;
		float reverbpts[256];
	};

	float *delaybuffer_l;
	float *delaybuffer_r;
	float delayoffset_l;
	float delayoffset_r;
	float psl;
	float psr;
	float fy_l, fdy_l;
	float fy_r, fdy_r;
	float hy_l, hps_l;
	float hy_r, hps_r;
	int fltout;
	int delayptr;
	int delaytimeout;
	StereoBufferP dbuffer;

	gapan_params params;
	
	// inertial parameters		
	float target_fcut;
	float target_pan;

public:
	gef_gapan()
	{
//		LogPrint("gef_gapan: init");

		strcpy(name, "gapan");
				
		params.gain=0.5f;
		params.pan=0.5f;
		params.dist_on=false;
		params.dist_type=0;
		params.dist_amp=0.25f;
		params.reverb=0.0f;
		params.reverbdepth=0.5f;
		params.reverbfidelity=0.5f;
		params.fcut=0.0f;
		params.fres=0.0f;
		params.fhp=0.0f;
		GenReverbPts();

		// inertial parameters		
		target_fcut=params.fcut;
		target_pan=params.pan;
		
		delaybuffer_l=NULL;
		delaybuffer_r=NULL;
		delayoffset_l=0.0f;
		delayoffset_r=0.0f;
		psl=0.0f;
		psr=0.0f;
		fy_l=0.0f;
		fdy_l=0.0f;
		fy_r=0.0f;
		fdy_r=0.0f;
		fltout=0;
		hy_l=0.0f;
		hy_r=0.0f;
		hps_l=0.0f;
		hps_r=0.0f;
		delaytimeout=0;
		
		dbuffer.size=0;
		dbuffer.left=NULL;
		dbuffer.right=NULL;
	};

	~gef_gapan()
	{
		free(delaybuffer_l);
		free(delaybuffer_r);
		free(dbuffer.left);
		free(dbuffer.right);
	};

	void GenReverbPts()
	{
		for(int i=0;i<256;i++)
		{
			params.reverbpts[i]=(float)rnd(10000)/10000;
//			LogPrint("reverbpts[%i]=%.4f (-> %i)", i, params.reverbpts[i], (int)(params.reverbpts[i]*(65536*5-105))+100);
		}
	};
	
//	void ProcessBuffer(StereoBufferP *buffer)
	int ProcessBuffer(StereoBufferP *buffer)
	{
		int debug_iterations=0;
		bool triggered=buffer->size>0;

		// inertial parameters
		params.fcut=params.fcut*0.9f+target_fcut*0.1f;
		if(params.fcut<0.001f) params.fcut=0.0f;
		params.pan=params.pan*0.9f+target_pan*0.1f;
		if(fabs(params.pan-0.5f)<0.01f) params.pan=0.5f;
		
//		LogPrint("gapan: buffer->size=%i", buffer->size);
		bool dbout=false;
		if(buffer->size>0 && dbuffer.size==0)
		{
//			LogPrint("gapan: dbuffer alloc (%i)", buffer->size);
			dbuffer.size=buffer->size;
			dbuffer.left=(float*)malloc(dbuffer.size*sizeof(float));
			dbuffer.right=(float*)malloc(dbuffer.size*sizeof(float));
			dbuffer.mono=false;
			dbuffer.undefined=false;
		}
		if(params.reverb>0.0f || fltout<1000)
		{
			if(params.reverb>0.0f && delaybuffer_l==NULL) // no buffer allocated, remedy this
			{
//				LogPrint("gapan: delaybuffer alloc");
				delaybuffer_l=(float*)malloc(65536*sizeof(float));
				delaybuffer_r=(float*)malloc(65536*sizeof(float));
				for(int i=0;i<65536;i++)
				{
					delaybuffer_l[i]=0.0f;
					delaybuffer_r[i]=0.0f;
					debug_iterations++;
				}
				delayptr=0;
			}
			if(buffer->size==0 && dbuffer.size>0) // if input buffer is absent, use internal buffer (needs to generate sound)
			{
				if(delaytimeout>0 || fltout<1000)
				{
					buffer->size=dbuffer.size;
					buffer->left=dbuffer.left;
					buffer->right=dbuffer.right;
//					LogPrint("gapan: reassign and clear %i samples", buffer->size);
					for(int i=0;i<buffer->size;i++)
					{
						buffer->left[i]=0.0f;
						buffer->right[i]=0.0f;
						debug_iterations++;
					}
					delaytimeout-=buffer->size;
				}
			}
			else
				delaytimeout=(int)(params.reverbdepth*(65536-105))+100+buffer->size; // max reverb time caused by this input buffer
		}
		if(buffer->size==0) // silent input, and no lingering effects
		{
			fy_l=0.0f;
			fdy_l=0.0f;
			fy_r=0.0f;
			fdy_r=0.0f;
			hy_l=0.0f;
			hy_r=0.0f;
			hps_l=0.0f;
			hps_r=0.0f;
			return 0;
		}
		if(params.fhp>0.0f)
		{
			float damp=pow(params.fhp, 2.0f)*0.5f;
			for(int i=0;i<buffer->size;i++)
			{
				hy_l+=buffer->left[i]-hps_l;
				hps_l=buffer->left[i];
				hy_l-=hy_l*damp;
				if(hy_l>0.0f && hy_l<0.0001f)
					hy_l=0.0001f;
				if(hy_l<0.0f && hy_l>-0.0001f)
					hy_l=-0.0001f;
				buffer->left[i]=hy_l;
/*				if(!dbout && (hy_l>2.0f || hy_l<-2.0f))
				{
					dbout=true;
					LogPrint("asplode_L!");
				}*/
//				buffer->left[i]=hps_l;
//				buffer->left[i]=0.0f;
//				buffer->left[i]=-buffer->left[i];
				debug_iterations++;
			}
			dbout=false;
			for(int i=0;i<buffer->size;i++)
			{
				hy_r+=buffer->right[i]-hps_r;
				hps_r=buffer->right[i];
				hy_r-=hy_r*damp;
				if(hy_r>0.0f && hy_r<0.0001f)
					hy_r=0.0001f;
				if(hy_r<0.0f && hy_r>-0.0001f)
					hy_r=-0.0001f;
				buffer->right[i]=hy_r;
/*				if(!dbout && (hy_r>2.0f || hy_r<-2.0f))
				{
					dbout=true;
					LogPrint("asplode_R!");
				}*/
//				buffer->right[i]=hps_r;
//				buffer->right[i]=0.0f;
//				buffer->right[i]=-buffer->right[i];
				debug_iterations++;
			}
		}
		else
		{
			hy_l=0.0f;
			hy_r=0.0f;
			hps_l=0.0f;
			hps_r=0.0f;
		}
		if(params.fcut>0.0f)
		{
//			int lout=fltout;
//			int rout=fltout;
			float fp1=3.8f-pow(params.fres, 0.5f)*3.5f;
//			float fp2=1.5f-pow(params.fcut, 0.05f)*1.497f;
			float fp2=0.003f+pow(1.0f-params.fcut, 4.0f)*1.497f;
			float damp=(1.2f-params.fres)*0.05f;
			if(params.fcut<0.3f)
			{
				fp1+=(0.3f-fp1)*(0.3f-params.fcut)/0.3f;
//				damp*=params.fcut/0.3f;
			}
			float blend=1.0f;
			if(params.fcut<0.25f)
				blend=1.0f-pow((0.25f-params.fcut)*4, 2.0f);
			for(int i=0;i<buffer->size;i++)
			{
/*				if(buffer->left[i]==0.0f)
					lout++;
				else
					lout=0;*/
				fdy_l+=(buffer->left[i]-(fy_l+fdy_l*fp1))*fp2;
				fdy_l-=fdy_l*damp;
				if(fdy_l>5.0f) fy_l=5.0f;
				if(fdy_l<-5.0f) fdy_l=-5.0f;
				fy_l+=fdy_l;
				buffer->left[i]+=(fy_l-buffer->left[i])*blend;
				if(buffer->left[i]>0.0f && buffer->left[i]<0.0001f)
					buffer->left[i]=0.0001f;
				if(buffer->left[i]<0.0f && buffer->left[i]>-0.0001f)
					buffer->left[i]=-0.0001f;
				debug_iterations++;
			}
			for(int i=0;i<buffer->size;i++)
			{
/*				if(buffer->right[i]==0.0f)
					rout++;
				else
					rout=0;*/
				fdy_r+=(buffer->right[i]-(fy_r+fdy_r*fp1))*fp2;
				fdy_r-=fdy_r*damp;
				if(fdy_r>5.0f) fy_r=5.0f;
				if(fdy_r<-5.0f) fdy_r=-5.0f;
				fy_r+=fdy_r;
				buffer->right[i]+=(fy_r-buffer->right[i])*blend;
				if(buffer->right[i]>0.0f && buffer->right[i]<0.0001f)
					buffer->right[i]=0.0001f;
				if(buffer->right[i]<0.0f && buffer->right[i]>-0.0001f)
					buffer->right[i]=-0.0001f;
				debug_iterations++;
			}
/*			if(lout<rout)
				fltout=lout;
			else
				fltout=rout;*/
			if(triggered)
				fltout=0;
			else
				fltout+=buffer->size;
		}
		else
		{
			fy_l=0.0f;
			fdy_l=0.0f;
			fy_r=0.0f;
			fdy_r=0.0f;
			fltout=1000;
		}
		if(params.dist_on)
		{
			float damp=pow(params.dist_amp*4.0f, 3.0f);
			// left
			for(int i=0;i<buffer->size;i++)
			{
				buffer->left[i]*=damp;
				if(params.dist_type==0)
				{
					if(buffer->left[i]>1.0f)
						buffer->left[i]=1.0f;
					else if(buffer->left[i]<-1.0f)
						buffer->left[i]=-1.0f;
				}
				if(params.dist_type==1)
					buffer->left[i]=(float)sin(buffer->left[i]);
				if(params.dist_type==2)
				{
					if(buffer->left[i]>1.0f)
					{
						buffer->left[i]=2.0f-buffer->left[i];
						if(buffer->left[i]<-1.0f)
							buffer->left[i]=-1.0f;
					}
					else if(buffer->left[i]<-1.0f)
					{
						buffer->left[i]=-2.0f-buffer->left[i];
						if(buffer->left[i]>1.0f)
							buffer->left[i]=1.0f;
					}
				}
				debug_iterations++;
			}
			if(buffer->mono) // identical channels, copy results
			{
				float *bp=buffer->right;
				float *sp=buffer->left;
				for(int i=0;i<buffer->size;i+=8)
				{
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					debug_iterations++;
				}
			}
			else
			{
				// right
				for(int i=0;i<buffer->size;i++)
				{
					buffer->right[i]*=damp;
					if(params.dist_type==0)
					{
						if(buffer->right[i]>1.0f)
							buffer->right[i]=1.0f;
						else if(buffer->right[i]<-1.0f)
							buffer->right[i]=-1.0f;
					}
					if(params.dist_type==1)
						buffer->right[i]=(float)sin(buffer->right[i]);
					debug_iterations++;
				}
			}
		}

		// reverb
		if(params.reverb>0.0f)
		{
			int rpts[256];
			float rppw[256];
			int ifi=(int)(params.reverbfidelity*240+16);
			// update parameters
			for(int i=0;i<ifi;i++)
			{
				rpts[i]=(int)(params.reverbpts[i]*params.reverbdepth*(65536-105))+100;
				rppw[i]=(0.3f+params.reverbpts[255-i]*0.4f)*exp(-params.reverbpts[i]*3.0f)*200/(ifi+64);
//				debug_iterations++;
			}
/*			int orpos[256];
			for(int d=0;d<ifi;d++)
			{
				orpos[d]=delayptr-rpts[d]; // could be negative
				orpos[d]+=65536;
				orpos[d]&=65536-1;
			}*/
			for(int i=0;i<buffer->size;i++)
			{
				float sample_l=0.0f;
				float sample_r=0.0f;
				delaybuffer_l[delayptr]=(psl+buffer->left[i])*0.5f*params.reverb;
				delaybuffer_r[delayptr]=(psr+buffer->right[i])*0.5f*params.reverb;

				psl=buffer->left[i];
				psr=buffer->right[i];

				if(buffer->mono) // identical channels, compute left only
				{
					for(int d=0;d<ifi;d++)
					{
						int rpos=delayptr-rpts[d]; // could be negative...
						rpos+=65536; // ...so let's keep it positive
						rpos&=65536-1;
						sample_l+=delaybuffer_l[rpos]*rppw[d];
					}
				}
				else
				{
					for(int d=0;d<ifi;d++)
					{
						int rpos=delayptr-rpts[d]; // could be negative...
						rpos+=65536; // ...so let's keep it positive
						rpos&=65536-1;
						sample_l+=delaybuffer_l[rpos]*rppw[d];
						sample_r+=delaybuffer_r[rpos]*rppw[d];
					}
/*					for(int d=0;d<ifi;d++)
					{
						int rpos=delayptr-rpts[d];
						rpos+=65536;
						rpos&=65536-1;
						sample_l+=delaybuffer_l[rpos]*rppw[d];
						sample_r+=delaybuffer_r[rpos]*rppw[d];
						debug_iterations++;
					}*/
				}

				delayoffset_l+=(sample_l-delayoffset_l)*0.001f;
				delayoffset_r+=(sample_r-delayoffset_r)*0.001f;

				buffer->left[i]+=sample_l-delayoffset_l;
				if(!buffer->mono)
					buffer->right[i]+=sample_r-delayoffset_r;

				delayptr++;
				delayptr&=65536-1;
//				debug_iterations++;
			}

			if(buffer->mono) // identical channels, copy results
			{
				float *bp=buffer->right;
				float *sp=buffer->left;
				for(int i=0;i<buffer->size;i+=8)
				{
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
					(*bp++)=*sp++;
//						debug_iterations++;
				}
			}
			
/*			for(int i=0;i<32;i++)
			{
				int p=reverbpts[i];
			}*/
		}

		float span=params.pan;
		if(fabs(span-0.5f)<0.05f)
			span=0.5f;
		float pgain=pow(params.gain*2.0f, 2.0f);
		float gain;
		// left
		gain=(1.0f-span)*2.0f;
		if(gain>1.0f) gain=1.0f;
		gain*=pgain;
		for(int i=0;i<buffer->size;i++)
		{
			buffer->left[i]*=gain;
			debug_iterations++;
		}
		// right
		gain=(span)*2.0f;
		if(gain>1.0f) gain=1.0f;
		gain*=pgain;
		for(int i=0;i<buffer->size;i++)
		{
			buffer->right[i]*=gain;
			debug_iterations++;
		}
		
		return debug_iterations;
	};

	void DoInterface(DUI *dui)
	{
		dui->DrawBar(1, 0, 400, 5, dui->palette[4]);
		dui->DrawBar(1, 25, 400, 5, dui->palette[4]);
		dui->DrawTexturedBar(1, 5, 400, 20, dui->palette[4], dui->brushed_metal, &dui->vglare);
		dui->DrawBox(0, 1, 400, 29, dui->palette[6]);

		dui->DrawText(349, 20, dui->palette[7], "g a p a n");
		dui->DrawText(350, 20, dui->palette[7], "g a p a n");

		dui->DrawText(23, 4, dui->palette[6], "gain");
		dui->DoKnob(5, 2, params.gain, -1, "knob_gain", "final gain");
		dui->DrawText(43, 17, dui->palette[6], "pan");
//		dui->DoKnob(25, 12, params.pan, -1, "knob_pan", "stereo position");
		dui->DoKnob(25, 12, target_pan, -1, "knob_pan", "stereo position");

		dui->DrawBar(66, 1, 1, 29, dui->palette[6]);
		dui->DrawBar(67, 1, 1, 28, dui->palette[7]);
		dui->DrawText(71, 5, dui->palette[4], "FLT");
		dui->DrawText(70, 5, dui->palette[14], "FLT");
		dui->DrawLED(129, 4, 1, params.fcut>0.0f||params.fhp>0.0f);
		dui->DrawText(88, 19, dui->palette[6], "RS");
		dui->DoKnob(70, 12, params.fres, -1, "knob_frs", "low pass filter resonance");
		dui->DrawText(110, 3, dui->palette[6], "HP");
		dui->DoKnob(92, 2, params.fhp, -1, "knob_fhp", "high pass filter frequency (applied before low pass)");
		dui->DrawText(125, 19, dui->palette[6], "LP");
//		dui->DoKnob(107, 12, params.fcut, -1, "knob_fco", "low pass filter frequency");
		dui->DoKnob(107, 12, target_fcut, -1, "knob_fco", "low pass filter frequency");

		dui->DrawBar(139, 1, 1, 29, dui->palette[6]);
		dui->DrawBar(140, 1, 1, 28, dui->palette[7]);
		dui->DrawText(158, 5, dui->palette[14], "dist");
		dui->DrawText(157, 5, dui->palette[6], "dist");
		dui->DrawLED(180-33, 15, 0, params.dist_on);
		if(dui->DoButton(180-23, 15, "btn_dist", "toggle distortion"))
			params.dist_on=!params.dist_on;
		dui->DrawLED(220-33, 1, 0, params.dist_type==0);
		if(dui->DoButton(220-23, 1, "btn_dtype0", "distortion type: clip"))
			params.dist_type=0;
		dui->DrawLED(220-33, 10, 0, params.dist_type==1);
		if(dui->DoButton(220-23, 10, "btn_dtype1", "distortion type: sine"))
			params.dist_type=1;
		dui->DrawLED(220-33, 19, 0, params.dist_type==2);
		if(dui->DoButton(220-23, 19, "btn_dtype2", "distortion type: bounce and clip"))
			params.dist_type=2;
		dui->DrawText(238, 11, dui->palette[6], "amp");
		dui->DoKnob(220, 6, params.dist_amp, -1, "knob_amp", "amplification before applying distortion");
		dui->DrawBar(265, 1, 1, 29, dui->palette[6]);
		dui->DrawBar(266, 1, 1, 28, dui->palette[7]);

		dui->DrawLED(271, 18, 0, params.reverb>0.0f);
		dui->DrawText(298, 8, dui->palette[6], "str");
		dui->DoKnob(280, 3, params.reverb, -1, "knob_rvb", "reverb strength");
		dui->DrawText(335, 8, dui->palette[6], "dpt");
		dui->DoKnob(317, 3, params.reverbdepth, -1, "knob_rvf", "reverb depth");
		dui->DrawText(373, 8, dui->palette[6], "qty");
		dui->DoKnob(355, 3, params.reverbfidelity, -1, "knob_rfi", "reverb quality (and cpu usage)");
		dui->DrawText(283, 19, dui->palette[14], "reverb");
		dui->DrawText(282, 19, dui->palette[6], "reverb");
	};
	
	bool Save(FILE *file)
	{
		kfwrite2(name, 64, 1, file);
		int numbytes=sizeof(gapan_params);
		kfwrite2(&numbytes, 1, sizeof(int), file);
		kfwrite(&params, 1, sizeof(gapan_params), file);
		return true;
	};

	bool Load(FILE *file, int fversion)
	{
//		fread(name, 64, 1, file);
		int numbytes=0;
		kfread2(&numbytes, 1, sizeof(int), file);
		if(fversion<2)
		{
			if(numbytes!=sizeof(gapan_oldparams))
			{
				LogPrint("ERROR: tried to load incompatible version of effect \"%s\"", name);
				ReadAndDiscard(file, numbytes);
				return false;
			}
			kfread(&params, 1, sizeof(gapan_oldparams), file);
			params.fcut=0.0f;
			params.fres=0.0f;
			params.fhp=0.0f;
		}
		else if(fversion<3)
		{
			if(numbytes!=sizeof(gapan_old2params))
			{
				LogPrint("ERROR: tried to load incompatible version of effect \"%s\"", name);
				ReadAndDiscard(file, numbytes);
				return false;
			}
			kfread(&params, 1, sizeof(gapan_old2params), file);
			params.fhp=0.0f;
		}
		else
		{
			if(numbytes!=sizeof(gapan_params))
			{
				LogPrint("ERROR: tried to load incompatible version of effect \"%s\"", name);
				ReadAndDiscard(file, numbytes);
				return false;
			}
			kfread(&params, 1, sizeof(gapan_params), file);
		}
		// inertial parameters
		target_fcut=params.fcut;
		target_pan=params.pan;
		return true;
	};
};

#endif