| 1 |
/* |
| 2 |
* Dragonfly Reverb, a hall-style reverb plugin |
| 3 |
* Copyright (c) 2018 Michael Willis, Rob van den Berg |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU General Public License as |
| 7 |
* published by the Free Software Foundation; either version 3 of |
| 8 |
* the License, or any later version. |
| 9 |
* |
| 10 |
* This program 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. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* For a full copy of the GNU General Public License see the LICENSE file. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef DRAGONFLY_REVERB_DSP_HPP_INCLUDED |
| 19 |
#define DRAGONFLY_REVERB_DSP_HPP_INCLUDED |
| 20 |
|
| 21 |
#include "AbstractDSP.hpp" |
| 22 |
#include "freeverb/earlyref.hpp" |
| 23 |
#include "freeverb/zrev2.hpp" |
| 24 |
|
| 25 |
class DragonflyReverbDSP : public AbstractDSP { |
| 26 |
public: |
| 27 |
DragonflyReverbDSP(double sampleRate); |
| 28 |
float getParameterValue(uint32_t index) const; |
| 29 |
void setParameterValue(uint32_t index, float value); |
| 30 |
void run(const float** inputs, float** outputs, uint32_t frames); |
| 31 |
void sampleRateChanged(double newSampleRate); |
| 32 |
void mute(); |
| 33 |
|
| 34 |
private: |
| 35 |
float oldParams[paramCount]; |
| 36 |
float newParams[paramCount]; |
| 37 |
|
| 38 |
float dryLevel = 0.0; |
| 39 |
float earlyLevel = 0.0; |
| 40 |
float early_send = 0.0; |
| 41 |
float lateLevel = 0.0; |
| 42 |
|
| 43 |
fv3::earlyref_f early; |
| 44 |
fv3::zrev2_f late; |
| 45 |
|
| 46 |
static const uint32_t BUFFER_SIZE = 256; |
| 47 |
float early_out_buffer[2][BUFFER_SIZE]; |
| 48 |
float late_in_buffer[2][BUFFER_SIZE]; |
| 49 |
float late_out_buffer[2][BUFFER_SIZE]; |
| 50 |
}; |
| 51 |
|
| 52 |
#endif |