HenriAugusto

4ch mixer

Nov 13th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.81 KB | None | 0 0
  1. //===================================================================================================
  2. //===================================================================================================
  3. //===================================================================================================
  4. //This is a modificatin of a software by Philip S. Considine. The license is the same as the original,
  5. //which is displayed below:
  6. //===================================================================================================
  7. //===================================================================================================
  8. //===================================================================================================
  9.  
  10. /*******************************************************************************
  11. *  Copyright 2007 - 2011, Philip S. Considine                                  *
  12. *  This program is free software: you can redistribute it and/or modify        *
  13. *  it under the terms of the GNU General Public License as published by        *
  14. *  the Free Software Foundation, either version 3 of the License, or           *
  15. *  (at your option) any later version.                                         *
  16. *                                                                              *
  17. *  This program is distributed in the hope that it will be useful,             *
  18. *  but WITHOUT ANY WARRANTY; without even the implied warranty of              *
  19. *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                *
  20. *  GNU General Public License (http://www.gnu.org/licenses/)for more details.  *
  21. *******************************************************************************/
  22.  
  23. desc:8x Stereo to 1x Stereo Mixer
  24. desc:8x Stereo to 1x Stereo Mixer [IXix]
  25. //tags: mixer gain
  26. //author: IXix
  27.  
  28. slider1:0<-60,30,0.1>Level 1 (dB)
  29. slider2:0<-60,30,0.1>Level 2 (dB)
  30. slider3:0<-60,30,0.1>Level 3 (dB)
  31. slider4:0<-60,30,0.1>Level 4 (dB)
  32.  
  33.  
  34. in_pin:input 1
  35. in_pin:input 2
  36. in_pin:input 3
  37. in_pin:input 4
  38. out_pin:output 1
  39. out_pin:output 2
  40. out_pin:output 3
  41. out_pin:output 4
  42. ///////////////////////////////////////////////////////////////////////////////
  43. @init
  44. gainMin = -60;
  45. gainMax = 30;
  46.  
  47. ///////////////////////////////////////////////////////////////////////////////
  48. @slider
  49. slider1 = min(max(slider1, gainMin), gainMax);
  50. slider2 = min(max(slider2, gainMin), gainMax);
  51. slider3 = min(max(slider3, gainMin), gainMax);
  52. slider4 = min(max(slider4, gainMin), gainMax);
  53.  
  54. levelA = 2 ^ (slider1 / 6);
  55. levelB = 2 ^ (slider2 / 6);
  56. levelC = 2 ^ (slider3 / 6);
  57. levelD = 2 ^ (slider4 / 6);
  58.  
  59. ///////////////////////////////////////////////////////////////////////////////
  60. @sample
  61. // Do the left mix
  62.  
  63.  
  64. spl0 =  (spl0 * levelA);
  65. spl1 =  (spl1 * levelB);
  66. spl2 =  (spl2 * levelC);
  67. spl3 =  (spl3 * levelD);
Advertisement
Add Comment
Please, Sign In to add comment