kopia lustrzana https://github.com/jameshball/osci-render
Refactor Point to OsciPoint due to naming conflicts
rodzic
3022800e1c
commit
eff8b3f635
|
@ -0,0 +1,3 @@
|
|||
[submodule "modules/chowdsp_utils"]
|
||||
path = modules/chowdsp_utils
|
||||
url = git@github.com:Chowdhury-DSP/chowdsp_utils.git
|
|
@ -45,8 +45,8 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
new EffectParameter("Vector Cancelling", "Inverts the audio and image every few samples to 'cancel out' the audio, making the audio quiet, and distorting the image.", "vectorCancelling", VERSION_HINT, 0.1111111, 0.0, 1.0)
|
||||
));
|
||||
toggleableEffects.push_back(std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input * Point(values[0], values[1], values[2]);
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input * OsciPoint(values[0], values[1], values[2]);
|
||||
}, std::vector<EffectParameter*>{
|
||||
new EffectParameter("Scale X", "Scales the object in the horizontal direction.", "scaleX", VERSION_HINT, 1.0, -5.0, 5.0),
|
||||
new EffectParameter("Scale Y", "Scales the object in the vertical direction.", "scaleY", VERSION_HINT, 1.0, -5.0, 5.0),
|
||||
|
@ -54,9 +54,9 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
}
|
||||
));
|
||||
toggleableEffects.push_back(std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
int flip = index % 2 == 0 ? 1 : -1;
|
||||
Point jitter = Point(flip * values[0], flip * values[1], flip * values[2]);
|
||||
OsciPoint jitter = OsciPoint(flip * values[0], flip * values[1], flip * values[2]);
|
||||
return input + jitter;
|
||||
}, std::vector<EffectParameter*>{
|
||||
new EffectParameter("Distort X", "Distorts the image in the horizontal direction by jittering the audio sample being drawn.", "distortX", VERSION_HINT, 0.0, 0.0, 1.0),
|
||||
|
@ -65,7 +65,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
}
|
||||
));
|
||||
auto rippleEffect = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double phase = values[1] * std::numbers::pi;
|
||||
double distance = 100 * values[2] * (input.x * input.x + input.y * input.y);
|
||||
input.z += values[0] * std::sin(phase + distance);
|
||||
|
@ -79,7 +79,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
rippleEffect->getParameter("ripplePhase")->lfo->setUnnormalisedValueNotifyingHost((int) LfoType::Sawtooth);
|
||||
toggleableEffects.push_back(rippleEffect);
|
||||
auto rotateEffect = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
input.rotate(values[0] * std::numbers::pi, values[1] * std::numbers::pi, values[2] * std::numbers::pi);
|
||||
return input;
|
||||
}, std::vector<EffectParameter*>{
|
||||
|
@ -92,8 +92,8 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
rotateEffect->getParameter("rotateY")->lfoRate->setUnnormalisedValueNotifyingHost(0.2);
|
||||
toggleableEffects.push_back(rotateEffect);
|
||||
toggleableEffects.push_back(std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input + Point(values[0], values[1], values[2]);
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input + OsciPoint(values[0], values[1], values[2]);
|
||||
}, std::vector<EffectParameter*>{
|
||||
new EffectParameter("Translate X", "Moves the object horizontally.", "translateX", VERSION_HINT, 0.0, -1.0, 1.0),
|
||||
new EffectParameter("Translate Y", "Moves the object vertically.", "translateY", VERSION_HINT, 0.0, -1.0, 1.0),
|
||||
|
@ -101,11 +101,11 @@ OscirenderAudioProcessor::OscirenderAudioProcessor()
|
|||
}
|
||||
));
|
||||
toggleableEffects.push_back(std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double length = 10 * values[0] * input.magnitude();
|
||||
double newX = input.x * std::cos(length) - input.y * std::sin(length);
|
||||
double newY = input.x * std::sin(length) + input.y * std::cos(length);
|
||||
return Point(newX, newY, input.z);
|
||||
return OsciPoint(newX, newY, input.z);
|
||||
}, std::vector<EffectParameter*>{
|
||||
new EffectParameter("Swirl", "Swirls the image in a spiral pattern.", "swirl", VERSION_HINT, 0.3, -1.0, 1.0),
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ void OscirenderAudioProcessor::addLuaSlider() {
|
|||
}
|
||||
|
||||
luaEffects.push_back(std::make_shared<Effect>(
|
||||
[this, sliderIndex](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this, sliderIndex](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
luaValues[sliderIndex].store(values[0]);
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
|
@ -710,7 +710,7 @@ void OscirenderAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, ju
|
|||
currentVolume = std::sqrt(squaredVolume);
|
||||
currentVolume = juce::jlimit(0.0, 1.0, currentVolume);
|
||||
|
||||
Point channels = { outputBuffer3d.getSample(0, sample), outputBuffer3d.getSample(1, sample), outputBuffer3d.getSample(2, sample) };
|
||||
OsciPoint channels = { outputBuffer3d.getSample(0, sample), outputBuffer3d.getSample(1, sample), outputBuffer3d.getSample(2, sample) };
|
||||
|
||||
{
|
||||
juce::SpinLock::ScopedLockType lock1(parsersLock);
|
||||
|
@ -753,7 +753,7 @@ void OscirenderAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, ju
|
|||
{
|
||||
juce::SpinLock::ScopedLockType scope(consumerLock);
|
||||
for (auto consumer : consumers) {
|
||||
consumer->write(Point(x, y, 1));
|
||||
consumer->write(OsciPoint(x, y, 1));
|
||||
consumer->notifyIfFull();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ public:
|
|||
std::atomic<double> luaValues[26] = { 0.0 };
|
||||
|
||||
std::shared_ptr<Effect> frequencyEffect = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
frequency = values[0].load();
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
);
|
||||
|
||||
std::shared_ptr<Effect> volumeEffect = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
volume = values[0].load();
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
);
|
||||
|
||||
std::shared_ptr<Effect> thresholdEffect = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
threshold = values[0].load();
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
|
@ -202,7 +202,7 @@ public:
|
|||
|
||||
BooleanParameter* invertImage = new BooleanParameter("Invert Image", "invertImage", VERSION_HINT, false, "Inverts the image so that dark pixels become light, and vice versa.");
|
||||
std::shared_ptr<Effect> imageThreshold = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
"Image Threshold",
|
||||
|
@ -212,7 +212,7 @@ public:
|
|||
)
|
||||
);
|
||||
std::shared_ptr<Effect> imageStride = std::make_shared<Effect>(
|
||||
[this](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
[this](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
return input;
|
||||
}, new EffectParameter(
|
||||
"Image Stride",
|
||||
|
|
|
@ -190,7 +190,7 @@ void SosciAudioProcessor::processBlock(juce::AudioBuffer<float>& buffer, juce::M
|
|||
}
|
||||
}
|
||||
|
||||
Point point = { x, y, brightness };
|
||||
OsciPoint point = { x, y, brightness };
|
||||
|
||||
for (auto& effect : allEffects) {
|
||||
point = effect->apply(sample, point);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
BitCrushEffect::BitCrushEffect() {}
|
||||
|
||||
// algorithm from https://www.kvraudio.com/forum/viewtopic.php?t=163880
|
||||
Point BitCrushEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint BitCrushEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double value = values[0];
|
||||
// change rage of value from 0-1 to 0.0-0.78
|
||||
double rangedValue = value * 0.78;
|
||||
|
@ -12,5 +12,5 @@ Point BitCrushEffect::apply(int index, Point input, const std::vector<std::atomi
|
|||
double x = powf(2.0f, crush);
|
||||
double quant = 0.5 * x;
|
||||
double dequant = 1.0f / quant;
|
||||
return Point(dequant * (int)(input.x * quant), dequant * (int)(input.y * quant), dequant * (int)(input.z * quant));
|
||||
return OsciPoint(dequant * (int)(input.x * quant), dequant * (int)(input.y * quant), dequant * (int)(input.z * quant));
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class BitCrushEffect : public EffectApplication {
|
||||
public:
|
||||
BitCrushEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
|
||||
class BooleanParameter : public juce::AudioProcessorParameterWithID {
|
||||
|
|
|
@ -4,7 +4,7 @@ BulgeEffect::BulgeEffect() {}
|
|||
|
||||
BulgeEffect::~BulgeEffect() {}
|
||||
|
||||
Point BulgeEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint BulgeEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double value = values[0];
|
||||
double translatedBulge = -value + 1;
|
||||
|
||||
|
@ -12,5 +12,5 @@ Point BulgeEffect::apply(int index, Point input, const std::vector<std::atomic<d
|
|||
double theta = atan2(input.y, input.x);
|
||||
double rn = pow(r, translatedBulge);
|
||||
|
||||
return Point(rn * cos(theta), rn * sin(theta), input.z);
|
||||
return OsciPoint(rn * cos(theta), rn * sin(theta), input.z);
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class BulgeEffect : public EffectApplication {
|
||||
public:
|
||||
BulgeEffect();
|
||||
~BulgeEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>&, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>&, double sampleRate) override;
|
||||
};
|
||||
|
|
|
@ -13,7 +13,7 @@ CustomEffect::~CustomEffect() {
|
|||
parser->close(L);
|
||||
}
|
||||
|
||||
Point CustomEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint CustomEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
auto effectScale = values[0].load();
|
||||
|
||||
auto x = input.x;
|
||||
|
@ -45,7 +45,7 @@ Point CustomEffect::apply(int index, Point input, const std::vector<std::atomic<
|
|||
}
|
||||
}
|
||||
|
||||
return Point(
|
||||
return OsciPoint(
|
||||
(1 - effectScale) * input.x + effectScale * x,
|
||||
(1 - effectScale) * input.y + effectScale * y,
|
||||
(1 - effectScale) * input.z + effectScale * z
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include "../audio/Effect.h"
|
||||
#include "../lua/LuaParser.h"
|
||||
|
||||
|
@ -13,7 +13,7 @@ public:
|
|||
static const juce::String UNIQUE_ID;
|
||||
static const juce::String FILE_NAME;
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
void updateCode(const juce::String& newCode);
|
||||
|
||||
juce::String getCode();
|
||||
|
|
|
@ -4,7 +4,7 @@ DashedLineEffect::DashedLineEffect() {}
|
|||
|
||||
DashedLineEffect::~DashedLineEffect() {}
|
||||
|
||||
Point DashedLineEffect::apply(int index, Point vector, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint DashedLineEffect::apply(int index, OsciPoint vector, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
// dash length in seconds
|
||||
double dashLength = values[0] / 400;
|
||||
int dashLengthSamples = (int)(dashLength * sampleRate);
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class DashedLineEffect : public EffectApplication {
|
||||
public:
|
||||
DashedLineEffect();
|
||||
~DashedLineEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
|
||||
private:
|
||||
const static int MAX_BUFFER = 192000;
|
||||
std::vector<Point> buffer = std::vector<Point>(MAX_BUFFER);
|
||||
std::vector<OsciPoint> buffer = std::vector<OsciPoint>(MAX_BUFFER);
|
||||
int dashIndex = 0;
|
||||
int bufferIndex = 0;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@ DelayEffect::DelayEffect() {}
|
|||
|
||||
DelayEffect::~DelayEffect() {}
|
||||
|
||||
Point DelayEffect::apply(int index, Point vector, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint DelayEffect::apply(int index, OsciPoint vector, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double decay = values[0];
|
||||
double decayLength = values[1];
|
||||
int delayBufferLength = (int)(sampleRate * decayLength);
|
||||
|
@ -22,8 +22,8 @@ Point DelayEffect::apply(int index, Point vector, const std::vector<std::atomic<
|
|||
}
|
||||
}
|
||||
|
||||
Point echo = delayBuffer[position];
|
||||
vector = Point(
|
||||
OsciPoint echo = delayBuffer[position];
|
||||
vector = OsciPoint(
|
||||
vector.x + echo.x * decay,
|
||||
vector.y + echo.y * decay,
|
||||
vector.z + echo.z * decay
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class DelayEffect : public EffectApplication {
|
||||
public:
|
||||
DelayEffect();
|
||||
~DelayEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
|
||||
private:
|
||||
const static int MAX_DELAY = 192000 * 10;
|
||||
std::vector<Point> delayBuffer = std::vector<Point>(MAX_DELAY);
|
||||
std::vector<OsciPoint> delayBuffer = std::vector<OsciPoint>(MAX_DELAY);
|
||||
int head = 0;
|
||||
int position = 0;
|
||||
int samplesSinceLastDelay = 0;
|
||||
|
|
|
@ -4,7 +4,7 @@ DistortEffect::DistortEffect(bool vertical) : vertical(vertical) {}
|
|||
|
||||
DistortEffect::~DistortEffect() {}
|
||||
|
||||
Point DistortEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint DistortEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double value = values[0];
|
||||
int vertical = (int)this->vertical;
|
||||
if (index % 2 == 0) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class DistortEffect : public EffectApplication {
|
||||
public:
|
||||
DistortEffect(bool vertical);
|
||||
~DistortEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
private:
|
||||
bool vertical;
|
||||
};
|
||||
|
|
|
@ -17,11 +17,11 @@ Effect::Effect(EffectApplicationType application, const std::vector<EffectParame
|
|||
|
||||
Effect::Effect(EffectApplicationType application, EffectParameter* parameter) : Effect(application, std::vector<EffectParameter*>{parameter}) {}
|
||||
|
||||
Effect::Effect(const std::vector<EffectParameter*>& parameters) : Effect([](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {return input;}, parameters) {}
|
||||
Effect::Effect(const std::vector<EffectParameter*>& parameters) : Effect([](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {return input;}, parameters) {}
|
||||
|
||||
Effect::Effect(EffectParameter* parameter) : Effect([](int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {return input;}, parameter) {}
|
||||
Effect::Effect(EffectParameter* parameter) : Effect([](int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {return input;}, parameter) {}
|
||||
|
||||
Point Effect::apply(int index, Point input, double volume) {
|
||||
OsciPoint Effect::apply(int index, OsciPoint input, double volume) {
|
||||
animateValues(volume);
|
||||
if (application) {
|
||||
return application(index, input, actualValues, sampleRate);
|
||||
|
@ -94,7 +94,7 @@ float Effect::nextPhase(EffectParameter* parameter) {
|
|||
}
|
||||
|
||||
void Effect::apply() {
|
||||
apply(0, Point());
|
||||
apply(0, OsciPoint());
|
||||
}
|
||||
|
||||
double Effect::getValue(int index) {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "EffectApplication.h"
|
||||
#include "EffectParameter.h"
|
||||
#include "BooleanParameter.h"
|
||||
|
||||
typedef std::function<Point(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate)> EffectApplicationType;
|
||||
typedef std::function<OsciPoint(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate)> EffectApplicationType;
|
||||
|
||||
class Effect {
|
||||
public:
|
||||
|
@ -16,7 +16,7 @@ public:
|
|||
Effect(const std::vector<EffectParameter*>& parameters);
|
||||
Effect(EffectParameter* parameter);
|
||||
|
||||
Point apply(int index, Point input, double volume = 0.0);
|
||||
OsciPoint apply(int index, OsciPoint input, double volume = 0.0);
|
||||
|
||||
void apply();
|
||||
double getValue(int index);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
|
||||
class EffectApplication {
|
||||
public:
|
||||
EffectApplication() {};
|
||||
|
||||
virtual Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) = 0;
|
||||
virtual OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) = 0;
|
||||
|
||||
void resetPhase();
|
||||
double nextPhase(double frequency, double sampleRate);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "BooleanParameter.h"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ PerspectiveEffect::PerspectiveEffect() {}
|
|||
|
||||
PerspectiveEffect::~PerspectiveEffect() {}
|
||||
|
||||
Point PerspectiveEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint PerspectiveEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
auto effectScale = values[0].load();
|
||||
auto focalLength = juce::jmax(values[1].load(), 0.001);
|
||||
|
||||
|
@ -18,7 +18,7 @@ Point PerspectiveEffect::apply(int index, Point input, const std::vector<std::at
|
|||
|
||||
Vec3 projected = camera.project(vec);
|
||||
|
||||
return Point(
|
||||
return OsciPoint(
|
||||
(1 - effectScale) * input.x + effectScale * projected.x,
|
||||
(1 - effectScale) * input.y + effectScale * projected.y,
|
||||
0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include "../audio/Effect.h"
|
||||
#include "../obj/Camera.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@ public:
|
|||
PerspectiveEffect();
|
||||
~PerspectiveEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ private:
|
|||
|
||||
juce::CriticalSection consumerLock;
|
||||
std::shared_ptr<BufferConsumer> consumer;
|
||||
std::vector<Point> buffer = std::vector<Point>(fftSize);
|
||||
std::vector<OsciPoint> buffer = std::vector<OsciPoint>(fftSize);
|
||||
juce::dsp::FFT forwardFFT{fftOrder};
|
||||
std::array<float, fftSize * 2> fftData;
|
||||
OscirenderAudioProcessor& audioProcessor;
|
||||
|
|
|
@ -96,7 +96,7 @@ void ShapeVoice::renderNextBlock(juce::AudioSampleBuffer& outputBuffer, int star
|
|||
double proportionalLength = (traceMax - traceMin) * frameLength;
|
||||
lengthIncrement = juce::jmax(proportionalLength / (audioProcessor.currentSampleRate / actualFrequency), MIN_LENGTH_INCREMENT);
|
||||
|
||||
Point channels;
|
||||
OsciPoint channels;
|
||||
double x = 0.0;
|
||||
double y = 0.0;
|
||||
double z = 0.0;
|
||||
|
|
|
@ -4,7 +4,7 @@ SmoothEffect::SmoothEffect() {}
|
|||
|
||||
SmoothEffect::~SmoothEffect() {}
|
||||
|
||||
Point SmoothEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint SmoothEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double weight = juce::jmax(values[0].load(), 0.00001);
|
||||
weight *= 0.95;
|
||||
double strength = 10;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class SmoothEffect : public EffectApplication {
|
||||
public:
|
||||
SmoothEffect();
|
||||
~SmoothEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
private:
|
||||
Point avg;
|
||||
OsciPoint avg;
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@ VectorCancellingEffect::VectorCancellingEffect() {}
|
|||
|
||||
VectorCancellingEffect::~VectorCancellingEffect() {}
|
||||
|
||||
Point VectorCancellingEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint VectorCancellingEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
double value = values[0];
|
||||
if (value < 0.001) {
|
||||
return input;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
class VectorCancellingEffect : public EffectApplication {
|
||||
public:
|
||||
VectorCancellingEffect();
|
||||
~VectorCancellingEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
private:
|
||||
int lastIndex = 0;
|
||||
double nextInvert = 0;
|
||||
|
|
|
@ -4,7 +4,7 @@ WobbleEffect::WobbleEffect(PitchDetector& pitchDetector) : pitchDetector(pitchDe
|
|||
|
||||
WobbleEffect::~WobbleEffect() {}
|
||||
|
||||
Point WobbleEffect::apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
OsciPoint WobbleEffect::apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) {
|
||||
// TODO: this doesn't consider sample rate
|
||||
smoothedFrequency = smoothedFrequency * 0.99995 + pitchDetector.frequency * 0.00005;
|
||||
double theta = nextPhase(smoothedFrequency, sampleRate);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
#include "EffectApplication.h"
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include "PitchDetector.h"
|
||||
|
||||
class WobbleEffect : public EffectApplication {
|
||||
|
@ -8,7 +8,7 @@ public:
|
|||
WobbleEffect(PitchDetector& pitchDetector);
|
||||
~WobbleEffect();
|
||||
|
||||
Point apply(int index, Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
OsciPoint apply(int index, OsciPoint input, const std::vector<std::atomic<double>>& values, double sampleRate) override;
|
||||
|
||||
private:
|
||||
PitchDetector& pitchDetector;
|
||||
|
|
|
@ -90,7 +90,7 @@ void VisualiserComponent::mouseDoubleClick(const juce::MouseEvent& event) {
|
|||
enableFullScreen();
|
||||
}
|
||||
|
||||
void VisualiserComponent::setBuffer(std::vector<Point>& newBuffer) {
|
||||
void VisualiserComponent::setBuffer(std::vector<OsciPoint>& newBuffer) {
|
||||
juce::CriticalSection::ScopedLockType scope(lock);
|
||||
if (!oldVisualiser) {
|
||||
openGLVisualiser.updateBuffer(newBuffer);
|
||||
|
@ -246,7 +246,7 @@ void VisualiserComponent::paintXY(juce::Graphics& g, juce::Rectangle<float> area
|
|||
|
||||
void VisualiserComponent::resetBuffer() {
|
||||
sampleRate = (int) sampleRateManager.getSampleRate();
|
||||
tempBuffer = std::vector<Point>(sampleRate * BUFFER_LENGTH_SECS);
|
||||
tempBuffer = std::vector<OsciPoint>(sampleRate * BUFFER_LENGTH_SECS);
|
||||
}
|
||||
|
||||
void VisualiserComponent::toggleRecording() {
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
void enableFullScreen();
|
||||
void setFullScreenCallback(std::function<void(FullScreenMode)> callback);
|
||||
void mouseDoubleClick(const juce::MouseEvent& event) override;
|
||||
void setBuffer(std::vector<Point>& buffer);
|
||||
void setBuffer(std::vector<OsciPoint>& buffer);
|
||||
void setColours(juce::Colour backgroundColour, juce::Colour waveformColour);
|
||||
void paintXY(juce::Graphics&, juce::Rectangle<float> bounds);
|
||||
void paint(juce::Graphics&) override;
|
||||
|
@ -67,7 +67,7 @@ private:
|
|||
bool visualiserOnly;
|
||||
|
||||
juce::CriticalSection lock;
|
||||
std::vector<Point> buffer;
|
||||
std::vector<OsciPoint> buffer;
|
||||
std::vector<juce::Line<float>> prevLines;
|
||||
juce::Colour backgroundColour, waveformColour;
|
||||
SampleRateManager& sampleRateManager;
|
||||
|
@ -80,7 +80,7 @@ private:
|
|||
SvgButton popOutButton{ "popOut", BinaryData::open_in_new_svg, juce::Colours::white, juce::Colours::white };
|
||||
SvgButton settingsButton{ "settings", BinaryData::cog_svg, juce::Colours::white, juce::Colours::white };
|
||||
|
||||
std::vector<Point> tempBuffer;
|
||||
std::vector<OsciPoint> tempBuffer;
|
||||
int precision = 4;
|
||||
|
||||
juce::CriticalSection consumerLock;
|
||||
|
|
|
@ -303,9 +303,11 @@ void VisualiserOpenGLComponent::openGLContextClosing() {
|
|||
outputShader.reset();
|
||||
}
|
||||
|
||||
void VisualiserOpenGLComponent::updateBuffer(std::vector<Point>& buffer) {
|
||||
void VisualiserOpenGLComponent::updateBuffer(std::vector<OsciPoint>& buffer) {
|
||||
juce::CriticalSection::ScopedLockType lock(samplesLock);
|
||||
|
||||
int newResampledSize = buffer.size() * RESAMPLE_RATIO + 1;
|
||||
|
||||
if (samples.size() != buffer.size()) {
|
||||
needsReattach = true;
|
||||
}
|
||||
|
@ -313,6 +315,12 @@ void VisualiserOpenGLComponent::updateBuffer(std::vector<Point>& buffer) {
|
|||
for (auto& point : buffer) {
|
||||
samples.push_back(point);
|
||||
}
|
||||
|
||||
if (sampleRate != sampleRateManager.getSampleRate()) {
|
||||
sampleRate = sampleRateManager.getSampleRate();
|
||||
resampler.prepare(sampleRate, RESAMPLE_RATIO);
|
||||
}
|
||||
|
||||
juce::MessageManager::getInstance()->callAsync([this] {
|
||||
if (needsReattach) {
|
||||
openGLContext.detach();
|
||||
|
@ -444,7 +452,7 @@ Texture VisualiserOpenGLComponent::makeTexture(int width, int height) {
|
|||
return { textureID, width, height };
|
||||
}
|
||||
|
||||
void VisualiserOpenGLComponent::drawLineTexture(std::vector<Point>& points) {
|
||||
void VisualiserOpenGLComponent::drawLineTexture(std::vector<OsciPoint>& points) {
|
||||
using namespace juce::gl;
|
||||
|
||||
fadeAmount = juce::jmin(1.0, std::pow(0.5, settings.getPersistence()) * 0.4);
|
||||
|
@ -573,7 +581,7 @@ void VisualiserOpenGLComponent::setNormalBlending() {
|
|||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
|
||||
void VisualiserOpenGLComponent::drawLine(std::vector<Point>& points) {
|
||||
void VisualiserOpenGLComponent::drawLine(std::vector<OsciPoint>& points) {
|
||||
using namespace juce::gl;
|
||||
|
||||
setAdditiveBlending();
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include <JuceHeader.h>
|
||||
#include "VisualiserSettings.h"
|
||||
#include "../audio/SampleRateManager.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
|
||||
struct Texture {
|
||||
GLuint id;
|
||||
|
@ -20,7 +21,7 @@ public:
|
|||
void openGLContextClosing() override;
|
||||
void resized() override;
|
||||
void paint(juce::Graphics& g) override;
|
||||
void updateBuffer(std::vector<Point>& buffer);
|
||||
void updateBuffer(std::vector<OsciPoint>& buffer);
|
||||
void setPaused(bool paused);
|
||||
|
||||
private:
|
||||
|
@ -37,7 +38,13 @@ private:
|
|||
|
||||
juce::CriticalSection samplesLock;
|
||||
bool needsReattach = true;
|
||||
std::vector<Point> samples = std::vector<Point>(2);
|
||||
std::vector<OsciPoint> samples = std::vector<OsciPoint>(2);
|
||||
std::vector<float> xSamples;
|
||||
std::vector<float> ySamples;
|
||||
std::vector<float> zSamples;
|
||||
std::vector<float> smoothedXSamples;
|
||||
std::vector<float> smoothedYSamples;
|
||||
std::vector<float> smoothedZSamples;
|
||||
|
||||
std::vector<float> scratchVertices;
|
||||
std::vector<float> fullScreenQuad;
|
||||
|
@ -69,17 +76,21 @@ private:
|
|||
|
||||
bool paused = false;
|
||||
|
||||
const double RESAMPLE_RATIO = 6.0;
|
||||
double sampleRate = -1;
|
||||
chowdsp::ResamplingTypes::LanczosResampler<4096, 8> resampler;
|
||||
|
||||
Texture makeTexture(int width, int height);
|
||||
void setupArrays(int num_points);
|
||||
void setupTextures();
|
||||
void drawLineTexture(std::vector<Point>& points);
|
||||
void drawLineTexture(std::vector<OsciPoint>& points);
|
||||
void saveTextureToFile(GLuint textureID, int width, int height, const juce::File& file);
|
||||
void activateTargetTexture(std::optional<Texture> texture);
|
||||
void setShader(juce::OpenGLShaderProgram* program);
|
||||
void drawTexture(std::optional<Texture> texture0, std::optional<Texture> texture1 = std::nullopt, std::optional<Texture> texture2 = std::nullopt, std::optional<Texture> texture3 = std::nullopt);
|
||||
void setAdditiveBlending();
|
||||
void setNormalBlending();
|
||||
void drawLine(std::vector<Point>& points);
|
||||
void drawLine(std::vector<OsciPoint>& points);
|
||||
void fade();
|
||||
void drawCRT();
|
||||
void checkGLErrors(const juce::String& location);
|
||||
|
|
|
@ -149,5 +149,5 @@ void VolumeComponent::resized() {
|
|||
|
||||
void VolumeComponent::resetBuffer() {
|
||||
sampleRate = (int) audioProcessor.currentSampleRate;
|
||||
buffer = std::vector<Point>(BUFFER_DURATION_SECS * sampleRate);
|
||||
buffer = std::vector<OsciPoint>(BUFFER_DURATION_SECS * sampleRate);
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ private:
|
|||
const double BUFFER_DURATION_SECS = 0.02;
|
||||
|
||||
int sampleRate = DEFAULT_SAMPLE_RATE;
|
||||
std::vector<Point> buffer = std::vector<Point>(BUFFER_DURATION_SECS * DEFAULT_SAMPLE_RATE);
|
||||
std::vector<OsciPoint> buffer = std::vector<OsciPoint>(BUFFER_DURATION_SECS * DEFAULT_SAMPLE_RATE);
|
||||
|
||||
std::atomic<float> leftVolume = 0;
|
||||
std::atomic<float> rightVolume = 0;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
|
@ -42,7 +42,7 @@ public:
|
|||
|
||||
class BufferConsumer {
|
||||
public:
|
||||
BufferConsumer(std::vector<Point>& buffer) : buffer(buffer) {}
|
||||
BufferConsumer(std::vector<OsciPoint>& buffer) : buffer(buffer) {}
|
||||
|
||||
~BufferConsumer() {}
|
||||
|
||||
|
@ -62,14 +62,14 @@ public:
|
|||
sema.release();
|
||||
}
|
||||
|
||||
void write(Point point) {
|
||||
void write(OsciPoint point) {
|
||||
if (offset < buffer.size()) {
|
||||
buffer[offset++] = point;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<Point>& buffer;
|
||||
std::vector<OsciPoint>& buffer;
|
||||
Semaphore sema{0};
|
||||
int offset = 0;
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include "BufferConsumer.h"
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ public:
|
|||
ConsumerManager() {}
|
||||
~ConsumerManager() {}
|
||||
|
||||
std::shared_ptr<BufferConsumer> consumerRegister(std::vector<Point>& buffer) {
|
||||
std::shared_ptr<BufferConsumer> consumerRegister(std::vector<OsciPoint>& buffer) {
|
||||
std::shared_ptr<BufferConsumer> consumer = std::make_shared<BufferConsumer>(buffer);
|
||||
juce::SpinLock::ScopedLockType scope(consumerLock);
|
||||
consumers.push_back(consumer);
|
||||
|
|
|
@ -101,20 +101,20 @@ std::vector<std::unique_ptr<Shape>> LineArtParser::draw() {
|
|||
std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects, double focalLength)
|
||||
{
|
||||
std::vector<std::vector<double>> allMatrices;
|
||||
std::vector<std::vector<std::vector<Point>>> allVertices;
|
||||
std::vector<std::vector<std::vector<OsciPoint>>> allVertices;
|
||||
|
||||
for (int i = 0; i < objects.size(); i++) {
|
||||
auto verticesArray = *objects[i].getProperty("vertices", juce::Array<juce::var>()).getArray();
|
||||
std::vector<std::vector<Point>> vertices;
|
||||
std::vector<std::vector<OsciPoint>> vertices;
|
||||
|
||||
for (auto& vertexArrayVar : verticesArray) {
|
||||
vertices.push_back(std::vector<Point>());
|
||||
vertices.push_back(std::vector<OsciPoint>());
|
||||
auto& vertexArray = *vertexArrayVar.getArray();
|
||||
for (auto& vertex : vertexArray) {
|
||||
double x = vertex.getProperty("x", 0);
|
||||
double y = vertex.getProperty("y", 0);
|
||||
double z = vertex.getProperty("z", 0);
|
||||
vertices[vertices.size() - 1].push_back(Point(x, y, z));
|
||||
vertices[vertices.size() - 1].push_back(OsciPoint(x, y, z));
|
||||
}
|
||||
}
|
||||
auto matrix = *objects[i].getProperty("matrix", juce::Array<juce::var>()).getArray();
|
||||
|
@ -124,7 +124,7 @@ std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects,
|
|||
allMatrices[i].push_back(value);
|
||||
}
|
||||
|
||||
std::vector<std::vector<Point>> reorderedVertices;
|
||||
std::vector<std::vector<OsciPoint>> reorderedVertices;
|
||||
|
||||
if (vertices.size() > 0 && matrix.size() == 16) {
|
||||
std::vector<bool> visited = std::vector<bool>(vertices.size(), false);
|
||||
|
@ -157,7 +157,7 @@ std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects,
|
|||
}
|
||||
|
||||
for (int i = 0; i < vertices.size(); i++) {
|
||||
std::vector<Point> reorderedVertex;
|
||||
std::vector<OsciPoint> reorderedVertex;
|
||||
int index = order[i];
|
||||
for (int j = 0; j < vertices[index].size(); j++) {
|
||||
reorderedVertex.push_back(vertices[index][j]);
|
||||
|
@ -203,4 +203,4 @@ std::vector<Line> LineArtParser::generateFrame(juce::Array <juce::var> objects,
|
|||
}
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Shape.h"
|
||||
#include "../svg/SvgParser.h"
|
||||
|
@ -19,4 +19,4 @@ private:
|
|||
int frameNumber = 0;
|
||||
std::vector<std::vector<Line>> frames;
|
||||
int numFrames = 0;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -146,7 +146,7 @@ void ImageParser::findNearestNeighbour(int searchRadius, float thresholdPow, int
|
|||
findWhite(thresholdPow, invert);
|
||||
}
|
||||
|
||||
Point ImageParser::getSample() {
|
||||
OsciPoint ImageParser::getSample() {
|
||||
if (count % jumpFrequency() == 0) {
|
||||
resetPosition();
|
||||
}
|
||||
|
@ -162,5 +162,5 @@ Point ImageParser::getSample() {
|
|||
count++;
|
||||
float widthDiff = (maxDim - width) / 2;
|
||||
float heightDiff = (maxDim - height) / 2;
|
||||
return Point(2 * (currentX + widthDiff) / maxDim - 1, 2 * (currentY + heightDiff) / maxDim - 1);
|
||||
return OsciPoint(2 * (currentX + widthDiff) / maxDim - 1, 2 * (currentY + heightDiff) / maxDim - 1);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Shape.h"
|
||||
#include "../svg/SvgParser.h"
|
||||
|
@ -12,7 +12,7 @@ public:
|
|||
~ImageParser();
|
||||
|
||||
void setFrame(int index);
|
||||
Point getSample();
|
||||
OsciPoint getSample();
|
||||
|
||||
private:
|
||||
void findNearestNeighbour(int searchRadius, float thresholdPow, int stride, bool invert);
|
||||
|
|
|
@ -24,7 +24,7 @@ void LuaParser::resetMaximumInstructions(lua_State*& L) {
|
|||
lua_sethook(L, LuaParser::maximumInstructionsReached, 0, 0);
|
||||
}
|
||||
|
||||
static int pointToTable(lua_State* L, Point point, int numDims) {
|
||||
static int pointToTable(lua_State* L, OsciPoint point, int numDims) {
|
||||
lua_newtable(L);
|
||||
if (numDims == 1) {
|
||||
lua_pushnumber(L, point.x);
|
||||
|
@ -46,8 +46,8 @@ static int pointToTable(lua_State* L, Point point, int numDims) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
static Point tableToPoint(lua_State* L, int index) {
|
||||
Point point;
|
||||
static OsciPoint tableToPoint(lua_State* L, int index) {
|
||||
OsciPoint point;
|
||||
lua_pushinteger(L, 1);
|
||||
lua_gettable(L, index);
|
||||
point.x = lua_tonumber(L, -1);
|
||||
|
@ -70,16 +70,16 @@ static int luaLine(lua_State* L) {
|
|||
int nargs = lua_gettop(L);
|
||||
|
||||
double t = lua_tonumber(L, 1) / juce::MathConstants<double>::twoPi;
|
||||
Point point1 = nargs == 3 ? tableToPoint(L, 2) : Point(-1, -1);
|
||||
Point point2 = nargs == 3 ? tableToPoint(L, 3) : Point(1, 1);
|
||||
OsciPoint point1 = nargs == 3 ? tableToPoint(L, 2) : OsciPoint(-1, -1);
|
||||
OsciPoint point2 = nargs == 3 ? tableToPoint(L, 3) : OsciPoint(1, 1);
|
||||
|
||||
Line line = Line(point1, point2);
|
||||
Point point = line.nextVector(t);
|
||||
OsciPoint point = line.nextVector(t);
|
||||
|
||||
return pointToTable(L, point, 3);
|
||||
}
|
||||
|
||||
static Point genericRect(double phase, Point topLeft, double width, double height) {
|
||||
static OsciPoint genericRect(double phase, OsciPoint topLeft, double width, double height) {
|
||||
double t = phase / juce::MathConstants<double>::twoPi;
|
||||
double totalLength = 2 * (width + height);
|
||||
double progress = t * totalLength;
|
||||
|
@ -113,8 +113,8 @@ static int luaRect(lua_State* L) {
|
|||
double width = nargs == 1 ? 1 : lua_tonumber(L, 2);
|
||||
double height = nargs == 1 ? 1.5 : lua_tonumber(L, 3);
|
||||
|
||||
Point topLeft = nargs == 4 ? tableToPoint(L, 4) : Point(-width / 2, -height / 2);
|
||||
Point point = genericRect(phase, topLeft, width, height);
|
||||
OsciPoint topLeft = nargs == 4 ? tableToPoint(L, 4) : OsciPoint(-width / 2, -height / 2);
|
||||
OsciPoint point = genericRect(phase, topLeft, width, height);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
}
|
||||
|
@ -125,8 +125,8 @@ static int luaSquare(lua_State* L) {
|
|||
double phase = lua_tonumber(L, 1);
|
||||
double width = nargs == 1 ? 1 : lua_tonumber(L,2);
|
||||
|
||||
Point topLeft = nargs == 3 ? tableToPoint(L, 3) : Point(-width / 2, -width / 2);
|
||||
Point point = genericRect(phase, topLeft, width, width);
|
||||
OsciPoint topLeft = nargs == 3 ? tableToPoint(L, 3) : OsciPoint(-width / 2, -width / 2);
|
||||
OsciPoint point = genericRect(phase, topLeft, width, width);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ static int luaEllipse(lua_State* L) {
|
|||
double radiuxY = nargs == 1 ? 0.8 : lua_tonumber(L, 3);
|
||||
|
||||
CircleArc ellipse = CircleArc(0, 0, radiusX, radiuxY, 0, juce::MathConstants<double>::twoPi);
|
||||
Point point = ellipse.nextVector(t);
|
||||
OsciPoint point = ellipse.nextVector(t);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ static int luaCircle(lua_State* L) {
|
|||
double radius = nargs == 1 ? 0.8 : lua_tonumber(L, 2);
|
||||
|
||||
CircleArc ellipse = CircleArc(0, 0, radius, radius, 0, juce::MathConstants<double>::twoPi);
|
||||
Point point = ellipse.nextVector(t);
|
||||
OsciPoint point = ellipse.nextVector(t);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ static int luaArc(lua_State* L) {
|
|||
double endAngle = nargs == 1 ? juce::MathConstants<double>::halfPi : lua_tonumber(L, 5);
|
||||
|
||||
CircleArc arc = CircleArc(0, 0, radiusX, radiusY, startAngle, endAngle);
|
||||
Point point = arc.nextVector(t);
|
||||
OsciPoint point = arc.nextVector(t);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
}
|
||||
|
@ -188,21 +188,21 @@ static int luaPolygon(lua_State* L) {
|
|||
double x = cos(pi_n) * inner_cos - multiplier * sin(pi_n) * inner_sin;
|
||||
double y = cos(pi_n) * inner_sin + multiplier * sin(pi_n) * inner_cos;
|
||||
|
||||
return pointToTable(L, Point(x, y), 2);
|
||||
return pointToTable(L, OsciPoint(x, y), 2);
|
||||
}
|
||||
|
||||
static int luaBezier(lua_State* L) {
|
||||
int nargs = lua_gettop(L);
|
||||
|
||||
double t = lua_tonumber(L, 1) / juce::MathConstants<double>::twoPi;
|
||||
Point point1 = nargs == 1 ? Point(-1, -1) : tableToPoint(L, 2);
|
||||
Point point2 = nargs == 1 ? Point(-1, 1) : tableToPoint(L, 3);
|
||||
Point point3 = nargs == 1 ? Point(1, 1) : tableToPoint(L, 4);
|
||||
OsciPoint point1 = nargs == 1 ? OsciPoint(-1, -1) : tableToPoint(L, 2);
|
||||
OsciPoint point2 = nargs == 1 ? OsciPoint(-1, 1) : tableToPoint(L, 3);
|
||||
OsciPoint point3 = nargs == 1 ? OsciPoint(1, 1) : tableToPoint(L, 4);
|
||||
|
||||
Point point;
|
||||
OsciPoint point;
|
||||
|
||||
if (nargs == 5) {
|
||||
Point point4 = tableToPoint(L, 5);
|
||||
OsciPoint point4 = tableToPoint(L, 5);
|
||||
|
||||
CubicBezierCurve curve = CubicBezierCurve(point1.x, point1.y, point2.x, point2.y, point3.x, point3.y, point4.x, point4.y);
|
||||
point = curve.nextVector(t);
|
||||
|
@ -226,7 +226,7 @@ static int luaLissajous(lua_State* L) {
|
|||
double x = radius * sin(ratioA * phase);
|
||||
double y = radius * cos(ratioB * phase + theta);
|
||||
|
||||
return pointToTable(L, Point(x, y), 2);
|
||||
return pointToTable(L, OsciPoint(x, y), 2);
|
||||
}
|
||||
|
||||
static double squareWave(double phase) {
|
||||
|
@ -265,11 +265,11 @@ static int luaTriangleWave(lua_State* L) {
|
|||
static int luaMix(lua_State* L) {
|
||||
int nargs = lua_gettop(L);
|
||||
|
||||
Point point1 = tableToPoint(L, 1);
|
||||
Point point2 = tableToPoint(L, 2);
|
||||
OsciPoint point1 = tableToPoint(L, 1);
|
||||
OsciPoint point2 = tableToPoint(L, 2);
|
||||
double weight = lua_tonumber(L, 3);
|
||||
|
||||
Point point = Point(
|
||||
OsciPoint point = OsciPoint(
|
||||
point1.x * (1 - weight) + point2.x * weight,
|
||||
point1.y * (1 - weight) + point2.y * weight,
|
||||
point1.z * (1 - weight) + point2.z * weight
|
||||
|
@ -279,8 +279,8 @@ static int luaMix(lua_State* L) {
|
|||
}
|
||||
|
||||
static int luaTranslate(lua_State* L) {
|
||||
Point point = tableToPoint(L, 1);
|
||||
Point translation = tableToPoint(L, 2);
|
||||
OsciPoint point = tableToPoint(L, 1);
|
||||
OsciPoint translation = tableToPoint(L, 2);
|
||||
|
||||
point.translate(translation.x, translation.y, translation.z);
|
||||
|
||||
|
@ -288,8 +288,8 @@ static int luaTranslate(lua_State* L) {
|
|||
}
|
||||
|
||||
static int luaScale(lua_State* L) {
|
||||
Point point = tableToPoint(L, 1);
|
||||
Point scale = tableToPoint(L, 2);
|
||||
OsciPoint point = tableToPoint(L, 1);
|
||||
OsciPoint scale = tableToPoint(L, 2);
|
||||
|
||||
point.scale(scale.x, scale.y, scale.z);
|
||||
|
||||
|
@ -300,17 +300,17 @@ static int luaRotate(lua_State* L) {
|
|||
double nargs = lua_gettop(L);
|
||||
bool twoDimRotate = nargs == 2;
|
||||
|
||||
Point point;
|
||||
OsciPoint point;
|
||||
|
||||
if (twoDimRotate) {
|
||||
Point point = tableToPoint(L, 1);
|
||||
OsciPoint point = tableToPoint(L, 1);
|
||||
double angle = lua_tonumber(L, 2);
|
||||
|
||||
point.rotate(0, 0, angle);
|
||||
|
||||
return pointToTable(L, point, 2);
|
||||
} else {
|
||||
Point point = tableToPoint(L, 1);
|
||||
OsciPoint point = tableToPoint(L, 1);
|
||||
double xRotate = lua_tonumber(L, 2);
|
||||
double yRotate = lua_tonumber(L, 3);
|
||||
double zRotate = lua_tonumber(L, 4);
|
||||
|
|
|
@ -56,22 +56,22 @@ std::vector<std::unique_ptr<Shape>> FileParser::nextFrame() {
|
|||
}
|
||||
auto tempShapes = std::vector<std::unique_ptr<Shape>>();
|
||||
// return a square
|
||||
tempShapes.push_back(std::make_unique<Line>(Point(-0.5, -0.5, 0), Point(0.5, -0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(Point(0.5, -0.5, 0), Point(0.5, 0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(Point(0.5, 0.5, 0), Point(-0.5, 0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(Point(-0.5, 0.5, 0), Point(-0.5, -0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(OsciPoint(-0.5, -0.5, 0), OsciPoint(0.5, -0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(OsciPoint(0.5, -0.5, 0), OsciPoint(0.5, 0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(OsciPoint(0.5, 0.5, 0), OsciPoint(-0.5, 0.5, 0)));
|
||||
tempShapes.push_back(std::make_unique<Line>(OsciPoint(-0.5, 0.5, 0), OsciPoint(-0.5, -0.5, 0)));
|
||||
return tempShapes;
|
||||
}
|
||||
|
||||
Point FileParser::nextSample(lua_State*& L, LuaVariables& vars) {
|
||||
OsciPoint FileParser::nextSample(lua_State*& L, LuaVariables& vars) {
|
||||
juce::SpinLock::ScopedLockType scope(lock);
|
||||
|
||||
if (lua != nullptr) {
|
||||
auto values = lua->run(L, vars);
|
||||
if (values.size() == 2) {
|
||||
return Point(values[0], values[1], 0);
|
||||
return OsciPoint(values[0], values[1], 0);
|
||||
} else if (values.size() > 2) {
|
||||
return Point(values[0], values[1], values[2]);
|
||||
return OsciPoint(values[0], values[1], values[2]);
|
||||
}
|
||||
} else if (img != nullptr) {
|
||||
return img->getSample();
|
||||
|
@ -79,7 +79,7 @@ Point FileParser::nextSample(lua_State*& L, LuaVariables& vars) {
|
|||
return wav->getSample();
|
||||
}
|
||||
|
||||
return Point();
|
||||
return OsciPoint();
|
||||
}
|
||||
|
||||
void FileParser::closeLua(lua_State*& L) {
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
|
||||
void parse(juce::String fileName, juce::String extension, std::unique_ptr<juce::InputStream> stream, juce::Font font);
|
||||
std::vector<std::unique_ptr<Shape>> nextFrame();
|
||||
Point nextSample(lua_State*& L, LuaVariables& vars);
|
||||
OsciPoint nextSample(lua_State*& L, LuaVariables& vars);
|
||||
void closeLua(lua_State*& L);
|
||||
bool isSample();
|
||||
bool isActive();
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
class FrameSource {
|
||||
public:
|
||||
virtual std::vector<std::unique_ptr<Shape>> nextFrame() = 0;
|
||||
virtual Point nextSample() = 0;
|
||||
virtual OsciPoint nextSample() = 0;
|
||||
virtual bool isSample() = 0;
|
||||
virtual bool isActive() = 0;
|
||||
virtual void disable() = 0;
|
||||
virtual void enable() = 0;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
|
||||
CircleArc::CircleArc(double x, double y, double radiusX, double radiusY, double startAngle, double endAngle) : x(x), y(y), radiusX(radiusX), radiusY(radiusY), startAngle(startAngle), endAngle(endAngle) {}
|
||||
|
||||
Point CircleArc::nextVector(double drawingProgress) {
|
||||
OsciPoint CircleArc::nextVector(double drawingProgress) {
|
||||
// scale between start and end angle in the positive direction
|
||||
double angle = startAngle + endAngle * drawingProgress;
|
||||
return Point(
|
||||
return OsciPoint(
|
||||
x + radiusX * std::cos(angle),
|
||||
y + radiusY * std::sin(angle)
|
||||
);
|
||||
|
@ -30,8 +30,8 @@ double CircleArc::length() {
|
|||
len = 0;
|
||||
// TODO: Replace this, it's stupid. Do a real approximation.
|
||||
int segments = 5;
|
||||
Point start;
|
||||
Point end = nextVector(0);
|
||||
OsciPoint start;
|
||||
OsciPoint end = nextVector(0);
|
||||
for (int i = 0; i < segments; i++) {
|
||||
start = end;
|
||||
end = nextVector((i + 1) / (double) segments);
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include "Point.h"
|
||||
#include "OsciPoint.h"
|
||||
|
||||
class CircleArc : public Shape {
|
||||
public:
|
||||
CircleArc(double x, double y, double radiusX, double radiusY, double startAngle, double endAngle);
|
||||
|
||||
Point nextVector(double drawingProgress) override;
|
||||
OsciPoint nextVector(double drawingProgress) override;
|
||||
void scale(double x, double y, double z) override;
|
||||
void translate(double x, double y, double z) override;
|
||||
double length() override;
|
||||
|
@ -16,4 +16,4 @@ public:
|
|||
|
||||
double x, y, radiusX, radiusY, startAngle, endAngle;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
CubicBezierCurve::CubicBezierCurve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) : x1(x1), y1(y1), x2(x2), y2(y2), x3(x3), y3(y3), x4(x4), y4(y4) {}
|
||||
|
||||
Point CubicBezierCurve::nextVector(double t) {
|
||||
OsciPoint CubicBezierCurve::nextVector(double t) {
|
||||
double pow1 = pow(1 - t, 3);
|
||||
double pow2 = pow(1 - t, 2);
|
||||
double pow3 = pow(t, 2);
|
||||
|
@ -11,7 +11,7 @@ Point CubicBezierCurve::nextVector(double t) {
|
|||
double x = pow1 * x1 + 3 * pow2 * t * x2 + 3 * (1 - t) * pow3 * x3 + pow4 * x4;
|
||||
double y = pow1 * y1 + 3 * pow2 * t * y2 + 3 * (1 - t) * pow3 * y3 + pow4 * y4;
|
||||
|
||||
return Point(x, y);
|
||||
return OsciPoint(x, y);
|
||||
}
|
||||
|
||||
void CubicBezierCurve::scale(double x, double y, double z) {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include "Point.h"
|
||||
#include "OsciPoint.h"
|
||||
|
||||
class CubicBezierCurve : public Shape {
|
||||
public:
|
||||
CubicBezierCurve(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
|
||||
|
||||
Point nextVector(double drawingProgress) override;
|
||||
OsciPoint nextVector(double drawingProgress) override;
|
||||
void scale(double x, double y, double z) override;
|
||||
void translate(double x, double y, double z) override;
|
||||
double length() override;
|
||||
|
@ -16,4 +16,4 @@ public:
|
|||
|
||||
double x1, y1, x2, y2, x3, y3, x4, y4;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,10 +4,10 @@ Line::Line(double x1, double y1, double x2, double y2) : x1(x1), y1(y1), z1(0),
|
|||
|
||||
Line::Line(double x1, double y1, double z1, double x2, double y2, double z2) : x1(x1), y1(y1), z1(z1), x2(x2), y2(y2), z2(z2) {}
|
||||
|
||||
Line::Line(Point p1, Point p2) : x1(p1.x), y1(p1.y), z1(p1.z), x2(p2.x), y2(p2.y), z2(p2.z) {}
|
||||
Line::Line(OsciPoint p1, OsciPoint p2) : x1(p1.x), y1(p1.y), z1(p1.z), x2(p2.x), y2(p2.y), z2(p2.z) {}
|
||||
|
||||
Point Line::nextVector(double drawingProgress) {
|
||||
return Point(
|
||||
OsciPoint Line::nextVector(double drawingProgress) {
|
||||
return OsciPoint(
|
||||
x1 + (x2 - x1) * drawingProgress,
|
||||
y1 + (y2 - y1) * drawingProgress,
|
||||
z1 + (z2 - z1) * drawingProgress
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include "Point.h"
|
||||
#include "OsciPoint.h"
|
||||
|
||||
class Line : public Shape {
|
||||
public:
|
||||
Line(double x1, double y1, double x2, double y2);
|
||||
Line(double x1, double y1, double z1, double x2, double y2, double z2);
|
||||
Line(Point p1, Point p2);
|
||||
Line(OsciPoint p1, OsciPoint p2);
|
||||
|
||||
Point nextVector(double drawingProgress) override;
|
||||
OsciPoint nextVector(double drawingProgress) override;
|
||||
void scale(double x, double y, double z) override;
|
||||
void translate(double x, double y, double z) override;
|
||||
static double length(double x1, double y1, double z1, double x2, double y2, double z2);
|
||||
|
@ -20,4 +20,4 @@ public:
|
|||
|
||||
double x1, y1, z1, x2, y2, z2;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1,127 @@
|
|||
#include "OsciPoint.h"
|
||||
|
||||
double OsciPoint::EPSILON = 0.0001;
|
||||
|
||||
OsciPoint::OsciPoint() : x(0), y(0), z(0) {}
|
||||
|
||||
OsciPoint::OsciPoint(double val) : x(val), y(val), z(0) {}
|
||||
|
||||
OsciPoint::OsciPoint(double x, double y) : x(x), y(y), z(0) {}
|
||||
|
||||
OsciPoint::OsciPoint(double x, double y, double z) : x(x), y(y), z(z) {}
|
||||
|
||||
OsciPoint OsciPoint::nextVector(double drawingProgress){
|
||||
return OsciPoint(x, y, z);
|
||||
}
|
||||
|
||||
void OsciPoint::rotate(double rotateX, double rotateY, double rotateZ) {
|
||||
// rotate around x-axis
|
||||
double cosValue = std::cos(rotateX);
|
||||
double sinValue = std::sin(rotateX);
|
||||
double y2 = cosValue * y - sinValue * z;
|
||||
double z2 = sinValue * y + cosValue * z;
|
||||
|
||||
// rotate around y-axis
|
||||
cosValue = std::cos(rotateY);
|
||||
sinValue = std::sin(rotateY);
|
||||
double x2 = cosValue * x + sinValue * z2;
|
||||
z = -sinValue * x + cosValue * z2;
|
||||
|
||||
// rotate around z-axis
|
||||
cosValue = cos(rotateZ);
|
||||
sinValue = sin(rotateZ);
|
||||
x = cosValue * x2 - sinValue * y2;
|
||||
y = sinValue * x2 + cosValue * y2;
|
||||
}
|
||||
|
||||
void OsciPoint::normalize() {
|
||||
double mag = magnitude();
|
||||
x /= mag;
|
||||
y /= mag;
|
||||
z /= mag;
|
||||
}
|
||||
|
||||
double OsciPoint::innerProduct(OsciPoint& other) {
|
||||
return x * other.x + y * other.y + z * other.z;
|
||||
}
|
||||
|
||||
void OsciPoint::scale(double x, double y, double z) {
|
||||
this->x *= x;
|
||||
this->y *= y;
|
||||
this->z *= z;
|
||||
}
|
||||
|
||||
void OsciPoint::translate(double x, double y, double z) {
|
||||
this->x += x;
|
||||
this->y += y;
|
||||
this->z += z;
|
||||
}
|
||||
|
||||
double OsciPoint::length() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double OsciPoint::magnitude() {
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
std::unique_ptr<Shape> OsciPoint::clone() {
|
||||
return std::make_unique<OsciPoint>(x, y, z);
|
||||
}
|
||||
|
||||
std::string OsciPoint::type() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
OsciPoint& OsciPoint::operator=(const OsciPoint& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool OsciPoint::operator==(const OsciPoint& other) {
|
||||
return std::abs(x - other.x) < EPSILON && std::abs(y - other.y) < EPSILON && std::abs(z - other.z) < EPSILON;
|
||||
}
|
||||
|
||||
bool OsciPoint::operator!=(const OsciPoint& other) {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
OsciPoint OsciPoint::operator+(const OsciPoint& other) {
|
||||
return OsciPoint(x + other.x, y + other.y, z + other.z);
|
||||
}
|
||||
|
||||
OsciPoint OsciPoint::operator+(double scalar) {
|
||||
return OsciPoint(x + scalar, y + scalar, z + scalar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
OsciPoint OsciPoint::operator-(const OsciPoint& other) {
|
||||
return OsciPoint(x - other.x, y - other.y, z - other.z);
|
||||
}
|
||||
|
||||
OsciPoint OsciPoint::operator-() {
|
||||
return OsciPoint(-x, -y, -z);
|
||||
}
|
||||
|
||||
OsciPoint OsciPoint::operator*(const OsciPoint& other) {
|
||||
return OsciPoint(x * other.x, y * other.y, z * other.z);
|
||||
}
|
||||
|
||||
OsciPoint OsciPoint::operator*(double scalar) {
|
||||
return OsciPoint(x * scalar, y * scalar, z * scalar);
|
||||
}
|
||||
|
||||
std::string OsciPoint::toString() {
|
||||
return std::string("(" + std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(z) + ")");
|
||||
}
|
||||
|
||||
OsciPoint operator+(double scalar, const OsciPoint& point) {
|
||||
return OsciPoint(point.x + scalar, point.y + scalar, point.z + scalar);
|
||||
}
|
||||
|
||||
OsciPoint operator*(double scalar, const OsciPoint& point) {
|
||||
return OsciPoint(point.x * scalar, point.y * scalar, point.z * scalar);
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
class OsciPoint : public Shape {
|
||||
public:
|
||||
OsciPoint(double x, double y, double z);
|
||||
OsciPoint(double x, double y);
|
||||
OsciPoint(double val);
|
||||
OsciPoint();
|
||||
|
||||
OsciPoint nextVector(double drawingProgress) override;
|
||||
void scale(double x, double y, double z) override;
|
||||
void translate(double x, double y, double z) override;
|
||||
double length() override;
|
||||
double magnitude();
|
||||
std::unique_ptr<Shape> clone() override;
|
||||
std::string type() override;
|
||||
|
||||
void rotate(double rotateX, double rotateY, double rotateZ);
|
||||
void normalize();
|
||||
double innerProduct(OsciPoint& other);
|
||||
|
||||
std::string toString();
|
||||
|
||||
OsciPoint& operator=(const OsciPoint& other);
|
||||
bool operator==(const OsciPoint& other);
|
||||
bool operator!=(const OsciPoint& other);
|
||||
OsciPoint operator+(const OsciPoint& other);
|
||||
OsciPoint operator+(double scalar);
|
||||
friend OsciPoint operator+(double scalar, const OsciPoint& point);
|
||||
OsciPoint operator-(const OsciPoint& other);
|
||||
OsciPoint operator-();
|
||||
OsciPoint operator*(const OsciPoint& other);
|
||||
OsciPoint operator*(double scalar);
|
||||
friend OsciPoint operator*(double scalar, const OsciPoint& point);
|
||||
|
||||
double x, y, z;
|
||||
|
||||
static double EPSILON;
|
||||
};
|
|
@ -1,127 +0,0 @@
|
|||
#include "Point.h"
|
||||
|
||||
double Point::EPSILON = 0.0001;
|
||||
|
||||
Point::Point() : x(0), y(0), z(0) {}
|
||||
|
||||
Point::Point(double val) : x(val), y(val), z(0) {}
|
||||
|
||||
Point::Point(double x, double y) : x(x), y(y), z(0) {}
|
||||
|
||||
Point::Point(double x, double y, double z) : x(x), y(y), z(z) {}
|
||||
|
||||
Point Point::nextVector(double drawingProgress){
|
||||
return Point(x, y, z);
|
||||
}
|
||||
|
||||
void Point::rotate(double rotateX, double rotateY, double rotateZ) {
|
||||
// rotate around x-axis
|
||||
double cosValue = std::cos(rotateX);
|
||||
double sinValue = std::sin(rotateX);
|
||||
double y2 = cosValue * y - sinValue * z;
|
||||
double z2 = sinValue * y + cosValue * z;
|
||||
|
||||
// rotate around y-axis
|
||||
cosValue = std::cos(rotateY);
|
||||
sinValue = std::sin(rotateY);
|
||||
double x2 = cosValue * x + sinValue * z2;
|
||||
z = -sinValue * x + cosValue * z2;
|
||||
|
||||
// rotate around z-axis
|
||||
cosValue = cos(rotateZ);
|
||||
sinValue = sin(rotateZ);
|
||||
x = cosValue * x2 - sinValue * y2;
|
||||
y = sinValue * x2 + cosValue * y2;
|
||||
}
|
||||
|
||||
void Point::normalize() {
|
||||
double mag = magnitude();
|
||||
x /= mag;
|
||||
y /= mag;
|
||||
z /= mag;
|
||||
}
|
||||
|
||||
double Point::innerProduct(Point& other) {
|
||||
return x * other.x + y * other.y + z * other.z;
|
||||
}
|
||||
|
||||
void Point::scale(double x, double y, double z) {
|
||||
this->x *= x;
|
||||
this->y *= y;
|
||||
this->z *= z;
|
||||
}
|
||||
|
||||
void Point::translate(double x, double y, double z) {
|
||||
this->x += x;
|
||||
this->y += y;
|
||||
this->z += z;
|
||||
}
|
||||
|
||||
double Point::length() {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double Point::magnitude() {
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
std::unique_ptr<Shape> Point::clone() {
|
||||
return std::make_unique<Point>(x, y, z);
|
||||
}
|
||||
|
||||
std::string Point::type() {
|
||||
return std::string();
|
||||
}
|
||||
|
||||
Point& Point::operator=(const Point& other) {
|
||||
x = other.x;
|
||||
y = other.y;
|
||||
z = other.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool Point::operator==(const Point& other) {
|
||||
return std::abs(x - other.x) < EPSILON && std::abs(y - other.y) < EPSILON && std::abs(z - other.z) < EPSILON;
|
||||
}
|
||||
|
||||
bool Point::operator!=(const Point& other) {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
Point Point::operator+(const Point& other) {
|
||||
return Point(x + other.x, y + other.y, z + other.z);
|
||||
}
|
||||
|
||||
Point Point::operator+(double scalar) {
|
||||
return Point(x + scalar, y + scalar, z + scalar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Point Point::operator-(const Point& other) {
|
||||
return Point(x - other.x, y - other.y, z - other.z);
|
||||
}
|
||||
|
||||
Point Point::operator-() {
|
||||
return Point(-x, -y, -z);
|
||||
}
|
||||
|
||||
Point Point::operator*(const Point& other) {
|
||||
return Point(x * other.x, y * other.y, z * other.z);
|
||||
}
|
||||
|
||||
Point Point::operator*(double scalar) {
|
||||
return Point(x * scalar, y * scalar, z * scalar);
|
||||
}
|
||||
|
||||
std::string Point::toString() {
|
||||
return std::string("(" + std::to_string(x) + ", " + std::to_string(y) + ", " + std::to_string(z) + ")");
|
||||
}
|
||||
|
||||
Point operator+(double scalar, const Point& point) {
|
||||
return Point(point.x + scalar, point.y + scalar, point.z + scalar);
|
||||
}
|
||||
|
||||
Point operator*(double scalar, const Point& point) {
|
||||
return Point(point.x * scalar, point.y * scalar, point.z * scalar);
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include "Shape.h"
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
|
||||
class Point : public Shape {
|
||||
public:
|
||||
Point(double x, double y, double z);
|
||||
Point(double x, double y);
|
||||
Point(double val);
|
||||
Point();
|
||||
|
||||
Point nextVector(double drawingProgress) override;
|
||||
void scale(double x, double y, double z) override;
|
||||
void translate(double x, double y, double z) override;
|
||||
double length() override;
|
||||
double magnitude();
|
||||
std::unique_ptr<Shape> clone() override;
|
||||
std::string type() override;
|
||||
|
||||
void rotate(double rotateX, double rotateY, double rotateZ);
|
||||
void normalize();
|
||||
double innerProduct(Point& other);
|
||||
|
||||
std::string toString();
|
||||
|
||||
Point& operator=(const Point& other);
|
||||
bool operator==(const Point& other);
|
||||
bool operator!=(const Point& other);
|
||||
Point operator+(const Point& other);
|
||||
Point operator+(double scalar);
|
||||
friend Point operator+(double scalar, const Point& point);
|
||||
Point operator-(const Point& other);
|
||||
Point operator-();
|
||||
Point operator*(const Point& other);
|
||||
Point operator*(double scalar);
|
||||
friend Point operator*(double scalar, const Point& point);
|
||||
|
||||
double x, y, z;
|
||||
|
||||
static double EPSILON;
|
||||
};
|
|
@ -1,6 +1,6 @@
|
|||
#include "Shape.h"
|
||||
#include "Line.h"
|
||||
#include "Point.h"
|
||||
#include "OsciPoint.h"
|
||||
|
||||
double Shape::totalLength(std::vector<std::unique_ptr<Shape>>& shapes) {
|
||||
double length = 0.0;
|
||||
|
@ -30,7 +30,7 @@ void Shape::normalize(std::vector<std::unique_ptr<Shape>>& shapes) {
|
|||
shape->scale(2.0 / maxDim, -2.0 / maxDim, 2.0 / maxDim);
|
||||
}
|
||||
|
||||
Point max = maxVector(shapes);
|
||||
OsciPoint max = maxVector(shapes);
|
||||
double newHeight = height(shapes);
|
||||
|
||||
for (auto& shape : shapes) {
|
||||
|
@ -42,7 +42,7 @@ double Shape::height(std::vector<std::unique_ptr<Shape>>& shapes) {
|
|||
double maxY = std::numeric_limits<double>::min();
|
||||
double minY = std::numeric_limits<double>::max();
|
||||
|
||||
Point vectors[4];
|
||||
OsciPoint vectors[4];
|
||||
|
||||
for (auto& shape : shapes) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -62,7 +62,7 @@ double Shape::width(std::vector<std::unique_ptr<Shape>>& shapes) {
|
|||
double maxX = std::numeric_limits<double>::min();
|
||||
double minX = std::numeric_limits<double>::max();
|
||||
|
||||
Point vectors[4];
|
||||
OsciPoint vectors[4];
|
||||
|
||||
for (auto& shape : shapes) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
|
@ -78,13 +78,13 @@ double Shape::width(std::vector<std::unique_ptr<Shape>>& shapes) {
|
|||
return std::abs(maxX - minX);
|
||||
}
|
||||
|
||||
Point Shape::maxVector(std::vector<std::unique_ptr<Shape>>& shapes) {
|
||||
OsciPoint Shape::maxVector(std::vector<std::unique_ptr<Shape>>& shapes) {
|
||||
double maxX = std::numeric_limits<double>::min();
|
||||
double maxY = std::numeric_limits<double>::min();
|
||||
|
||||
for (auto& shape : shapes) {
|
||||
Point startVector = shape->nextVector(0);
|
||||
Point endVector = shape->nextVector(1);
|
||||
OsciPoint startVector = shape->nextVector(0);
|
||||
OsciPoint endVector = shape->nextVector(1);
|
||||
|
||||
double x = std::max(startVector.x, endVector.x);
|
||||
double y = std::max(startVector.y, endVector.y);
|
||||
|
@ -93,22 +93,22 @@ Point Shape::maxVector(std::vector<std::unique_ptr<Shape>>& shapes) {
|
|||
maxY = std::max(y, maxY);
|
||||
}
|
||||
|
||||
return Point(maxX, maxY);
|
||||
return OsciPoint(maxX, maxY);
|
||||
}
|
||||
|
||||
void Shape::removeOutOfBounds(std::vector<std::unique_ptr<Shape>>& shapes) {
|
||||
std::vector<int> toRemove;
|
||||
|
||||
for (int i = 0; i < shapes.size(); i++) {
|
||||
Point start = shapes[i]->nextVector(0);
|
||||
Point end = shapes[i]->nextVector(1);
|
||||
OsciPoint start = shapes[i]->nextVector(0);
|
||||
OsciPoint end = shapes[i]->nextVector(1);
|
||||
bool keep = false;
|
||||
|
||||
if ((start.x < 1 && start.x > -1) || (start.y < 1 && start.y > -1)) {
|
||||
if ((end.x < 1 && end.x > -1) || (end.y < 1 && end.y > -1)) {
|
||||
if (shapes[i]->type() == "Line") {
|
||||
Point newStart(std::min(std::max(start.x, -1.0), 1.0), std::min(std::max(start.y, -1.0), 1.0));
|
||||
Point newEnd(std::min(std::max(end.x, -1.0), 1.0), std::min(std::max(end.y, -1.0), 1.0));
|
||||
OsciPoint newStart(std::min(std::max(start.x, -1.0), 1.0), std::min(std::max(start.y, -1.0), 1.0));
|
||||
OsciPoint newEnd(std::min(std::max(end.x, -1.0), 1.0), std::min(std::max(end.y, -1.0), 1.0));
|
||||
shapes[i] = std::make_unique<Line>(newStart.x, newStart.y, newEnd.x, newEnd.y);
|
||||
}
|
||||
keep = true;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class Point;
|
||||
class OsciPoint;
|
||||
class Shape {
|
||||
public:
|
||||
virtual Point nextVector(double drawingProgress) = 0;
|
||||
virtual OsciPoint nextVector(double drawingProgress) = 0;
|
||||
virtual void scale(double x, double y, double z) = 0;
|
||||
virtual void translate(double x, double y, double z) = 0;
|
||||
virtual double length() = 0;
|
||||
|
@ -21,10 +21,10 @@ public:
|
|||
static void normalize(std::vector<std::unique_ptr<Shape>>&);
|
||||
static double height(std::vector<std::unique_ptr<Shape>>&);
|
||||
static double width(std::vector<std::unique_ptr<Shape>>&);
|
||||
static Point maxVector(std::vector<std::unique_ptr<Shape>>&);
|
||||
static OsciPoint maxVector(std::vector<std::unique_ptr<Shape>>&);
|
||||
static void removeOutOfBounds(std::vector<std::unique_ptr<Shape>>&);
|
||||
|
||||
const double INVALID_LENGTH = -1.0;
|
||||
|
||||
double len = INVALID_LENGTH;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Shape.h"
|
||||
|
||||
|
@ -14,4 +14,4 @@ public:
|
|||
private:
|
||||
|
||||
std::vector<std::unique_ptr<Shape>> shapes;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
#include "../shape/Shape.h"
|
||||
|
||||
|
@ -11,4 +11,4 @@ public:
|
|||
std::vector<std::unique_ptr<Shape>> draw();
|
||||
private:
|
||||
std::vector<std::unique_ptr<Shape>> shapes;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -25,19 +25,19 @@ void WavParser::setSampleRate(double sampleRate) {
|
|||
currentSampleRate = sampleRate;
|
||||
}
|
||||
|
||||
Point WavParser::getSample() {
|
||||
OsciPoint WavParser::getSample() {
|
||||
if (currentSampleRate != audioProcessor.currentSampleRate) {
|
||||
setSampleRate(audioProcessor.currentSampleRate);
|
||||
}
|
||||
if (source == nullptr) {
|
||||
return Point();
|
||||
return OsciPoint();
|
||||
}
|
||||
|
||||
source->getNextAudioBlock(juce::AudioSourceChannelInfo(audioBuffer));
|
||||
|
||||
if (audioBuffer.getNumChannels() == 1) {
|
||||
return Point(audioBuffer.getSample(0, 0), audioBuffer.getSample(0, 0));
|
||||
return OsciPoint(audioBuffer.getSample(0, 0), audioBuffer.getSample(0, 0));
|
||||
} else {
|
||||
return Point(audioBuffer.getSample(0, 0), audioBuffer.getSample(1, 0));
|
||||
return OsciPoint(audioBuffer.getSample(0, 0), audioBuffer.getSample(1, 0));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#pragma once
|
||||
#include "../shape/Point.h"
|
||||
#include "../shape/OsciPoint.h"
|
||||
#include <JuceHeader.h>
|
||||
|
||||
class OscirenderAudioProcessor;
|
||||
|
@ -8,7 +8,7 @@ public:
|
|||
WavParser(OscirenderAudioProcessor& p, std::unique_ptr<juce::InputStream> stream);
|
||||
~WavParser();
|
||||
|
||||
Point getSample();
|
||||
OsciPoint getSample();
|
||||
|
||||
private:
|
||||
void setSampleRate(double sampleRate);
|
||||
|
@ -19,4 +19,4 @@ private:
|
|||
int fileSampleRate;
|
||||
int currentSampleRate;
|
||||
OscirenderAudioProcessor& audioProcessor;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 17edebcc64d9dc96a9c0b0c7e9b9bd1673a585f9
|
|
@ -556,6 +556,8 @@
|
|||
<FILE id="hCrVUD" name="FrameSource.h" compile="0" resource="0" file="Source/parser/FrameSource.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{92CEA658-C82C-9CEB-15EB-945EF6B6B5C8}" name="shape">
|
||||
<FILE id="XkKRyp" name="OsciPoint.cpp" compile="1" resource="0" file="Source/shape/OsciPoint.cpp"/>
|
||||
<FILE id="AnooP3" name="OsciPoint.h" compile="0" resource="0" file="Source/shape/OsciPoint.h"/>
|
||||
<FILE id="iglTFG" name="CircleArc.cpp" compile="1" resource="0" file="Source/shape/CircleArc.cpp"/>
|
||||
<FILE id="T3S8Sg" name="CircleArc.h" compile="0" resource="0" file="Source/shape/CircleArc.h"/>
|
||||
<FILE id="G5fbub" name="Shape.cpp" compile="1" resource="0" file="Source/shape/Shape.cpp"/>
|
||||
|
@ -569,8 +571,6 @@
|
|||
file="Source/shape/QuadraticBezierCurve.h"/>
|
||||
<FILE id="W19EPg" name="Line.cpp" compile="1" resource="0" file="Source/shape/Line.cpp"/>
|
||||
<FILE id="i1A2s1" name="Line.h" compile="0" resource="0" file="Source/shape/Line.h"/>
|
||||
<FILE id="nUpro8" name="Point.cpp" compile="1" resource="0" file="Source/shape/Point.cpp"/>
|
||||
<FILE id="X6A0jk" name="Point.h" compile="0" resource="0" file="Source/shape/Point.h"/>
|
||||
<FILE id="NmptSY" name="Shape.h" compile="0" resource="0" file="Source/shape/Shape.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{56A27063-1FE7-31C3-8263-98389240A8CB}" name="svg">
|
||||
|
@ -666,6 +666,14 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</LINUX_MAKE>
|
||||
<VS2022 targetFolder="Builds/VisualStudio2022" smallIcon="pSc1mq" bigIcon="pSc1mq">
|
||||
|
@ -690,6 +698,14 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</VS2022>
|
||||
<XCODE_MAC targetFolder="Builds/MacOSX" extraLinkerFlags="-Wl,-weak_reference_mismatches,weak"
|
||||
|
@ -716,10 +732,28 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</XCODE_MAC>
|
||||
</EXPORTFORMATS>
|
||||
<MODULES>
|
||||
<MODULE id="chowdsp_buffers" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_core" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_data_structures" showAllCode="1" useLocalCopy="0"
|
||||
useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_dsp_data_structures" showAllCode="1" useLocalCopy="0"
|
||||
useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_dsp_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_filters" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_math" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_simd" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="juce_animation" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
<MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
<MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
|
|
38
sosci.jucer
38
sosci.jucer
|
@ -103,9 +103,9 @@
|
|||
file="Source/concurrency/ConsumerManager.h"/>
|
||||
</GROUP>
|
||||
<GROUP id="{92CEA658-C82C-9CEB-15EB-945EF6B6B5C8}" name="shape">
|
||||
<FILE id="VdK1eT" name="OsciPoint.cpp" compile="1" resource="0" file="Source/shape/OsciPoint.cpp"/>
|
||||
<FILE id="rjbwYE" name="OsciPoint.h" compile="0" resource="0" file="Source/shape/OsciPoint.h"/>
|
||||
<FILE id="G5fbub" name="Shape.cpp" compile="1" resource="0" file="Source/shape/Shape.cpp"/>
|
||||
<FILE id="nUpro8" name="Point.cpp" compile="1" resource="0" file="Source/shape/Point.cpp"/>
|
||||
<FILE id="X6A0jk" name="Point.h" compile="0" resource="0" file="Source/shape/Point.h"/>
|
||||
<FILE id="NmptSY" name="Shape.h" compile="0" resource="0" file="Source/shape/Shape.h"/>
|
||||
</GROUP>
|
||||
<FILE id="d2zFqF" name="LookAndFeel.cpp" compile="1" resource="0" file="Source/LookAndFeel.cpp"/>
|
||||
|
@ -146,6 +146,14 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</LINUX_MAKE>
|
||||
<VS2022 targetFolder="Builds/sosci/VisualStudio2022" smallIcon="pSc1mq"
|
||||
|
@ -171,6 +179,14 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</VS2022>
|
||||
<XCODE_MAC targetFolder="Builds/sosci/MacOSX" extraLinkerFlags="-Wl,-weak_reference_mismatches,weak"
|
||||
|
@ -197,10 +213,28 @@
|
|||
<MODULEPATH id="juce_opengl" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_dsp" path="../../JUCE/modules"/>
|
||||
<MODULEPATH id="juce_animation" path="../../../JUCE/modules"/>
|
||||
<MODULEPATH id="chowdsp_dsp_utils" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_filters" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_dsp_data_structures" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_simd" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_buffers" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_math" path="modules/chowdsp_utils/modules/dsp"/>
|
||||
<MODULEPATH id="chowdsp_core" path="modules/chowdsp_utils/modules/common"/>
|
||||
<MODULEPATH id="chowdsp_data_structures" path="modules/chowdsp_utils/modules/common"/>
|
||||
</MODULEPATHS>
|
||||
</XCODE_MAC>
|
||||
</EXPORTFORMATS>
|
||||
<MODULES>
|
||||
<MODULE id="chowdsp_buffers" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_core" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_data_structures" showAllCode="1" useLocalCopy="0"
|
||||
useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_dsp_data_structures" showAllCode="1" useLocalCopy="0"
|
||||
useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_dsp_utils" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_filters" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_math" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="chowdsp_simd" showAllCode="1" useLocalCopy="0" useGlobalPath="0"/>
|
||||
<MODULE id="juce_animation" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
<MODULE id="juce_audio_basics" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
<MODULE id="juce_audio_devices" showAllCode="1" useLocalCopy="0" useGlobalPath="1"/>
|
||||
|
|
Ładowanie…
Reference in New Issue