clean up a bit

This commit is contained in:
Gordon JC Pearce 2024-09-03 16:17:32 +01:00
parent 39f0c79484
commit fbdbc998b9
6 changed files with 19 additions and 24 deletions

View File

@ -1,5 +1,5 @@
/* /*
BarrVerb reverb plugin Chassis polysynth framework
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net> Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>
@ -16,7 +16,6 @@
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#ifndef DISTRHO_PLUGIN_INFO_H #ifndef DISTRHO_PLUGIN_INFO_H
#define DISTRHO_PLUGIN_INFO_H #define DISTRHO_PLUGIN_INFO_H
@ -30,10 +29,9 @@
#define DISTRHO_PLUGIN_WANT_PROGRAMS 0 #define DISTRHO_PLUGIN_WANT_PROGRAMS 0
enum Parameters { enum Parameters {
paramProg, paramProg,
kParameterCount kParameterCount
}; };
#endif #endif

View File

@ -1,6 +1,6 @@
############################### ###############################
# #
# Makefile for BarrChassis # Makefile for Chassis
# based on the work of falkTX, in the DPF example plugins # based on the work of falkTX, in the DPF example plugins
# #
# for full licence, see LICENCE in the root of the project # for full licence, see LICENCE in the root of the project

View File

@ -1,5 +1,5 @@
/* /*
Chassis softsynth framework Chassis polysynth framework
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net> Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>
@ -25,8 +25,8 @@ Chassis::Chassis() : Plugin(kParameterCount, 0, 0) { // one parameter, no progr
// Initialisation functions // Initialisation functions
//void Chassis::initParameter(uint32_t index, Parameter &parameter) { // void Chassis::initParameter(uint32_t index, Parameter &parameter) {
//} // }
/* /*
void Chassis::setParameterValue(uint32_t index, float value) { void Chassis::setParameterValue(uint32_t index, float value) {

View File

@ -1,5 +1,5 @@
/* /*
Chassis softsynth framework Chassis polysynth framework
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net> Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>
@ -46,10 +46,10 @@ class Chassis : public Plugin {
// Initialisation // Initialisation
void initAudioPort(bool input, uint32_t index, AudioPort &port) override; void initAudioPort(bool input, uint32_t index, AudioPort &port) override;
//void initParameter(uint32_t index, Parameter &parameter) override; // void initParameter(uint32_t index, Parameter &parameter) override;
//void setParameterValue(uint32_t index, float value) override; // void setParameterValue(uint32_t index, float value) override;
//float getParameterValue(uint32_t index) const override; // float getParameterValue(uint32_t index) const override;
// void initProgramName(uint32_t index, String &programName) override; // void initProgramName(uint32_t index, String &programName) override;
// void loadProgram(uint32_t index) override; // void loadProgram(uint32_t index) override;

View File

@ -1,5 +1,5 @@
/* /*
Chassis softsynth framework Chassis polysynth framework
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net> Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>
@ -16,15 +16,14 @@
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
#include <math.h>
#include "voice.hpp" #include "voice.hpp"
#include <math.h>
static float blep(float phase, float theta) { static float blep(float phase, float theta) {
float t; float t;
if (phase < theta) { if (phase < theta) {
t = phase / theta; t = phase / theta;
return (2 * t) - (t * t) - 1; return (2 * t) - (t * t) - 1;
} }
@ -36,8 +35,6 @@ static float blep(float phase, float theta) {
return 0; return 0;
} }
bool Voice::isFree() { bool Voice::isFree() {
return keyState == K_OFF; return keyState == K_OFF;
} }
@ -58,14 +55,14 @@ void Voice::off() {
} }
void Voice::run(float *buffer, uint32_t samples) { void Voice::run(float *buffer, uint32_t samples) {
float y; float y;
env = ((target - env) * 0.01) + env; env = ((target - env) * 0.01) + env;
for (uint32_t i = 0; i < samples; i++) { for (uint32_t i = 0; i < samples; i++) {
phase += omega; phase += omega;
if (phase > 1) phase -= 1; if (phase > 1) phase -= 1;
y = (2*phase)-1; y = (2 * phase) - 1;
y-=blep(phase,omega); y -= blep(phase, omega);
buffer[i] += 0.25*y * env; buffer[i] += 0.25 * y * env;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
Chassis softsynth framework Chassis polysynth framework
Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net> Copyright 2024 Gordon JC Pearce <gordonjcp@gjcp.net>