Skip to content

Instantly share code, notes, and snippets.

void AdditiveSynth::processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages)
{
// might want to avoid doing this for voices that are not active or
// if parameters have not changed, but this will have to do for now
for(auto& v : m_voices)
{
v.updateState();
}
auto bufptrs = buffer.getArrayOfWritePointers();
auto it = midiMessages.begin();
class Animator : public Timer
{
public:
enum class State
{
Started,
Running,
Finished
};
Animator(int updateinterval = 40) : m_update_interval(updateinterval)
// for plugins without custom GUI
class GenericParameterComponent : public juce::Component
{
public:
GenericParameterComponent(ClapProcessor* proc, clap_id param_id)
: m_proc(proc), m_param_id(param_id)
{
m_slider.setSliderStyle(juce::Slider::SliderStyle::LinearBar);
m_slider.setRange(proc->paramInfo[param_id].min_value,proc->paramInfo[param_id].max_value);
Surge XT.exe!std::array<float,8192>::operator[](unsigned __int64 _Pos) Line 534 (c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\array:534)
Surge XT.exe!sst::cpputils::StereoRingBuffer<float,8192,0>::popall() Line 245 (c:\develop\surge\libs\sst\sst-cpputils\include\sst\cpputils\ring_buffer.h:245)
Surge XT.exe!Surge::Overlays::Oscilloscope::pullData() Line 190 (c:\develop\surge\src\surge-xt\gui\overlays\Oscilloscope.cpp:190)
Surge XT.exe!std::invoke<void (__cdecl Surge::Overlays::Oscilloscope::*const &)(void),Surge::Overlays::Oscilloscope * &>(void(Surge::Overlays::Oscilloscope::*)() & _Obj, Surge::Overlays::Oscilloscope * & _Arg1) Line 1573 (c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\type_traits:1573)
Surge XT.exe!std::_Mem_fn<void (__cdecl Surge::Overlays::Oscilloscope::*)(void)>::operator()<Surge::Overlays::Oscilloscope * &>(Surge::Overlays::Oscilloscope * & <_Args_0>) Line 578 (c:\Program Files\Microsoft Visual Studio\
class SimpleDelay2
{
public:
SimpleDelay2() {}
void prepare(float samplerate, int numchans, float delaytime_ramp_dur_seconds, float maxdelaytime_seconds)
{
mDelayTime.reset(samplerate, delaytime_ramp_dur_seconds);
mWetDryMix.reset(samplerate, 0.05f); // 50 millisecond ramps for the wet dry
mFeedBackAmount.reset(samplerate, 0.05f); // likewise for feedback gain
mDelayLine.setMaximumDelayInSamples(maxdelaytime_seconds*samplerate);
class SimpleDelay
{
public:
SimpleDelay(int maxchans, int maxdelaytimesamples)
{
maxchans = juce::jlimit(1, 2, maxchans);
mDelayBuffer.setSize(maxchans, maxdelaytimesamples);
mDelayBuffer.clear();
}
float processSample(int chan, float input)
#pragma once
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2020 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
/*
==============================================================================
Articulations.cpp
Created: 1 Jan 2022 8:34:26am
Author: Gene Brown
==============================================================================
*/
class StarGateReverb
{
public:
StarGateReverb()
{
for (int i = 0; i < dram.size(); ++i)
dram[i] = 0;
for (int i = 0; i < delayTaps.size(); ++i)
{
delayTaps[i] = 0;
class DualSliderWithAttachments : public juce::Slider
{
public:
DualSliderWithAttachments(juce::Slider::SliderStyle style_, juce::RangedAudioParameter* minpar, juce::RangedAudioParameter* maxpar) :
minAttach(*minpar, [this](float x) { setMinValue(x, juce::dontSendNotification); }),
maxAttach(*maxpar, [this](float x) { setMaxValue(x, juce::dontSendNotification); })
{
setSliderStyle(style_);
setRange(minpar->getNormalisableRange().start, maxpar->getNormalisableRange().end);
minAttach.sendInitialUpdate();