mirror of
https://codeberg.org/armin/justasample.git
synced 2026-09-01 04:10:48 +02:00
init
This commit is contained in:
commit
d21bc831e1
178 changed files with 24136 additions and 0 deletions
42
Source/Components/Displays/DistortionVisualizer.h
Normal file
42
Source/Components/Displays/DistortionVisualizer.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
==============================================================================
|
||||
|
||||
DistortionVisualizer.h
|
||||
Created: 23 Jan 2024 9:12:52pm
|
||||
Author: binya
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
|
||||
#include "../../Sampler/Effects/Distortion.h"
|
||||
#include "../../Utilities/ComponentUtils.h"
|
||||
|
||||
/** Visualizes the distortion effect by displaying its result on a sine wave. */
|
||||
class DistortionVisualizer final : public CustomComponent
|
||||
{
|
||||
public:
|
||||
DistortionVisualizer(APVTS& apvts, int sampleRate);
|
||||
|
||||
private:
|
||||
void paint(juce::Graphics&) override;
|
||||
void enablementChanged() override;
|
||||
|
||||
//==============================================================================
|
||||
static constexpr int WINDOW_LENGTH{ 30000 };
|
||||
static constexpr float SINE_HZ{ 13.f };
|
||||
|
||||
//==============================================================================
|
||||
APVTS& apvts;
|
||||
|
||||
juce::AudioBuffer<float> inputBuffer;
|
||||
|
||||
Distortion distortion;
|
||||
float distortionDensity{ 0.f }, distortionMix{ 0.f }; /*distortionHighpass{ 0.f }*/
|
||||
juce::ParameterAttachment densityAttachment, mixAttachment;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DistortionVisualizer)
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue