1 /*
2   Copyright 2008-2011 David Robillard <http://drobilla.net>
3   Copyright 1999-2000 Paul Kellett (Maxim Digital Audio)
4 
5   This is free software: you can redistribute it and/or modify it
6   under the terms of the GNU General Public License as published by
7   the Free Software Foundation, either version 3 of the License,
8   or (at your option) any later version.
9 
10   This software is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   See the GNU General Public License for more details.
14 
15   You should have received a copy of the GNU General Public License
16   along with this software. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #define NPARAMS  4  ///number of parameters
20 #define NPROGS   3  ///number of programs
21 #define BUFMAX   4096
22 
23 #ifndef __mdaDetune_H
24 #define __mdaDetune_H
25 
26 #include "audioeffectx.h"
27 
28 #include <cstdint>
29 
30 struct mdaDetuneProgram
31 {
32   friend class mdaDetune;
33   float param[NPARAMS];
34   char name[32];
35 };
36 
37 
38 class mdaDetune : public AudioEffectX
39 {
40 public:
41   mdaDetune(audioMasterCallback audioMaster);
42 
43   virtual void  process(float **inputs, float **outputs, int32_t sampleFrames);
44   virtual void  processReplacing(float **inputs, float **outputs, int32_t sampleFrames);
45   virtual void  setProgram(int32_t program);
46   virtual void  setProgramName(char *name);
47   virtual void  getProgramName(char *name);
48   virtual bool getProgramNameIndexed (int32_t category, int32_t index, char* name);
49   virtual void  setParameter(int32_t index, float value);
50   virtual float getParameter(int32_t index);
51   virtual void  getParameterLabel(int32_t index, char *label);
52   virtual void  getParameterDisplay(int32_t index, char *text);
53   virtual void  getParameterName(int32_t index, char *text);
54   virtual void  suspend();
55 
56 	virtual bool getEffectName(char *name);
57 	virtual bool getVendorString(char *text);
58 	virtual bool getProductString(char *text);
getVendorVersion()59 	virtual int32_t getVendorVersion() { return 1000; }
60 
61 protected:
62 	mdaDetuneProgram programs[NPROGS];
63 	float buf[BUFMAX];
64 	float win[BUFMAX];
65 
66   ///global internal variables
67   int32_t  buflen;           //buffer length
68   float bufres;           //buffer resolution display
69   float semi;             //detune display
70   int32_t  pos0;             //buffer input
71   float pos1, dpos1;      //buffer output, rate
72   float pos2, dpos2;      //downwards shift
73   float wet, dry;         //ouput levels
74 };
75 
76 #endif
77