aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/LV2/src/BussColors4/BussColors4.cpp
blob: 1bcb13a4d3df9c8d6c59ccad7f5a2e842969a18a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "BussColors4.h"
#include <iostream>
#include <lv2wrapper.h>
#include <cmath>

BussColors4::BussColors4(double rate)
    : LV2Plugin(rate)
{
}

void BussColors4::activate()
{
	A = 0.0;
	B = 0.5;
	C = 0.5;
	D = 1.0;

	for (int count = 0; count < 174; count++) {bL[count] = 0; bR[count] = 0;}
	for (int count = 0; count < 99; count++) {dL[count] = 0; dR[count] = 0;}
	for (int count = 0; count < 34; count++) c[count] = count; //initial setup for 44.1K
	g[1] = pow(10.0, -5.2 / 14.0); //dark
	g[2] = pow(10.0, -6.2 / 14.0); //rock
	g[3] = pow(10.0, -2.9 / 14.0); //lush
	g[4] = pow(10.0, -1.1 / 14.0); //vibe
	g[5] = pow(10.0, -5.1 / 14.0); //holo
	g[6] = pow(10.0, -3.6 / 14.0); //punch
	g[7] = pow(10.0, -2.3 / 14.0); //steel
	g[8] = pow(10.0, -2.9 / 14.0); //tube
	//preset gains for models
	outg[1] = pow(10.0, -0.3 / 14.0); //dark
	outg[2] = pow(10.0, 0.5 / 14.0); //rock
	outg[3] = pow(10.0, -0.7 / 14.0); //lush
	outg[4] = pow(10.0, -0.6 / 14.0); //vibe
	outg[5] = pow(10.0, -0.2 / 14.0); //holo
	outg[6] = pow(10.0, 0.3 / 14.0); //punch
	outg[7] = pow(10.0, 0.1 / 14.0); //steel
	outg[8] = pow(10.0, 0.9 / 14.0); //tube
	//preset gains for models
	controlL = 0;
	controlR = 0;
	slowdynL = 0;
	slowdynR = 0;
	gcount = 0;

	fpNShapeL = 0.0;
	fpNShapeR = 0.0;
	//this is reset: values being initialized only once. Startup values, whatever they are.

}

void BussColors4::run(uint32_t num_samples)
{
    A = *params[0];
    B = *params[1];
    C = *params[2];
    D = *params[3];

    processReplacing(const_cast<float **>(in), out, num_samples);
}

//
// Include the processing code from the VST version.
//
#include <cmath>
#include "../../../LinuxVST/src/BussColors4/BussColors4Proc.cpp"

// Create the LV2Wrapper and register the plugin
LV2Wrapper<BussColors4> plugin;