Skip to main content
Migrate Already selling? Move your customers to Keylight without re-issuing a single key.
Keylight
Blog
audio-plugins juce cpp trials demo-mode

How to Add a Demo Mode to Your VST Plugin

7 min read Nicolas Demanez — Founder

Almost every plugin developer builds the licensing before they build the demo, and it is the wrong order. The demo is the part that decides whether anyone pays you. A license key only matters after someone has already decided to buy, and what makes them decide is the two weeks they spent with your plugin in a real session.

Most demo modes are an afterthought, and they fail in one of two directions. Either they are so crippled that nobody can tell whether the plugin is good, or they are so generous that nobody needs to buy. Getting that balance right is a product decision, not a technical one — but the technical part has real traps, because a plugin runs on the audio thread inside someone else’s host.

This walks through both: choosing a limitation that actually converts, and implementing it in JUCE without causing dropouts.

Choose a limitation that sells, not one that annoys

There are four demo patterns in common use, and they do not perform equally.

The periodic interruption. Every 30 to 60 seconds, the plugin drops a short burst of noise or mutes for a moment. This is the standard in audio for a reason: the plugin is fully usable while you are writing and completely unusable when you are printing a mix. The producer gets a genuine evaluation and hits a hard wall exactly at the point where they have already committed to using it. That is the best possible moment to ask for money.

No state saving. The plugin works perfectly, but your settings are gone when the session reopens. This is less aggressive and surprisingly effective, because anyone who uses the plugin twice feels it immediately. It is a good fit for plugins with deep parameter sets where dialling in a sound is an investment.

Feature gating. The core works; the pro modules do not. This suits plugins with genuinely separable features — extra algorithms, oversampling, a mid/side mode. It is a weak choice for a plugin whose value is one algorithm, because gating that algorithm leaves nothing to evaluate.

Reduced audio quality. Do not do this. Producers judge plugins on sound in the first thirty seconds. A demo that sounds worse than the product is a demo that teaches people your plugin sounds bad, and they will not come back to check whether the paid version is better.

The ones that convert share a property: the plugin is honestly good during evaluation and becomes impossible at the moment of commitment. Anything that degrades the evaluation itself is working against you.

Decide between a deadline and a permanent free mode

A time-limited trial creates urgency. Fourteen days is the default for a reason — it survives one weekend of not touching the project and still ends while the plugin is fresh in mind. Seven days converts harder but punishes anyone who downloads on a busy week. Thirty days usually means they forget you exist.

A permanent limited mode removes the deadline and plays a longer game. Someone installs your saturator, uses the free path on a few tracks, and buys three months later when they need the pro mode on a paid job. No deadline pressure, but also no forcing function.

The strongest arrangement runs both, in sequence: a full-featured trial with a real deadline, dropping into a limited free mode when it ends rather than into a locked screen. Nobody gets thrown out of a session, the plugin stays installed, and the upgrade prompt keeps living inside a tool they still use. A plugin that stops opening is a plugin that gets deleted, and a deleted plugin never converts.

Implement the demo mode without touching the audio thread

Here is where the audio-specific constraint bites. processBlock runs under real-time constraints. Any filesystem access, any network call, any mutex, any allocation on that thread is a potential dropout — and a dropout in someone’s session is worse than no demo at all.

The rule is simple: resolve licensing state on a background thread, and let the audio thread read one atomic flag.

With the Keylight JUCE adapter, the state resolution happens off the audio thread at construction:

MyPluginAudioProcessor::MyPluginAudioProcessor()
    : licensing(makeConfig())
{
    // Verifies any cached lease offline, then refreshes in the background.
    // Returns immediately — never blocks.
    licensing.checkOnLaunch();
}

checkOnLaunch() resolves the license state — Licensed, Trial, Expired, FreeTier, Limited, or Invalid — and writes the result into a lock-free flag the audio thread can read.

The demo limitation then lives in processBlock as a single atomic read:

void MyPluginAudioProcessor::processBlock(
    juce::AudioBuffer<float>& buffer,
    juce::MidiBuffer& midiMessages)
{
    applyProcessing(buffer);

    // One lock-free atomic read — safe under real-time constraints.
    if (licensing.hasFeature("pro"))
        return;

    // Demo path: periodic noise burst, counted in samples.
    demoSampleCounter += buffer.getNumSamples();

    if (demoSampleCounter >= samplesBetweenBursts)
    {
        applyDemoBurst(buffer);
        demoSampleCounter = 0;
    }
}

Note that the counter is in samples, not seconds, and it is a plain member on the audio thread. No clock call, no lock, no allocation. applyDemoBurst should also be allocation-free — fill from a pre-sized buffer you prepared in prepareToPlay.

For the “no state saving” variant, the check moves out of the audio thread entirely and into getStateInformation, which runs on the message thread and can afford to be lazy.

Show the trial state in your editor, not in the audio

The countdown belongs in your UI. Read the state from the message thread in your editor:

