Merge 'develop' into polygon-bitcrush

pull/322/head
Anthony Hall 2025-09-04 00:31:27 -07:00
commit 5dedb0ab22
7 zmienionych plików z 47 dodań i 3 usunięć

Wyświetl plik

@ -10,6 +10,7 @@ jobs:
build:
name: Build (${{ matrix.project }} ${{ matrix.version }} @ ${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:

Wyświetl plik

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"/></svg>

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 192 B

Wyświetl plik

@ -26,6 +26,7 @@
#include "audio/RippleEffect.h"
#include "audio/SwirlEffect.h"
#include "audio/BounceEffect.h"
#include "audio/SkewEffect.h"
#include "parser/FileParser.h"
#include "parser/FrameProducer.h"
@ -55,6 +56,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor() : CommonAudioProcessor(Buse
toggleableEffects.push_back(KaleidoscopeEffect(*this).build());
toggleableEffects.push_back(BounceEffect().build());
toggleableEffects.push_back(TwistEffect().build());
toggleableEffects.push_back(SkewEffect().build());
toggleableEffects.push_back(PolygonBitCrushEffect().build());
#endif

Wyświetl plik

@ -9,13 +9,13 @@ public:
explicit MultiplexEffect(OscirenderAudioProcessor &p) : audioProcessor(p) {}
osci::Point apply(int index, osci::Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override {
jassert(values.size() >= 5);
jassert(values.size() == 5);
double gridX = values[0].load() + 0.0001;
double gridY = values[1].load() + 0.0001;
double gridZ = values[2].load() + 0.0001;
double interpolation = values[3].load();
double gridDelay = values[5].load();
double gridDelay = values[4].load();
head++;
if (head >= (int)buffer.size()) {

Wyświetl plik

@ -0,0 +1,38 @@
#pragma once
#include <JuceHeader.h>
#include <numbers>
// Simple shear (skew) along each axis: X += skewX * Y, Y += skewY * Z, Z += skewZ * X
// Useful subtle perspective-like distortion that can be layered with scale/rotate.
class SkewEffect : public osci::EffectApplication {
public:
SkewEffect() {}
osci::Point apply(int /*index*/, osci::Point input, const std::vector<std::atomic<double>>& values, double /*sampleRate*/) override {
jassert(values.size() == 3);
double tx = values[0].load(); // skew X by Y
double ty = values[1].load(); // skew Y by Z
double tz = values[2].load(); // skew Z by X
// Apply sequential shears; keep original components where appropriate to avoid compounding order surprises.
osci::Point out = input;
out.x += tx * input.y; // shear X by Y
out.y += ty * input.z; // shear Y by Z
out.z += tz * input.x; // shear Z by X
return out;
}
std::shared_ptr<osci::Effect> build() const override {
auto eff = std::make_shared<osci::Effect>(
std::make_shared<SkewEffect>(),
std::vector<osci::EffectParameter*>{
new osci::EffectParameter("Skew X", "Skews (shears) the shape horizontally based on vertical position.", "skewX", VERSION_HINT, 0.0, -1.0, 1.0, 0.0001f, osci::LfoType::Sine, 0.2f),
new osci::EffectParameter("Skew Y", "Skews (shears) the shape vertically based on depth.", "skewY", VERSION_HINT, 0.0, -1.0, 1.0),
new osci::EffectParameter("Skew Z", "Skews (shears) the shape in depth based on horizontal position.", "skewZ", VERSION_HINT, 0.0, -1.0, 1.0),
}
);
eff->setName("Skew");
eff->setIcon(BinaryData::skew_svg);
return eff;
}
};

Wyświetl plik

@ -103,7 +103,7 @@ void VisualiserRenderer::runTask(const std::vector<osci::Point> &points) {
#if OSCI_PREMIUM
if (parameters.isGoniometer()) {
// x and y go to a diagonal currently, so we need to scale them down, and rotate them
point.scale(1.0 / std::sqrt(2.0), 1.0 / std::sqrt(2.0), 1.0);
point.scale(-1.0 / std::sqrt(2.0), 1.0 / std::sqrt(2.0), 1.0);
point.rotate(0, 0, -juce::MathConstants<double>::pi / 4);
}
#endif

Wyświetl plik

@ -137,6 +137,7 @@
<FILE id="cUDYOM" name="scale.svg" compile="0" resource="1" file="Resources/svg/scale.svg"/>
<FILE id="X2NZYP" name="shapes.svg" compile="0" resource="1" file="Resources/svg/shapes.svg"/>
<FILE id="kElsj1" name="shuttle.svg" compile="0" resource="1" file="Resources/svg/shuttle.svg"/>
<FILE id="GzW5ze" name="skew.svg" compile="0" resource="1" file="Resources/svg/skew.svg"/>
<FILE id="OiOWD6" name="skull.svg" compile="0" resource="1" file="Resources/svg/skull.svg"/>
<FILE id="ZPUNcg" name="smoothing.svg" compile="0" resource="1" file="Resources/svg/smoothing.svg"/>
<FILE id="XxYNOy" name="snowflake.svg" compile="0" resource="1" file="Resources/svg/snowflake.svg"/>
@ -165,6 +166,7 @@
</GROUP>
<GROUP id="{75439074-E50C-362F-1EDF-8B4BE9011259}" name="Source">
<GROUP id="{85A33213-D880-BD92-70D8-1901DA6D23F0}" name="audio">
<FILE id="tU2pQl" name="SkewEffect.h" compile="0" resource="0" file="Source/audio/SkewEffect.h"/>
<FILE id="GJoA2i" name="PolygonBitCrushEffect.h" compile="0" resource="0"
file="Source/audio/PolygonBitCrushEffect.h"/>
<FILE id="HE3dFE" name="AudioRecorder.h" compile="0" resource="0" file="Source/audio/AudioRecorder.h"/>