3#include "../Animation.h"
4#include "../AnimationTracks/BlinkTrack.h"
5#include "../KeyFrameTrack.h"
6#include "../EasyEaseAnimator.h"
7#include "../../Objects/Background.h"
8#include "../../Objects/LEDStripBackground.h"
9#include "../../Morph/Commissions/StrawberryBlush.h"
10#include "../../Morph/Commissions/StrawberryFace.h"
11#include "../../Morph/Commissions/StrawberryStinky.h"
12#include "../../Morph/Commissions/StrawberryTears.h"
13#include "../../Render/Scene.h"
14#include "../../Menu/Menu.h"
15#include "../../Signals/FunctionGenerator.h"
16#include "../../Signals/FFTVoiceDetection.h"
17#include "../../Sensors/BoopSensor.h"
18#include "../../Sensors/MicrophoneFourier_MAX9814.h"
19#include "../../Render/ObjectAlign.h"
21#include "../../Materials/Animated/RainbowNoise.h"
22#include "../../Materials/Animated/RainbowSpiral.h"
23#include "../../Materials/Animated/SpectrumAnalyzer.h"
24#include "../../Materials/Animated/AudioReactiveGradient.h"
25#include "../../Materials/Animated/Oscilloscope.h"
26#include "../../Materials/MaterialAnimator.h"
27#include "../../Materials/MaterialMask.h"
29#include "../../Shapes/Circle.h"
30#include "../../Shapes/Ellipse.h"
112 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Happy), StrawberryFace::Happy, 30, 0.0f, 1.0f);
113 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Happy2), StrawberryFace::Happy2, 30, 0.0f, 1.0f);
114 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::HappyPog), StrawberryFace::HappyPog, 20, 0.0f, 1.0f);
115 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Happy3), StrawberryFace::Happy3, 30, 0.0f, 1.0f);
116 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Content), StrawberryFace::Content, 45, 0.0f, 1.0f);
117 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::PogHeart), StrawberryFace::PogHeart, 30, 0.0f, 1.0f);
118 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::HappySurprised), StrawberryFace::HappySurprised, 15, 0.0f, 1.0f);
119 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Nervous), StrawberryFace::Nervous, 30, 0.0f, 1.0f);
120 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::BlushHappy), StrawberryFace::BlushHappy, 30, 0.0f, 1.0f);
121 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::Stink), StrawberryFace::Stink, 30, 0.0f, 1.0f);
124 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::TalkA), StrawberryFace::TalkA, 2, 0.0f, 1.0f);
125 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::TalkE), StrawberryFace::TalkE, 2, 0.0f, 1.0f);
126 eEA.
AddParameter(
pM.GetMorphWeightReference(StrawberryFace::TalkO), StrawberryFace::TalkO, 2, 0.0f, 1.0f);
250 eEA.
AddParameterFrame(StrawberryFace::TalkA, MicrophoneFourierIT::GetCurrentMagnitude() * 0.5f);
252 if(MicrophoneFourierIT::GetCurrentMagnitude() > 0.05f){
253 voiceDetection.
Update(MicrophoneFourierIT::GetFourierFiltered(), MicrophoneFourierIT::GetSampleRate());
281 scene.AddObject(
pM.GetObject());
282 scene.AddObject(
pMBlush.GetObject());
283 scene.AddObject(
pMStinky.GetObject());
284 scene.AddObject(
pMTears.GetObject());
304 MicrophoneFourierIT::Initialize(22, 8000, 30.0f, 100.0f);
318 return pM.GetObject();
334 MicrophoneFourierIT::Update();
340 aRG.
SetSize(
Vector2D((xOffset + 2.0f) * 10.0f + 50.0f, (xOffset + 2.0f) * 10.0f + 50.0f));
365 else if (mode == 8)
Stinky();
366 else if (mode == 9) {
367 aRG.
Update(MicrophoneFourierIT::GetFourierFiltered());
370 else if (mode == 10){
371 oSC.
Update(MicrophoneFourierIT::GetSamples());
375 sA.
Update(MicrophoneFourierIT::GetFourierFiltered());
397 float scale = menuRatio * 0.6f + 0.4f;
398 float faceSizeOffset = faceSize * 8.0f;
406 pM.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset + 5.0f, yOffset - 150.0f *
offsetFace + 5.0f, 0.0f));
407 pM.GetObject()->UpdateTransform();
412 pMBlush.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset - 60.0f + 5.0f - stinkOffset, yOffset - 150.0f *
offsetFace + blushOffset, 0.0f));
414 pMBlush.GetObject()->UpdateTransform();
415 pMStinky.GetObject()->GetTransform()->SetPosition(
Vector3D(xOffset - 35.0f + 5.0f, yOffset - 150.0f *
offsetFace - 10.0f - stinkOffset, 0.0f));
417 pMStinky.GetObject()->UpdateTransform();
420 pMTears.GetObject()->UpdateTransform();
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.
Represents a circle in 2D space.
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.
Represents an ellipse in 2D space.
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.
A class to generate various waveform functions with customizable parameters.
@ Triangle
Triangle waveform.
float Update()
Updates and calculates the next value of the waveform.
Creates a customizable gradient material for rendering.
void SetRotationAngle(float rotationAngle)
Sets the rotation angle for the gradient.
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.
Combines two materials using a shape as a mask.
float * GetOpacityReference()
Provides a reference to the opacity value.
@ Lighten
Chooses the lighter color.
@ 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 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.
A mathematical construct representing a rotation in 3D space.
Represents an RGB color and provides methods for manipulation.
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.
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.
FunctionGenerator fGenMatHue
SimpleMaterial greenMaterial
FunctionGenerator fGenMatYMove
SimpleMaterial redMaterial
void UpdateKeyFrameTracks()
RainbowSpiral rainbowSpiral
SimpleMaterial blueMaterial
FunctionGenerator fGenMatRMenu
void AudioReactiveGradientFace()
SimpleMaterial yellowMaterial
LEDStripBackground ledStripBackground
void ChangeInterpolationMethods()
GradientMaterial< 2 > gradientMat
void SpectrumAnalyzerFace()
FunctionGenerator fGenMatPos
FunctionGenerator fGenScale
SimpleMaterial lightPinkMaterial
FunctionGenerator fGenMatBlushY
FunctionGenerator fGenRotation
EasyEaseAnimator< 30 > eEA
SimpleMaterial orangeMaterial
FunctionGenerator fGenMatXMenu
void FadeIn(float stepRatio) override
void FadeOut(float stepRatio) override
RainbowNoise rainbowNoise
FunctionGenerator fGenMatYMenu
FunctionGenerator fGenMatXMove
MaterialAnimator< 10 > materialAnimator
SimpleMaterial purpleMaterial
void Update(float ratio) override
uint8_t changeEyeColorInd
FFTVoiceDetection< 128 > voiceDetection
RGBColor gradientSpectrum[2]
MaterialAnimator< 4 > backgroundMaterial
FunctionGenerator fGenMatStinkY
StrawberryStinky pMStinky
SimpleMaterial whiteMaterial
AudioReactiveGradient aRG
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.
@ ER
Mouth shape corresponding to the "ER" sound.
@ OO
Mouth shape corresponding to the "OO" sound.
@ UH
Mouth shape corresponding to the "UH" sound.
@ EE
Mouth shape corresponding to the "EE" sound.