Skip to content

Instantly share code, notes, and snippets.

#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;
#include <JuceHeader.h>
class ConvolutionSource : public juce::AudioSource
{
public:
ConvolutionSource(juce::File inputfile)
{
juce::AudioFormatManager fman;
fman.registerBasicFormats();
auto reader = fman.createReaderFor(inputfile);
@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;
/*
==============================================================================
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,
#include <vector>
#include <functional>
class ImgWaveOscillator
{
public:
void initialise(std::function<float(float)> f,
int tablesize)
{
m_tablesize = tablesize;
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();
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;
/*
==============================================================================
Articulations.cpp
Created: 1 Jan 2022 8:34:26am
Author: Gene Brown
==============================================================================
*/
#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.
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)