diffuse.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 1983-2013 Richard Dobson and Composers Desktop Project Ltd
  3. * http://people.bath.ac.uk/masrwd
  4. * http://www.composersdesktop.com
  5. * This file is part of the CDP System.
  6. * The CDP System is free software; you can redistribute it
  7. * and/or modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * The CDP System is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. * See the GNU Lesser General Public License for more details.
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with the CDP System; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. */
  20. //diffuse.h
  21. //definition of classes for small, meduim large dense reverberators
  22. // based on gardner, using nested allpasses
  23. #ifndef __DIFFUSE_INCLUDED__
  24. #define __DIFFUSE_INCLUDED__
  25. #include "reverberator.h"
  26. #include "tapdelay.h"
  27. typedef struct nested_allpass_data{
  28. unsigned int time1;
  29. unsigned int time2;
  30. unsigned int time3;
  31. double gain1;
  32. double gain2;
  33. double gain3;
  34. }
  35. NESTDATA;
  36. class small_diffuser {
  37. public:
  38. small_diffuser(unsigned int pre_delay,
  39. const NESTDATA *apdata1,
  40. const NESTDATA *apdata2,double lp_gain,double lp_coeff);
  41. virtual ~small_diffuser();
  42. bool create(void);
  43. float tick(float insam);
  44. //void clear(void);
  45. private:
  46. NESTDATA ap1_data,ap2_data;
  47. nested_allpass *ap1,*ap2;
  48. delay *predelay;
  49. lowpass1 *lp1;
  50. unsigned int predelay_time;
  51. double lpgain,lpcoeff;
  52. float out1,out2;
  53. };
  54. #endif