Skip to content

Instantly share code, notes, and snippets.

Avatar

Oli Larkin olilarkin

View GitHub Profile
@olilarkin
olilarkin / IPlugEffect.cpp
Last active Jul 14, 2021
Storing and Restoring the plugin editor scaling
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
#if IPLUG_EDITOR // http://bit.ly/2S64BDd
@olilarkin
olilarkin / IPlugEffect.cpp
Created Jul 14, 2021
Redraw a control periodically using a timer
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
class MyControl : public IControl {
public:
MyControl(const IRECT& r)
: IControl(r)
{
mTimer = std::unique_ptr<Timer>(Timer::Create([&](Timer& t) {
@olilarkin
olilarkin / IPlugEffect.cpp
Last active May 17, 2021
Switch IGraphics DrawScale using a radio button
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
@olilarkin
olilarkin / IPlugEffect.cpp
Created May 10, 2021
Randomise parameters from a button click
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
int kMsgTagRandomise = 0;
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
@olilarkin
olilarkin / IPlugEffect.cpp
Created Apr 5, 2021
Storing and restoring text in an editable text control
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
mMakeGraphicsFunc = [&]() {
@olilarkin
olilarkin / IPlugEffect.cpp
Last active Mar 6, 2021
Basic VU meter hookup
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
constexpr int kNumVUFrames = 100;
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
@olilarkin
olilarkin / IPlugEffect.cpp
Created Dec 23, 2020
Visualize modulation
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
class ModIVControl : public IVKnobControl {
public:
ModIVControl(const IRECT& bounds, int paramIdx)
: IVKnobControl(bounds, paramIdx)
{
@olilarkin
olilarkin / IPlugEffect.cpp
Created Nov 30, 2020
VST3 Sample accurate parameters
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
}
@olilarkin
olilarkin / IPlugEffect.cpp
Last active Nov 21, 2020
Get access to IPlugAPPHost stuff (MIDI/Audio Device names) in plugin class
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
, mPAPPHost(reinterpret_cast<IPlugAPPHost*>(info.pAppHost))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
@olilarkin
olilarkin / IPlugEffect.cpp
Created Nov 14, 2020
ILambdaControl Sine Wave animation
View IPlugEffect.cpp
#include "IPlugEffect.h"
#include "IPlug_include_in_plug_src.h"
#include "IControls.h"
IPlugEffect::IPlugEffect(const InstanceInfo& info)
: Plugin(info, MakeConfig(kNumParams, kNumPresets))
{
GetParam(kGain)->InitDouble("Gain", 0., 0., 100.0, 0.01, "%");
#if IPLUG_EDITOR // http://bit.ly/2S64BDd