cAudio  2.3.0
3d Audio Engine
IEffectParameters.h
1 // Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
2 // This file is part of the "cAudio Engine"
3 // For conditions of distribution and use, see copyright notice in cAudio.h
4 
5 #pragma once
6 
7 #include "cVector3.h"
8 #include "cAudioDefines.h"
9 
10 #if CAUDIO_EFX_ENABLED == 1
11 
12 namespace cAudio
13 {
15  struct sEAXReverbParameters
16  {
17  sEAXReverbParameters(
18  float density = 1.0f,
19  float diffusion = 1.0f,
20  float gain = 0.32f,
21  float gainHF = 0.89f,
22  float gainLF = 0.0f,
23  float decayTime = 1.49f,
24  float decayHFRatio = 0.83f,
25  float decayLFRatio = 1.0f,
26  float reflectionsGain = 0.05f,
27  float reflectionsDelay = 0.007f,
28  cVector3 reflectionsPan = cVector3(0.0f, 0.0f, 0.0f),
29  float lateReverbGain = 1.26f,
30  float lateReverbDelay = 0.011f,
31  cVector3 lateReverbPan = cVector3(0.0f, 0.0f, 0.0f),
32  float echoTime = 0.25f,
33  float echoDepth = 0.0f,
34  float modulationTime = 0.25f,
35  float modulationDepth = 0.0f,
36  float airAbsorptionGainHF = 0.994f,
37  float hFReference = 5000.0f,
38  float lFReference = 250.0f,
39  float roomRolloffFactor = 0.0f,
40  bool decayHFLimit = true) :
41  Density(density), Diffusion(diffusion), Gain(gain), GainHF(gainHF), GainLF(gainLF),
42  DecayTime(decayTime), DecayHFRatio(decayHFRatio), DecayLFRatio(decayLFRatio),
43  ReflectionsGain(reflectionsGain), ReflectionsDelay(reflectionsDelay),
44  ReflectionsPan(reflectionsPan), LateReverbGain(lateReverbGain),
45  LateReverbDelay(lateReverbDelay), LateReverbPan(lateReverbPan),
46  EchoTime(echoTime), EchoDepth(echoDepth),ModulationTime(modulationTime),
47  ModulationDepth(modulationDepth), AirAbsorptionGainHF(airAbsorptionGainHF),
48  HFReference(hFReference), LFReference(lFReference),
49  RoomRolloffFactor(roomRolloffFactor), DecayHFLimit(decayHFLimit) { }
50 
54  float Density;
55 
61  float Diffusion;
62 
69  float Gain;
70 
77  float GainHF;
78 
85  float GainLF;
86 
90  float DecayTime;
91 
100  float DecayHFRatio;
101 
110  float DecayLFRatio;
111 
118  float ReflectionsGain;
119 
125  float ReflectionsDelay;
126 
140  cVector3 ReflectionsPan;
141 
147  float LateReverbGain;
148 
153  float LateReverbDelay;
154 
159  cVector3 LateReverbPan;
160 
166  float EchoTime;
167 
178  float EchoDepth;
179 
184  float ModulationTime;
185 
190  float ModulationDepth;
191 
200  float AirAbsorptionGainHF;
201 
210  float HFReference;
211 
214  float LFReference;
215 
230  float RoomRolloffFactor;
231 
239  bool DecayHFLimit;
240  };
241 
243  struct sReverbParameters
244  {
245  sReverbParameters(
246  float density = 1.0f,
247  float diffusion = 1.0f,
248  float gain = 0.32f,
249  float gainHF = 0.89f,
250  float decayTime = 1.49f,
251  float decayHFRatio = 0.83f,
252  float reflectionsGain = 0.05f,
253  float reflectionsDelay = 0.007f,
254  float lateReverbGain = 1.26f,
255  float lateReverbDelay = 0.011f,
256  float airAbsorptionGainHF = 0.994f,
257  float roomRolloffFactor = 0.0f,
258  bool decayHFLimit = true) :
259  Density(density), Diffusion(diffusion), Gain(gain), GainHF(gainHF),
260  DecayTime(decayTime), DecayHFRatio(decayHFRatio),
261  ReflectionsGain(reflectionsGain), ReflectionsDelay(reflectionsDelay),
262  LateReverbGain(lateReverbGain), LateReverbDelay(lateReverbDelay),
263  AirAbsorptionGainHF(airAbsorptionGainHF), RoomRolloffFactor(roomRolloffFactor),
264  DecayHFLimit(decayHFLimit) { }
265 
269  float Density;
270 
276  float Diffusion;
277 
284  float Gain;
285 
291  float GainHF;
292 
296  float DecayTime;
297 
306  float DecayHFRatio;
307 
315  float ReflectionsGain;
316 
322  float ReflectionsDelay;
323 
329  float LateReverbGain;
330 
335  float LateReverbDelay;
336 
345  float AirAbsorptionGainHF;
346 
361  float RoomRolloffFactor;
362 
370  bool DecayHFLimit;
371  };
372 
374  struct sChorusParameters
375  {
376  enum ChorusWaveform
377  {
378  ECW_SINUSOID,
379  ECW_TRIANGLE,
380  ECW_COUNT
381  };
382  sChorusParameters(
383  ChorusWaveform waveform = ECW_TRIANGLE,
384  int phase = 90,
385  float rate = 1.1f,
386  float depth = 0.1f,
387  float feedback = 0.25f,
388  float delay = 0.016f) :
389  Waveform(waveform), Phase(phase), Rate(rate), Depth(depth), Feedback(feedback),
390  Delay(delay) { }
391 
393  ChorusWaveform Waveform;
394 
399  int Phase;
400 
403  float Rate;
404 
407  float Depth;
408 
414  float Feedback;
415 
421  float Delay;
422  };
423 
425  struct sDistortionParameters
426  {
427  sDistortionParameters(
428  float edge = 0.2f,
429  float gain = 0.05f,
430  float lowpassCutoff = 8000.0f,
431  float eqCenter = 3600.0f,
432  float eqBandwidth = 3600.0f) :
433  Edge(edge), Gain(gain), LowpassCutoff(lowpassCutoff), EqCenter(eqCenter),
434  EqBandwidth(eqBandwidth) { }
435 
438  float Edge;
439 
442  float Gain;
443 
446  float LowpassCutoff;
447 
450  float EqCenter;
451 
454  float EqBandwidth;
455  };
456 
458  struct sEchoParameters
459  {
460  sEchoParameters(
461  float delay = 0.1f,
462  float lRDelay = 0.1f,
463  float damping = 0.5f,
464  float feedback = 0.5f,
465  float spread = -1.0f) :
466  Delay(delay), LRDelay(lRDelay), Damping(damping), Feedback(feedback),
467  Spread(spread) { }
468 
471  float Delay;
472 
475  float LRDelay;
476 
481  float Damping;
482 
487  float Feedback;
488 
493  float Spread;
494  };
495 
497  struct sFlangerParameters
498  {
499  enum FlangerWaveform
500  {
501  EFW_SINUSOID,
502  EFW_TRIANGLE,
503  EFW_COUNT
504  };
505  sFlangerParameters(
506  FlangerWaveform waveform = EFW_TRIANGLE,
507  int phase = 0,
508  float rate = 0.27f,
509  float depth = 1.0f,
510  float feedback = -0.5f,
511  float delay = 0.002f) :
512  Waveform(waveform), Phase(phase), Rate(rate), Depth(depth), Feedback(feedback),
513  Delay(delay) { }
514 
516  FlangerWaveform Waveform;
517 
520  int Phase;
521 
524  float Rate;
525 
528  float Depth;
529 
535  float Feedback;
536 
539  float Delay;
540  };
541 
543  struct sFrequencyShiftParameters
544  {
545  enum ShiftDirection
546  {
547  ESD_DOWN,
548  ESD_UP,
549  ESD_OFF,
550  ESD_COUNT
551  };
552  sFrequencyShiftParameters(
553  float frequency = 0.0f,
554  ShiftDirection left = ESD_DOWN,
555  ShiftDirection right = ESD_DOWN) :
556  Frequency(frequency), Left(left), Right(right) { }
557 
563  float Frequency;
564 
567  ShiftDirection Left;
568 
571  ShiftDirection Right;
572  };
573 
575  struct sVocalMorpherParameters
576  {
577  enum MorpherPhoneme
578  {
579  EMP_A,
580  EMP_E,
581  EMP_I,
582  EMP_O,
583  EMP_U,
584  EMP_AA,
585  EMP_AE,
586  EMP_AH,
587  EMP_AO,
588  EMP_EH,
589  EMP_ER,
590  EMP_IH,
591  EMP_IY,
592  EMP_UH,
593  EMP_UW,
594  EMP_B,
595  EMP_D,
596  EMP_F,
597  EMP_G,
598  EMP_J,
599  EMP_K,
600  EMP_L,
601  EMP_M,
602  EMP_N,
603  EMP_P,
604  EMP_R,
605  EMP_S,
606  EMP_T,
607  EMP_V,
608  EMP_Z,
609  ESD_COUNT
610  };
611 
612  enum MorpherWaveform
613  {
614  EMW_SINUSOID,
615  EMW_TRIANGLE,
616  EMW_SAW,
617  EMW_COUNT
618  };
619  sVocalMorpherParameters(
620  MorpherPhoneme phonemeA = EMP_A,
621  MorpherPhoneme phonemeB = EMP_ER,
622  int phonemeACoarseTune = 0,
623  int phonemeBCoarseTune = 0,
624  MorpherWaveform waveform = EMW_SINUSOID,
625  float rate = 1.41f) :
626  PhonemeA(phonemeA), PhonemeB(phonemeB), PhonemeACoarseTune(phonemeACoarseTune),
627  PhonemeBCoarseTune(phonemeBCoarseTune), Waveform(waveform), Rate(rate) { }
628 
632  MorpherPhoneme PhonemeA;
633 
637  MorpherPhoneme PhonemeB;
638 
641  int PhonemeACoarseTune;
642 
645  int PhonemeBCoarseTune;
646 
648  MorpherWaveform Waveform;
649 
652  float Rate;
653  };
654 
656  struct sPitchShifterParameters
657  {
658  sPitchShifterParameters(
659  int coarseTune = 12,
660  int fineTune = 0) :
661  CoarseTune(coarseTune), FineTune(fineTune) { }
662 
667  int CoarseTune;
668 
673  int FineTune;
674  };
675 
677  struct sRingModulatorParameters
678  {
679  enum ModulatorWaveform
680  {
681  EMW_SINUSOID,
682  EMW_SAW,
683  EMW_SQUARE,
684  EMW_COUNT
685  };
686  sRingModulatorParameters(
687  float frequency = 440.0f,
688  float highPassCutoff = 800.0f,
689  ModulatorWaveform waveform = EMW_SINUSOID) :
690  Frequency(frequency), HighPassCutoff(highPassCutoff), Waveform(waveform) { }
691 
697  float Frequency;
698 
704  float HighPassCutoff;
705 
709  ModulatorWaveform Waveform;
710  };
711 
713  struct sAutowahParameters
714  {
715  sAutowahParameters(
716  float attackTime = 0.06f,
717  float releaseTime = 0.06f,
718  float resonance = 1000.0f,
719  float peakGain = 11.22f) :
720  AttackTime(attackTime), ReleaseTime(releaseTime), Resonance(resonance),
721  PeakGain(peakGain) { }
722 
725  float AttackTime;
726 
729  float ReleaseTime;
730 
736  float Resonance;
737 
740  float PeakGain;
741  };
742 
744  struct sCompressorParameters
745  {
746  sCompressorParameters(
747  bool active = true) :
748  Active(active) { }
749 
751  bool Active;
752  };
753 
755  struct sEqualizerParameters
756  {
757  sEqualizerParameters(
758  float lowGain = 1.0f,
759  float lowCutoff = 200.0f,
760  float mid1Gain = 1.0f,
761  float mid1Center = 500.0f,
762  float mid1Width = 1.0f,
763  float mid2Gain = 1.0f,
764  float mid2Center = 3000.0f,
765  float mid2Width = 1.0f,
766  float highGain = 1.0f,
767  float highCutoff = 6000.0f) :
768  LowGain(lowGain), LowCutoff(lowCutoff), Mid1Gain(mid1Gain),
769  Mid1Center(mid1Center), Mid1Width(mid1Width), Mid2Gain(mid2Gain),
770  Mid2Center(mid2Center), Mid2Width(mid2Width), HighGain(highGain),
771  HighCutoff(highCutoff) { }
772 
775  float LowGain;
776 
779  float LowCutoff;
780 
783  float Mid1Gain;
784 
787  float Mid1Center;
788 
791  float Mid1Width;
792 
795  float Mid2Gain;
796 
799  float Mid2Center;
800 
803  float Mid2Width;
804 
807  float HighGain;
808 
811  float HighCutoff;
812  };
813 };
814 
815 #endif
cAudio
Main namespace for the entire cAudio library.
Definition: cAudioCapture.h:16