1 #pragma once 2 #include "StringMachineShared.hpp" 3 #include "StringSynth.h" 4 #include "dsp/AmpFollower.h" 5 6 class StringMachinePlugin : public Plugin { 7 public: 8 StringMachinePlugin(); 9 ~StringMachinePlugin(); 10 11 const char *getLabel() const override; 12 const char *getMaker() const override; 13 const char *getLicense() const override; 14 const char *getDescription() const override; 15 const char *getHomePage() const override; 16 uint32_t getVersion() const override; 17 int64_t getUniqueId() const override; 18 19 void initParameter(uint32_t index, Parameter ¶meter) override; 20 float getParameterValue(uint32_t index) const override; 21 void setParameterValue(uint32_t index, float value) override; 22 23 void initProgramName(uint32_t index, String &programName); 24 void loadProgram(uint32_t index); 25 26 void run(const float **inputs, float **outputs, uint32_t frames, 27 const MidiEvent *midiEvents, uint32_t midiEventCount) override; 28 29 // getLastDetuneUpper() const30 float getLastDetuneUpper() const { return fSynth.getLastDetuneUpper(); } getLastDetuneLower() const31 float getLastDetuneLower() const { return fSynth.getLastDetuneLower(); } 32 getChorusPhase1() const33 float getChorusPhase1() const { return fSynth.getChorus().getPhase1(); } getChorusPhase2() const34 float getChorusPhase2() const { return fSynth.getChorus().getPhase2(); } 35 getLeftOutputLevel() const36 double getLeftOutputLevel() const { return fOutputLevelFollower[0].last_output(); } getRightOutputLevel() const37 double getRightOutputLevel() const { return fOutputLevelFollower[1].last_output(); } 38 39 private: 40 StringSynth fSynth; 41 AmpFollower fOutputLevelFollower[2]; 42 }; 43