3#include "../Animation.h"
4#include "../KeyFrameTrack.h"
5#include "../EasyEaseAnimator.h"
6#include "../../Objects/Background.h"
7#include "../../Objects/LEDStripBackgroundWS35.h"
9#include "../../Morph/Commissions/XenraxFace.h"
11#include "../../Render/Scene.h"
12#include "../../Signals/FunctionGenerator.h"
13#include "../../Menu/SingleButtonMenu.h"
14#include "../../Sensors/APDS9960.h"
15#include "../../Sensors/MMC56X3.h"
17#include "../../Materials/Animated/RainbowNoise.h"
18#include "../../Materials/Animated/RainbowSpiral.h"
19#include "../../Materials/Animated/SpectrumAnalyzer.h"
20#include "../../Materials/Animated/AudioReactiveGradient.h"
21#include "../../Materials/Animated/Oscilloscope.h"
23#include "../../Materials/MaterialAnimator.h"
25#include "../AnimationTracks/BlinkTrack.h"
27#include "../../Signals/FFTVoiceDetection.h"
29#include "../../Sensors/MicrophoneFourier_MAX9814.h"
31#include "../../Render/ObjectAlign.h"
33#include "../../Screenspace/GlitchX.h"
34#include "../../Screenspace/Fisheye.h"
35#include "../../Screenspace/HorizontalBlur.h"
36#include "../../Screenspace/PhaseOffsetX.h"
37#include "../../Screenspace/PhaseOffsetY.h"
38#include "../../Screenspace/PhaseOffsetR.h"
39#include "../../Screenspace/Magnet.h"
40#include "../../Screenspace/Overflow.h"
41#include "../../Screenspace/RadialBlur.h"
42#include "../../Screenspace/ShiftR.h"
43#include "../../Screenspace/VerticalBlur.h"
44#include "../../Screenspace/Test.h"
133 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Battery), XenraxFace::Battery, 30, 0.0f, 1.0f);
134 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::BatteryFull), XenraxFace::BatteryFull, 10, 0.0f, 1.0f);
135 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Boop), XenraxFace::Boop, 5, 0.0f, 1.0f);
136 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Angry), XenraxFace::Angry, 15, 0.0f, 1.0f);
137 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Hypno), XenraxFace::Hypno, 45, 0.0f, 1.0f);
138 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Hearts), XenraxFace::Hearts, 30, 0.0f, 1.0f);
139 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Sleeping), XenraxFace::Sleeping, 30, 0.0f, 1.0f);
140 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::Dead), XenraxFace::Dead, 30, 0.0f, 1.0f);
141 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::BSOD), XenraxFace::BSOD, 30, 0.0f, 1.0f);
142 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::SpinSpiral), XenraxFace::SpinSpiral, 5, 0.0f, 1.0f);
143 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::HideSpiral), XenraxFace::HideSpiral, 30, 1.0f, 0.0f);
144 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::MoveZZZ), XenraxFace::MoveZZZ, 5, 0.0f, 1.0f);
145 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::HideZZZ), XenraxFace::HideZZZ, 30, 1.0f, 0.0f);
146 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::MoveHearts), XenraxFace::MoveHearts, 5, 0.0f, 1.0f);
147 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::HideHearts), XenraxFace::HideHearts, 30, 1.0f, 0.0f);
149 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_ee), XenraxFace::vrc_v_ee, 2, 0.0f, 1.0f);
150 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_ih), XenraxFace::vrc_v_ih, 2, 0.0f, 1.0f);
151 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_dd), XenraxFace::vrc_v_dd, 2, 0.0f, 1.0f);
152 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_rr), XenraxFace::vrc_v_rr, 2, 0.0f, 1.0f);
153 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_ch), XenraxFace::vrc_v_ch, 2, 0.0f, 1.0f);
154 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_aa), XenraxFace::vrc_v_aa, 2, 0.0f, 1.0f);
155 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_oh), XenraxFace::vrc_v_oh, 2, 0.0f, 1.0f);
156 eEA.
AddParameter(
pM.GetMorphWeightReference(XenraxFace::vrc_v_ss), XenraxFace::vrc_v_ss, 2, 0.0f, 1.0f);
210 scene.DisableEffect();
216 scene.DisableEffect();
228 scene.DisableEffect();
237 scene.DisableEffect();
247 scene.EnableEffect();
258 scene.DisableEffect();
268 scene.DisableEffect();
278 scene.DisableEffect();
288 scene.EnableEffect();
298 scene.DisableEffect();
308 scene.DisableEffect();
318 scene.DisableEffect();
331 if(MicrophoneFourierIT::GetCurrentMagnitude() > 0.05f){
332 voiceDetection.
Update(MicrophoneFourierIT::GetFourierFiltered(), MicrophoneFourierIT::GetSampleRate());
362 scene.AddObject(
pM.GetObject());
380 MicrophoneFourierIT::Initialize(22, 8000, 50.0f, 120.0f);
402 return pM.GetObject();
448 MicrophoneFourierIT::Update();
454 aRG.
SetSize(
Vector2D((xOffset + 2.0f) * 10.0f + 50.0f, (xOffset + 2.0f) * 10.0f + 50.0f));
467 if (isBooped && mode != 6){
470 else if(isMagn && mode != 6){
476 else if (mode == 2)
Angry();
477 else if (mode == 3)
Hearts();
479 else if (mode == 5)
Dead();
480 else if (mode == 6)
BSOD();
481 else if (mode == 7) {
482 aRG.
Update(MicrophoneFourierIT::GetFourierFiltered());
486 oSC.
Update(MicrophoneFourierIT::GetSamples());
490 sA.
Update(MicrophoneFourierIT::GetFourierFiltered());
510 float faceSizeOffset = faceSize * 8.0f;
518 pM.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset, yOffset, 0.0f));
519 pM.GetObject()->UpdateTransform();
A class for managing the Adafruit APDS9960 sensor.
static bool Initialize(uint8_t threshold)
Initializes the APDS9960 sensor.
static bool isBooped()
Checks if the sensor is "booped" (close proximity detected).
void AddParameter(float *parameter)
Adds a parameter to the animation track.
void Play()
Starts or resumes playback of the animation track.
void Pause()
Pauses playback of the animation track.
float Update()
Updates the animation track and returns the current parameter value.
A material class for creating an audio-reactive gradient effect.
void SetRadius(float radius)
Sets the radius for circular gradient patterns.
void SetPosition(Vector2D offset)
Sets the position of the gradient.
void Update(float *readData)
Updates the gradient based on new audio data.
void SetSize(Vector2D size)
Sets the size of the gradient.
void SetRotation(float angle)
Sets the rotation angle of the gradient.
void SetHueAngle(float hueAngle)
Sets the hue angle for color adjustments.
A template class for animating eye blinking using keyframes.
A template class for implementing advanced animation easing.
void AddParameterFrame(uint16_t dictionaryValue, float value) override
Adds a single frame value for a parameter.
void Update() override
Updates the animator, advancing all animations.
void SetInterpolationMethod(uint16_t dictionaryValue, InterpolationMethod interpMethod) override
Sets the interpolation method for a specific parameter.
void AddParameter(float *parameter, uint16_t dictionaryValue, uint16_t frames, float basis, float goal) override
Adds a parameter to the animator.
void SetRatio(float ratio)
Sets the scaling ratio for the effect.
Detects visemes based on FFT voice analysis.
float GetViseme(MouthShape viseme)
Retrieves the probability of a specific viseme.
void SetThreshold(float threshold)
Sets the threshold for formant calculations.
void Update(float *peaks, float maxFrequency)
Updates the viseme probabilities based on new FFT data.
Implements a fisheye distortion effect for pixel groups.
A class to generate various waveform functions with customizable parameters.
@ Sawtooth
Sawtooth waveform.
@ Triangle
Triangle waveform.
float Update()
Updates and calculates the next value of the waveform.
Implements a glitch effect along the X-axis for pixel groups.
Creates a customizable gradient material for rendering.
void SetRotationAngle(float rotationAngle)
Sets the rotation angle for the gradient.
void GradientShift(float ratio)
Shifts the gradient by a ratio.
Implements a horizontal blur effect for pixel groups.
A class for managing the Adafruit MMC56x3 magnetometer sensor.
Implements a magnetic distortion effect for pixel groups.
void SetPosition(Vector2D offset)
Sets the central position of the magnetic effect.
Animates transitions and blends between multiple materials.
void AddMaterial(Material::Method method, Material *material, uint16_t frames, float minOpacity, float maxOpacity)
Adds a material to the animation with specified properties.
void SetBaseMaterial(Material::Method method, Material *material)
Sets the base material for the animation.
void AddMaterialFrame(Material &material, float opacity)
Adds a specific frame for a material in the animation.
void Update()
Updates the animator, advancing the transitions.
@ Add
Adds colors together.
@ Replace
Replaces the base color.
Represents a 3D object with geometry, material, and transformation data.
Handles aligning and transforming 3D objects to fit within specified 2D camera bounds.
void SetEdgeMargin(float edgeMargin)
Sets the margin to keep from the edges when aligning objects.
@ Stretch
Attempt to scale the object(s) to fill the entire area.
void SetJustification(Justification jst)
Sets the justification mode for alignment.
void SetPlaneOffsetAngle(float offsetPlaneAngle)
Sets the additional rotation offset (plane offset angle), in degrees or radians, that will be applied...
void SetCameraMax(Vector2D camMax)
Updates the maximum bounds for the 2D camera region.
void AlignObjects(Object3D **objs, uint8_t numObjects)
Aligns multiple objects within the camera bounds, including scale factors.
void SetMirrorX(bool mirrorX)
Enables or disables mirroring along the X-axis for the aligned objects.
A dynamic oscilloscope material for visualizing audio signals.
void SetPosition(Vector2D offset)
Sets the position of the oscilloscope visualization.
void SetSize(Vector2D size)
Sets the size of the oscilloscope visualization.
void Update(float *data)
Updates the oscilloscope visualization based on new audio data.
void SetHueAngle(float hueAngle)
Sets the hue angle for color adjustments.
Implements an overflow distortion effect for pixel groups.
Applies rotational phase offsets to pixel groups.
Applies horizontal phase offsets to pixel groups.
Applies vertical phase offsets to pixel groups.
A mathematical construct representing a rotation in 3D space.
Represents an RGB color and provides methods for manipulation.
Applies a radial blur effect to pixel groups.
A dynamic material that creates a rainbow effect using simplex noise.
void Update(float ratio)
Updates the material animation based on the time ratio.
A dynamic material creating a colorful rainbow spiral animation.
void Update(float ratio)
Updates the material animation based on the time ratio.
Radially shifts the red, green, and blue channels of the pixels.
A material that applies a single, solid RGB color to surfaces.
A material that visualizes audio data as a spectrum.
void SetMirrorYState(bool state)
Sets the mirroring state for the visualization.
void Update(float *readData)
Updates the spectrum visualization with new audio data.
void SetFlipYState(bool state)
Sets the flipping state for the visualization.
void SetHueAngle(float hueAngle)
Sets the hue adjustment angle for the spectrum colors.
A debugging effect used to identify memory issues in pixel rendering.
Represents a 2D vector (X, Y) and provides methods for vector arithmetic.
Represents a 3D vector (X, Y, Z) and provides methods for vector arithmetic.
float X
The X-component of the 3D vector.
float Y
The Y-component of the 3D vector.
An effect that applies a vertical blur to a pixel group.
@ ER
Mouth shape corresponding to the "ER" sound.
@ OO
Mouth shape corresponding to the "OO" sound.
@ AH
Mouth shape corresponding to the "AH" sound.
@ UH
Mouth shape corresponding to the "UH" sound.
@ AR
Mouth shape corresponding to the "AR" sound.
@ EE
Mouth shape corresponding to the "EE" sound.
FunctionGenerator fGenMatHue
SimpleMaterial greenMaterial
FunctionGenerator fGenMatYMove
FunctionGenerator fGenBattery
MaterialAnimator< 5 > backgroundMaterial
SimpleMaterial pinkMaterial
FunctionGenerator fGenMove
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
FunctionGenerator fGenMatRMenu
void AudioReactiveGradientFace()
GradientMaterial< 3 > audioGrad
SimpleMaterial yellowMaterial
void ChangeInterpolationMethods()
RGBColor batterySpectrum[2]
GradientMaterial< 2 > gradientMat
void SpectrumAnalyzerFace()
FunctionGenerator fGenMatPos
FunctionGenerator fGenScale
GradientMaterial< 2 > batteryGrad
FunctionGenerator fGenRotation
EasyEaseAnimator< 30 > eEA
SimpleMaterial orangeMaterial
FunctionGenerator fGenMatXMenu
LEDStripBackgroundWS35 ledStripBackground
void FadeIn(float stepRatio) override
RGBColor audioSpectrum[3]
void FadeOut(float stepRatio) override
RainbowNoise rainbowNoise
FunctionGenerator fGenMatYMenu
FunctionGenerator fGenMatXMove
SimpleMaterial purpleMaterial
void Update(float ratio) override
static const uint8_t faceCount
FFTVoiceDetection< 128 > voiceDetection
FunctionGenerator fGenBlur
RGBColor gradientSpectrum[2]
MaterialAnimator< 15 > materialAnimator
uint8_t GetAccentBrightness()
SimpleMaterial whiteMaterial
AudioReactiveGradient aRG