switch (processor.licensing.state())
{
    case keylight::State::Licensed:
        statusLabel.setText("Licensed", juce::dontSendNotification);
        activationPanel.setVisible(false);
        break;

    case keylight::State::Trial:
        statusLabel.setText("Trial — "
                            + juce::String(processor.licensing.trialDaysLeft())
                            + " days left",
                            juce::dontSendNotification);
        activationPanel.setVisible(false);
        break;

    case keylight::State::Expired:
        statusLabel.setText("Trial ended — enter your key to unlock",
                            juce::dontSendNotification);
        activationPanel.setVisible(true);
        break;

    case keylight::State::FreeTier:
        statusLabel.setText("Free version — unlock pro features",
                            juce::dontSendNotification);
        activationPanel.setVisible(true);
        break;

    case keylight::State::Limited:
        statusLabel.setText("Licensed — limited mode",
                            juce::dontSendNotification);
        activationPanel.setVisible(false);
        break;

    case keylight::State::Invalid:
        activationPanel.setVisible(true);
        break;
}

Set the adapter’s onStateChanged callback to refresh this live — it fires on the message thread, so you can touch components directly.

One thing worth doing that most plugins skip: make the days-remaining visible in the plugin’s title bar area, not buried in a settings panel. A producer who never opens your settings page will never see the countdown, and a trial nobody notices expiring is a trial that surprises them mid-session.

Keep the trial length out of your binary

The mistake that costs the most later is compiling the trial length into the plugin.

You ship with 14 days. Three months in you learn that most of your conversions happen on day 3 and almost none after day 9, so 7 days would convert better and get you paid sooner. Now you need a new build, a new release, a new round of testing across hosts — and every existing install keeps running the old number forever.

Keylight puts the trial length in the dashboard instead. Every SDK reads it at launch, so changing it takes effect on the next launch of every install with no rebuild. Starting the clock is one call, and the state machine handles the rest:

// Begin the evaluation window. The length comes from your dashboard,
// not from a constant in this file. state() then reports State::Trial.
licensing.startTrial();

// Later, for the countdown in your editor:
const int daysLeft = licensing.trialDaysLeft();

The value you compile in becomes the seed a fresh install uses before its first check — a sensible default, not a permanent decision. Setting it to zero turns trials off entirely, and that is a real setting rather than an absent one, so existing installs stop offering a trial on their next launch.

The same applies to the free tier. Whether an expired trial drops to a limited mode or to a locked state is a dashboard switch, which means you can test the more generous option without shipping anything.

What about people who reset the trial

Someone will delete the preferences file and start over. Someone else will write a script to do it on a schedule.

Keep the trial start in the same machine-bound store as the license rather than a plain preferences file, so a casual reinstall on the same machine resumes the clock instead of starting a fresh one. That handles the common case, which is almost all of it. A clean install on a clean machine still starts over, and Keylight’s local trial makes no claim otherwise.

It will not stop a determined attacker, and you should not spend your evenings trying to. Every hour you spend hardening a trial against someone who was never going to pay is an hour you did not spend on the plugin, and the plugin is what makes the people who will pay decide to. Raise the effort enough that buying is the obviously easier path, then go back to work.

If you want the deeper version of that argument, how much piracy do you actually have walks through estimating it before you spend anything on it.

Where to start

Pick the interruption pattern unless you have a specific reason not to — it is the standard in audio because it works. Run 14 days, full features, dropping to a limited mode rather than a lock screen. Put the countdown somewhere the producer will actually see it. Keep the length in your dashboard so you can tune it once you have real numbers instead of guesses.

The full integration, from dropping the header into your JUCE project through to gating features in the audio thread, is in Licensing for Audio Plugins (VST/AU). If you are weighing the platform options first, best licensing platforms for audio plugins ranks the field including iLok.

Trials and the free tier are included on every plan — see pricing and free trials and free tier for the dashboard controls.

If there is a plugin licensing topic you want covered here, send us your feedback.

Frequently asked

What is the best demo limitation for an audio plugin?+

A periodic noise burst or mute is the most common, because it makes the plugin unusable in a finished mix while leaving it fully evaluable during writing. Disabling state saving is the second most effective. Avoid crippling audio quality — producers hear it as a bad plugin rather than as a demo.

Should the demo be time-limited or feature-limited?+

Both work, and they answer different questions. A time limit creates a deadline, which converts faster. A feature limit lets someone evaluate forever, which suits plugins people adopt slowly. Many plugins run a full-featured time-limited trial that drops to a limited free mode when it ends.

How do I stop someone resetting the trial by reinstalling?+

You mostly cannot, and it is rarely worth the fight. Keep the trial start in the same machine-bound store as the license rather than a plain preferences file, so a reinstall over the same machine usually resumes the clock. A clean install on a clean machine starts over. Keylight treats the local trial as a convenience; the signed lease is the security boundary for paid licenses.

Can I change the trial length after shipping?+

With Keylight, yes. The trial length lives in the dashboard and every SDK reads it at launch, so changing 14 days to 7 takes effect on the next launch of every install with no new build and no recall.

Is it safe to check the trial state in processBlock?+

Only if the check is a lock-free atomic read. Never call into licensing logic, touch the filesystem, or take a lock on the audio thread. Resolve the state on a background thread and have processBlock read a single flag.

Ready to ship?

Create your account and start licensing your apps in under a minute. Free forever tier included.

Start Free