kopia lustrzana https://github.com/jameshball/osci-render
Change default values for bounce effect and kaleidoscope effect
rodzic
2facd66ef8
commit
61a952ef61
|
|
@ -21,7 +21,7 @@
|
|||
#include "audio/TranslateEffect.h"
|
||||
#include "audio/RippleEffect.h"
|
||||
#include "audio/SwirlEffect.h"
|
||||
#include "audio/PhysicsBounceEffect.h"
|
||||
#include "audio/BounceEffect.h"
|
||||
#include "parser/FileParser.h"
|
||||
#include "parser/FrameProducer.h"
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ OscirenderAudioProcessor::OscirenderAudioProcessor() : CommonAudioProcessor(Buse
|
|||
toggleableEffects.push_back(BulgeEffect().build());
|
||||
toggleableEffects.push_back(MultiplexEffect().build());
|
||||
toggleableEffects.push_back(KaleidoscopeEffect().build());
|
||||
toggleableEffects.push_back(PhysicsBounceEffect().build());
|
||||
toggleableEffects.push_back(BounceEffect().build());
|
||||
toggleableEffects.push_back(VectorCancellingEffect().build());
|
||||
{
|
||||
auto scaleEffect = ScaleEffectApp().build();
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
// PhysicsBounceEffect.h (Simplified DVD-style 2D bounce)
|
||||
// BounceEffect.h (Simplified DVD-style 2D bounce)
|
||||
// Scales the original shape, then translates it within [-1,1] x [-1,1] using
|
||||
// constant-velocity motion that bounces off the edges. Z coordinate is unchanged.
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
|
||||
class PhysicsBounceEffect : public osci::EffectApplication {
|
||||
class BounceEffect : public osci::EffectApplication {
|
||||
public:
|
||||
osci::Point apply(int index, osci::Point input, const std::vector<std::atomic<double>>& values, double sampleRate) override {
|
||||
// values[0] = size (0.05..1.0)
|
||||
|
|
@ -40,11 +40,11 @@ public:
|
|||
|
||||
std::shared_ptr<osci::Effect> build() const override {
|
||||
auto eff = std::make_shared<osci::Effect>(
|
||||
std::make_shared<PhysicsBounceEffect>(),
|
||||
std::make_shared<BounceEffect>(),
|
||||
std::vector<osci::EffectParameter*>{
|
||||
new osci::EffectParameter("Bounce Size", "Size (scale) of the bouncing object.", "bounceSize", VERSION_HINT, 0.3, 0.05, 1.0),
|
||||
new osci::EffectParameter("Bounce Speed", "Speed of motion.", "bounceSpeed", VERSION_HINT, 0.6, 0.0, 2.0),
|
||||
new osci::EffectParameter("Bounce Angle", "Direction of travel (0..1 -> 0..360°).", "bounceAngle", VERSION_HINT, 0.125, 0.0, 1.0, 0.0001f, osci::LfoType::Sawtooth, 0.05f),
|
||||
new osci::EffectParameter("Bounce Speed", "Speed of motion.", "bounceSpeed", VERSION_HINT, 5.0, 0.0, 10.0),
|
||||
new osci::EffectParameter("Bounce Angle", "Direction of travel (0..1 -> 0..360°).", "bounceAngle", VERSION_HINT, 0.16, 0.0, 1.0),
|
||||
}
|
||||
);
|
||||
eff->setName("Bounce");
|
||||
|
|
@ -11,7 +11,7 @@ public:
|
|||
osci::Point apply(int /*index*/, osci::Point input, const std::vector<std::atomic<double>>& values, double /*sampleRate*/) override {
|
||||
// values[0] = segments (can be fractional)
|
||||
// values[1] = phase (0-1) selecting which segment is currently being drawn
|
||||
double segments = juce::jlimit(1.0, 256.0, values[0].load());
|
||||
double segments = juce::jmax(values[0].load(), 1.0); // ensure at least 1 segment
|
||||
double phase = values.size() > 1 ? values[1].load() : 0.0;
|
||||
|
||||
// Polar conversion
|
||||
|
|
@ -60,9 +60,12 @@ public:
|
|||
"Controls how many times the image is rotationally repeated around the centre. Fractional values smoothly morph the repetition.",
|
||||
"kaleidoscopeSegments",
|
||||
VERSION_HINT,
|
||||
6.0, // default
|
||||
3.0, // default
|
||||
1.0, // min
|
||||
32.0 // max
|
||||
10.0, // max
|
||||
0.0001f, // step
|
||||
osci::LfoType::Sine,
|
||||
0.25f // LFO frequency (Hz) – slow, visible rotation
|
||||
),
|
||||
new osci::EffectParameter(
|
||||
"Kaleidoscope Phase",
|
||||
|
|
@ -74,7 +77,7 @@ public:
|
|||
1.0, // max
|
||||
0.0001f, // step
|
||||
osci::LfoType::Sawtooth,
|
||||
0.5f // LFO frequency (Hz) – slow, visible rotation
|
||||
55.0f // LFO frequency (Hz) – slow, visible rotation
|
||||
),
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 60248476481e11bb86e0687869505e661249033b
|
||||
Subproject commit fedc2463e64e13f1348d49ae6504d31c9db41cc0
|
||||
|
|
@ -112,8 +112,7 @@
|
|||
file="Source/audio/MultiplexEffect.h"/>
|
||||
<FILE id="kAlEiD" name="KaleidoscopeEffect.h" compile="0" resource="0"
|
||||
file="Source/audio/KaleidoscopeEffect.h"/>
|
||||
<FILE id="bNcEfx" name="PhysicsBounceEffect.h" compile="0" resource="0"
|
||||
file="Source/audio/PhysicsBounceEffect.h"/>
|
||||
<FILE id="bNcEfx" name="BounceEffect.h" compile="0" resource="0" file="Source/audio/BounceEffect.h"/>
|
||||
<FILE id="h0dMim" name="PerspectiveEffect.h" compile="0" resource="0"
|
||||
file="Source/audio/PerspectiveEffect.h"/>
|
||||
<FILE id="t5g8pf" name="PublicSynthesiser.h" compile="0" resource="0"
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue