Skip to content

Instantly share code, notes, and snippets.

/*
==============================================================================
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();
#include <vector>
#include <functional>
class ImgWaveOscillator
{
public:
void initialise(std::function<float(float)> f,
int tablesize)
{
m_tablesize = tablesize;
/*
==============================================================================
This file is part of the JUCE examples.
Copyright (c) 2020 - Raw Material Software Limited
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES,
@Xenakios
Xenakios / main.cpp
Last active February 2, 2021 19:50
class Undoable
{
public:
Undoable() {}
void setString(std::string str)
{
if (str.find("🍺") != std::string::npos)
{
std::cout << "No beer tonight! String not set.\n";
return;
#include <JuceHeader.h>
class ConvolutionSource : public juce::AudioSource
{
public:
ConvolutionSource(juce::File inputfile)
{
juce::AudioFormatManager fman;
fman.registerBasicFormats();
auto reader = fman.createReaderFor(inputfile);
#include <JuceHeader.h>
class Noise : public juce::AudioSource
{
public:
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
{
// initialise the filter object
juce::dsp::ProcessSpec spec;
spec.maximumBlockSize = samplesPerBlockExpected;
class Noise : public juce::AudioSource
{
public:
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
{
// initialise the filter object
juce::dsp::ProcessSpec spec;
spec.maximumBlockSize = samplesPerBlockExpected;
spec.sampleRate = sampleRate;
spec.numChannels = 1;
#include <JuceHeader.h>
class Noise : public juce::AudioSource
{
public:
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override
{
// nothing to do here, we can generate the noise without preparing anything
}
void releaseResources() override