Skip to content

Commit

Permalink
edits for 040
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniograzioli committed Oct 22, 2017
1 parent 0e12916 commit fdb3fc2
Show file tree
Hide file tree
Showing 22 changed files with 177 additions and 2,402 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added Archivio.zip
Binary file not shown.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ SOURCES = $(wildcard src/*.cpp)

include ../../plugin.mk

include ../../plugin.mk


dist: all
mkdir -p dist/Autodafe
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Autodafe Module Pack for VCV Rack

Autodafe Module Pack for VCV rack contains 11 modules:
Autodafe Module Pack for VCV rack contains 13 modules:

LFO module with CV Input

Expand All @@ -14,11 +14,15 @@ Clock Divider

Fixed Filter Bank

Formant Filter

Multimode Filter

Foldback distortion

Bitcrusher

Phaser


My VCV Rack Modules Pack works on Mac/PC/Linux using Rack 0.3.2 (current release at the moment), not with 0.3.1.
My VCV Rack Modules Pack works on Mac/PC/Linux using Rack 0.4.0 (current release at the moment), not with 0.3.2 or earlier.
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-tactile
1,524 changes: 0 additions & 1,524 deletions res/PitchShifter.svg

This file was deleted.

466 changes: 0 additions & 466 deletions res/VCO-1.svg

This file was deleted.

262 changes: 0 additions & 262 deletions res/WavesOscillator.svg

This file was deleted.

14 changes: 3 additions & 11 deletions src/Autodafe.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
#include "Autodafe.hpp"
#include <math.h>
#include "dsp/digital.hpp"
#include "dsp/decimator.hpp"
#include "dsp/fft.hpp"
#include "dsp/filter.hpp"
#include "dsp/fir.hpp"
#include "dsp/frame.hpp"
#include "dsp/minblep.hpp"
#include "dsp/ode.hpp"
#include "dsp/ringbuffer.hpp"
#include "dsp/samplerate.hpp"




Expand All @@ -33,7 +24,8 @@ void init(rack::Plugin *p) {
createModel<FoldBackWidget>(plugin, "Foldback Distortion", "Foldback Distortion");
createModel<BitCrusherWidget>(plugin, "BitCrusher", "BitCrusher");
createModel<PhaserFxWidget>(plugin, "Phaser", "Phaser");






Expand Down
94 changes: 2 additions & 92 deletions src/Autodafe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,98 +18,6 @@ extern Plugin *plugin;



/////////////////////////////
// CUSTOM KNOBS & GRAPHICS //
/////////////////////////////


struct AutodafeKnobRed : SVGKnob {
AutodafeKnobRed() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobRed.svg")));
}
};


struct AutodafeKnobBlue : SVGKnob {
AutodafeKnobBlue() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobBlue.svg")));
}
};


struct AutodafeKnobGreen : SVGKnob {
AutodafeKnobGreen() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobGreen.svg")));
}
};


struct AutodafeKnobGray : SVGKnob {
AutodafeKnobGray() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobGray.svg")));
}
};
struct AutodafeKnobPurple : SVGKnob {
AutodafeKnobPurple() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobPurple.svg")));
}
};

struct AutodafeKnobPink : SVGKnob {
AutodafeKnobPink() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobPink.svg")));
}
};

struct AutodafeKnobOrange : SVGKnob {
AutodafeKnobOrange() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobOrange.svg")));
}
};



struct AutodafeKnobYellow : SVGKnob {
AutodafeKnobYellow() {
box.size = Vec(20, 20);
minAngle = -0.75*M_PI;
maxAngle = 0.75*M_PI;
setSVG(SVG::load(assetPlugin(plugin, "res/AutodafeKnobYellow.svg")));
}
};


struct AutodafeButton : SVGSwitch, MomentarySwitch {
AutodafeButton() {

addFrame(SVG::load(assetPlugin(plugin, "res/AutodafeButton.svg")));
//SVG::load("res/AutodafeButton.svg");

box.size = Vec(20,20);

}
};



Expand Down Expand Up @@ -206,3 +114,5 @@ struct PhaserFxWidget : ModuleWidget{





2 changes: 1 addition & 1 deletion src/Biquad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,4 @@ void Biquad::calcBiquad(void) {
}

return;
}
}
12 changes: 6 additions & 6 deletions src/ClockDivider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ struct ClockDivider : Module {

float lights[5] = {0};

void reset() {
void initialize() {

lights[0] = 0.0;
lights[1] = 0.0;
Expand Down Expand Up @@ -146,7 +146,7 @@ void ClockDivider::step() {
}
else
{
lights[0] -= lights[0] / lightLambda / engineGetSampleRate();
lights[0] -= lights[0] / lightLambda / gSampleRate;
}

}
Expand All @@ -167,7 +167,7 @@ void ClockDivider::step() {
}
else
{
lights[1] -= lights[1] / lightLambda / engineGetSampleRate();
lights[1] -= lights[1] / lightLambda / gSampleRate;
}

}
Expand All @@ -188,7 +188,7 @@ void ClockDivider::step() {
}
else
{
lights[2] -= lights[2] / lightLambda / engineGetSampleRate();
lights[2] -= lights[2] / lightLambda / gSampleRate;
}

}
Expand All @@ -209,7 +209,7 @@ void ClockDivider::step() {
}
else
{
lights[3] -= lights[3] / lightLambda / engineGetSampleRate();
lights[3] -= lights[3] / lightLambda / gSampleRate;
}

}
Expand All @@ -230,7 +230,7 @@ void ClockDivider::step() {
}
else
{
lights[4] -= lights[4] / lightLambda / engineGetSampleRate();
lights[4] -= lights[4] / lightLambda / gSampleRate;
}

}
Expand Down
122 changes: 122 additions & 0 deletions src/DSPUtilities.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
//
// DSPUtilities.cpp

//
//

#include "DSPUtilities.h"

#ifndef DSP_UTILITIES
#define DSP_UTILITIES

#include <cmath>

//==============================================================================

// Calculates the frequency of a given pitch (MIDI) value.
double pitchToFreq(double pitch)
{
return pow(2, (pitch - 69) / 12) * 440;
}

//==============================================================================
// Calculates the pitch (MIDI) of a given frequency value
double freqToPitch(double freq)
{
return 69 + 12 * log2(freq / 440);
}

//==============================================================================

/**
Takes a value as input and clips it according to the min and max values.
Returns the input if (minValue <= in <= maxValue).
If (in < minValue), then return minValue.
If (in > maxValue), then return maxValue.
*/
double clipMinMax(double in, double minValue, double maxValue)
{
if (in < minValue)
return minValue;
else if (in > maxValue)
return maxValue;
else
return in;
}

//==============================================================================

/**
Takes a value as input and clips it according to the min value.
Returns the input if (minValue <= in).
If (in < minValue), then return minValue.
*/
double clipMin(double in, double minValue)
{
if (in < minValue)
return minValue;
else
return in;
}

//==============================================================================

/**
Crossfades linearly between two values (in0, in1). The value returned is
determined by the value of the xFadeCtrl argument.
xFadeCtrl Range: 0->1
- xFadeCtrl = 0 (only in0 comes through)
- xFadeCtrl = 0.5 (equal mix of in0 and in1)
- xfadeCtrl = 1 (only in1 comes through)
*/
double xFadeLin(double xFadeCtrl, double in0, double in1)
{
// Clip the xFade parameter to only have range of 0->1
xFadeCtrl = clipMinMax(xFadeCtrl, 0.0, 1.0);
// Perform crossfading and return the value
return (in0 * (1.0 - xFadeCtrl) + in1 * xFadeCtrl);
}

//==============================================================================

/**
Parabolic Controller Shaper:
"Bends" the controller curve torwards the X or Y axis.
input range: (-1..0..1) maps to output range: (-1..0..1).
bend range: (-1..0..1)
- bend = -1 (max bend towards X axis)
- bend = 0 (don't bend)
- bend = 1 (max bend towards Y axis)
*/
double parCtrlShaper(double input, double bend)
{
// clip input and bend because the shaper only works in that range.
input = clipMinMax(input, -1.0, 1.0);
bend = clipMinMax(bend, -1.0, 1.0);
return input * ((bend + 1) - fabs(input) * bend);
}

//==============================================================================

/**
Normalizes a range of values to the range 0->1.
(start/end should probably be the range of a parameter)
- input: the value to be normalized
- start: the start of the input's range
- end: the end of the input's range
Note: (start < end) and (start > end) are both valid.
*/
double normalizeRange(double input, double start, double end)
{
return (input - start) / (end - start);
}


double resonanceToQ(double resonance)
{
return 1.0 / (2.0 * (1.0 - resonance));
}

//==============================================================================
#endif // DSP_UTILITIES

18 changes: 9 additions & 9 deletions src/FixedFilterBank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ void FixedFilter::step() {



bq1->setBiquad(bq_type_peak, 75.0 / engineGetSampleRate(), 5, params[EQ1].value);
bq2->setBiquad(bq_type_peak, 125.0 / engineGetSampleRate(), 5, params[EQ2].value);
bq3->setBiquad(bq_type_peak, 250.0 / engineGetSampleRate(), 5, params[EQ3].value);
bq4->setBiquad(bq_type_peak, 500.0 / engineGetSampleRate(), 5, params[EQ4].value);
bq5->setBiquad(bq_type_peak, 1000.0 / engineGetSampleRate(), 5, params[EQ5].value);
bq6->setBiquad(bq_type_peak, 2000.0 / engineGetSampleRate(), 5, params[EQ6].value);
bq7->setBiquad(bq_type_peak, 4000.0 / engineGetSampleRate(), 5, params[EQ7].value);
bq8->setBiquad(bq_type_peak, 8000.0 / engineGetSampleRate(), 5, params[EQ8].value);
bq1->setBiquad(bq_type_peak, 75.0 / gSampleRate, 5, params[EQ1].value);
bq2->setBiquad(bq_type_peak, 125.0 / gSampleRate, 5, params[EQ2].value);
bq3->setBiquad(bq_type_peak, 250.0 / gSampleRate, 5, params[EQ3].value);
bq4->setBiquad(bq_type_peak, 500.0 / gSampleRate, 5, params[EQ4].value);
bq5->setBiquad(bq_type_peak, 1000.0 / gSampleRate, 5, params[EQ5].value);
bq6->setBiquad(bq_type_peak, 2000.0 / gSampleRate, 5, params[EQ6].value);
bq7->setBiquad(bq_type_peak, 4000.0 / gSampleRate, 5, params[EQ7].value);
bq8->setBiquad(bq_type_peak, 8000.0 / gSampleRate, 5, params[EQ8].value);



Expand Down Expand Up @@ -143,4 +143,4 @@ FixedFilterWidget::FixedFilterWidget() {

addOutput(createOutput<PJ301MPort>(Vec(85, 320), module, FixedFilter::OUT));

}
}
Loading

0 comments on commit fdb3fc2

Please sign in to comment.