This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
The block below describes the properties of this PIP. A PIP is a short snippet | |
of code that can be read by the Projucer and used to generate a JUCE project. | |
BEGIN_JUCE_PIP_METADATA | |
name: MultichannelVolume | |
dependencies: juce_audio_basics, juce_audio_devices, juce_audio_formats, juce_audio_plugin_client, | |
juce_audio_processors, juce_audio_utils, juce_core, juce_data_structures, juce_events, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static VstEffectInterface* constructEffect (const ModuleHandle::Ptr& module) | |
{ | |
VstEffectInterface* effect = nullptr; | |
try | |
{ | |
const IdleCallRecursionPreventer icrp; | |
_fpreset(); | |
JUCE_VST_LOG ("Creating VST instance: " + module->pluginName); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class smbPitchShifter | |
{ | |
public: | |
smbPitchShifter() {} | |
void prepareToPlay() | |
{ | |
memset(gInFIFO, 0, MAX_FRAME_LENGTH * sizeof(float)); | |
memset(gOutFIFO, 0, MAX_FRAME_LENGTH * sizeof(float)); | |
memset(gFFTworksp, 0, 2 * MAX_FRAME_LENGTH * sizeof(float)); | |
memset(gLastPhase, 0, (MAX_FRAME_LENGTH / 2 + 1) * sizeof(float)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <random> | |
#include "../JuceLibraryCode/JuceHeader.h" | |
class NoiseGenerator | |
{ | |
public: | |
NoiseGenerator() {} | |
void toggleSound(bool isOn, int chan, double sampleRate, double gain) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "aeffect.h" | |
#include "aeffectx.h" | |
#define vst_export __declspec(dllexport) | |
// prototype for external function | |
vst_export struct AEffect* VSTPluginMain(audioMasterCallback audioMaster); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "aeffect.h" | |
#include "aeffectx.h" | |
#define vst_export __declspec(dllexport) | |
// prototype for external function | |
vst_export struct AEffect* VSTPluginMain(audioMasterCallback audioMaster); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void saveToXml(File dest, std::vector<std::vector<int>> src) | |
{ | |
if (dest.exists()) | |
dest.deleteFile(); | |
XmlElement chordselem("chords"); | |
for (int i=0;i<src.size();++i) | |
{ | |
XmlElement* chordelem = chordselem.createNewChildElement("chord_"+String(i)); | |
for (int j = 0; j < src[i].size(); ++j) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAudioCallback : public AudioIODeviceCallback | |
{ | |
public: | |
MyAudioCallback() {} | |
void audioDeviceIOCallback(const float **inputChannelData, int numInputChannels, | |
float **outputChannelData, int numOutputChannels, int numSamples) override | |
{ | |
for (int i = 0; i < numSamples; ++i) | |
{ | |
float sample = jmap(m_rnd.nextFloat(), 0.0f, 1.0f, -0.1f, 0.1f); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAudioSource : public AudioSource | |
{ | |
public: | |
MyAudioSource() {} | |
void prepareToPlay(int samplesPerBlockExpected, double sampleRate) override | |
{} | |
void releaseResources() override | |
{} | |
void getNextAudioBlock(const AudioSourceChannelInfo & bufferToFill) override | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requires the Juce audio_utils module for AudioProcessorPlayer | |
class MyAudioProcessor : public AudioProcessor | |
{ | |
public: | |
MyAudioProcessor() {} | |
const String getName() const override { return "MyAudioProcessor"; } | |
void prepareToPlay(double sampleRate, int maximumExpectedSamplesPerBlock) override {} | |
void releaseResources() override {} | |
void processBlock(AudioBuffer<float>& buffer, MidiBuffer & midiMessages) override |
OlderNewer