|
1 | 1 | #ifndef __StompBox_h__ |
2 | 2 | #define __StompBox_h__ |
3 | 3 |
|
4 | | -#include "basicmaths.h" |
5 | | -#include "FloatArray.h" |
6 | | -#include "PatchParameter.h" |
7 | | -#include "SmoothValue.h" |
8 | | - |
9 | | -enum PatchParameterId { |
10 | | - PARAMETER_A, |
11 | | - PARAMETER_B, |
12 | | - PARAMETER_C, |
13 | | - PARAMETER_D, |
14 | | - PARAMETER_E, |
15 | | - PARAMETER_F, |
16 | | - PARAMETER_G, |
17 | | - PARAMETER_H, |
18 | | - |
19 | | - PARAMETER_AA, |
20 | | - PARAMETER_AB, |
21 | | - PARAMETER_AC, |
22 | | - PARAMETER_AD, |
23 | | - PARAMETER_AE, |
24 | | - PARAMETER_AF, |
25 | | - PARAMETER_AG, |
26 | | - PARAMETER_AH, |
27 | | - |
28 | | - PARAMETER_BA, |
29 | | - PARAMETER_BB, |
30 | | - PARAMETER_BC, |
31 | | - PARAMETER_BD, |
32 | | - PARAMETER_BE, |
33 | | - PARAMETER_BF, |
34 | | - PARAMETER_BG, |
35 | | - PARAMETER_BH, |
36 | | - |
37 | | - PARAMETER_CA, |
38 | | - PARAMETER_CB, |
39 | | - PARAMETER_CC, |
40 | | - PARAMETER_CD, |
41 | | - PARAMETER_CE, |
42 | | - PARAMETER_CF, |
43 | | - PARAMETER_CG, |
44 | | - PARAMETER_CH |
45 | | -}; |
46 | | - |
47 | | -enum PatchButtonId { |
48 | | - BYPASS_BUTTON = 0, |
49 | | - PUSHBUTTON, |
50 | | - GREEN_BUTTON, |
51 | | - RED_BUTTON, |
52 | | - MIDI_NOTE_BUTTON = 0x80 // values over 127 are mapped to note numbers |
53 | | -}; |
54 | | - |
55 | | -enum PatchChannelId { |
56 | | - LEFT_CHANNEL = 0, |
57 | | - RIGHT_CHANNEL = 1 |
58 | | -}; |
59 | | - |
60 | | -class AudioBuffer { |
61 | | -public: |
62 | | - virtual ~AudioBuffer(); |
63 | | - virtual FloatArray getSamples(int channel) = 0; |
64 | | - virtual int getChannels() = 0; |
65 | | - virtual int getSize() = 0; |
66 | | - virtual void clear() = 0; |
67 | | - static AudioBuffer* create(int channels, int samples); |
68 | | -}; |
69 | | - |
70 | | -class Patch { |
71 | | -public: |
72 | | - Patch(); |
73 | | - virtual ~Patch(); |
74 | | - /** constant skew values for exponential, linear and logarithmic parameters */ |
75 | | - static const float EXP; |
76 | | - static const float LIN; |
77 | | - static const float LOG; |
78 | | - static const uint16_t ON; |
79 | | - static const uint16_t OFF; |
80 | | - /* Get a float or int parameter with optional smoothing, hysteresis and exponentiation. |
81 | | - * The parameter value will be scaled to the range given by min and max. |
82 | | - * Lambda specifies smoothing factor 0 to 1.0, or 0.0 for no smoothing (default). |
83 | | - * Delta specifies hysteresis, or stiffness, as the absolute value change required to update the parameter, or 0.0 for no hysteresis (default). |
84 | | - * Skew specifies exponentiation: > 1.0 for logarithmic, < 1.0 for exponential, or 1.0 for linear scaling (default). |
85 | | - */ |
86 | | - FloatParameter getParameter(const char* name, float defaultValue); |
87 | | - FloatParameter getFloatParameter(const char* name, float min, float max, float defaultValue=0.0f, float lambda=0.0f, float delta=0.0, float skew=LIN); |
88 | | - IntParameter getIntParameter(const char* name, int min, int max, int defaultValue=0, float lambda=0.0f, float delta=0.0, float skew=LIN); |
89 | | - void registerParameter(PatchParameterId pid, const char* name); |
90 | | - float getParameterValue(PatchParameterId pid); |
91 | | - void setParameterValue(PatchParameterId pid, float value); |
92 | | - bool isButtonPressed(PatchButtonId bid); |
93 | | - /** @deprecated */ |
94 | | - int getSamplesSinceButtonPressed(PatchButtonId bid); |
95 | | - void setButton(PatchButtonId bid, uint16_t value, uint16_t samples=0); |
96 | | - int getBlockSize(); |
97 | | - float getSampleRate(); |
98 | | - AudioBuffer* createMemoryBuffer(int channels, int samples); |
99 | | - float getElapsedBlockTime(); |
100 | | - int getElapsedCycles(); |
101 | | - virtual void encoderChanged(PatchParameterId pid, int16_t delta, uint16_t samples){}; |
102 | | - virtual void buttonChanged(PatchButtonId bid, uint16_t value, uint16_t samples){} |
103 | | - /* virtual void parameterChanged(PatchParameterId pid, float value, int samples){} */ |
104 | | - virtual void processAudio(AudioBuffer& output) = 0; |
105 | | -}; |
| 4 | +#warning The file StompBox.h is deprecated, please use Patch.h instead |
| 5 | +#include "Patch.h" |
106 | 6 |
|
107 | 7 | #endif // __StompBox_h__ |
0 commit comments