本文へ移動
cccskills
無料GitHub で公開

juce-guide

Step-by-step guide for building a JUCE audio plugin from scratch. Use when the user asks "how do I create a JUCE plugin", "set up a JUCE project", "add parameters to my JUCE plugin", "package my VST3", or "how do I wire up APVTS". Trigger on phrases like "create a JUCE plugin", "JUCE CMake setup", "AudioProcessor skeleton", "add APVTS parameters", or "codesign my plugin on macOS".

インストール方法を見る

含まれるファイル(1)

  • SKILL.md3.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

JUCE Audio Plugin — Build Guide

Five steps from empty folder to distributable plugin. Do each step in order; skip none.

Step 1 — Project setup (CMake + JUCE)

  • Add JUCE as a git submodule or FetchContent target; call add_subdirectory(JUCE).
  • Use juce_add_plugin(MyPlugin FORMATS VST3 AU Standalone ...) to declare the plugin target.
  • Set PLUGIN_MANUFACTURER_CODE, PLUGIN_CODE, IS_SYNTH, NEEDS_MIDI_INPUT in the same call.
  • Link juce::juce_audio_processors juce::juce_audio_utils juce::juce_dsp to the target.

Step 2 — AudioProcessor skeleton

  • Subclass juce::AudioProcessor; override prepareToPlay, releaseResources, processBlock.
  • In prepareToPlay: store sampleRate and maximumBlockSize, allocate internal buffers, reset all state (filters, envelopes, delay lines — unconditionally).
  • In processBlock: read only pre-cached raw parameter pointers; never allocate, never call JUCE String ops or DBG().
  • Implement getStateInformation / setStateInformation using apvts.copyState() and apvts.replaceState() with a MemoryOutputStream / MemoryBlock.

Step 3 — Parameters via APVTS

  • Declare a static createParameterLayout() method that returns AudioProcessorValueTreeState::ParameterLayout.
  • Construct apvts(*this, nullptr, "Parameters", createParameterLayout()) as a member.
  • After constructing APVTS, cache raw pointers once: gainParam = apvts.getRawParameterValue("Gain").
  • In processBlock, dereference with gainParam->load() — no APVTS calls on the audio thread.
  • Use AudioProcessorValueTreeState::ParameterAttachment (or SliderAttachment) in the editor, never in the processor.

Step 4 — Editor and UI

  • Subclass juce::AudioProcessorEditor; call setSize(w, h) in the constructor.
  • Override paint for background / labels; override resized to lay out components with setBounds.
  • Declare juce::Slider members; attach each via juce::AudioProcessorValueTreeState::SliderAttachment.
  • Keep all UI state in the editor — the processor must function correctly with no editor open.
  • The editor holds a reference to the processor (passed in constructor); never store a raw editor pointer in the processor.

Step 5 — Build, test, package

  • Configure: cmake -B build -DCMAKE_BUILD_TYPE=Release
  • Build: cmake --build build --config Release
  • Locate artefacts under build/MyPlugin_artefacts/Release/.
  • macOS codesign: codesign --deep --force --sign "Developer ID Application: ..." MyPlugin.vst3 then spctl --assess --verbose MyPlugin.vst3.
  • Notarize for distribution: xcrun notarytool submit MyPlugin.pkg --apple-id ... --wait.
  • Validate in a DAW host or use the JUCE AudioPluginHost utility (extras/AudioPluginHost).

Common pitfalls

PitfallCorrect approach
Calling apvts.getParameter() in processBlockCache getRawParameterValue() once after APVTS construction
Allocating in processBlockAllocate in prepareToPlay only
Not resetting state on prepareToPlay re-entryAlways reset unconditionally
Storing editor pointer in processorUse createEditor() factory; processor owns no editor reference
Missing JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTORAdd to every AudioProcessor and AudioProcessorEditor subclass

Use the juce-review skill to audit finished processor code for thread-safety violations.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

au-review

無料

Reviews AudioUnit v2/v3 plugin implementations for spec compliance, thread safety, and correctness. Use when the user asks to review an AudioUnit plugin, check an AUv3 app extension, audit property or parameter handling, or asks "is my AUComponent thread-safe?" or "why does my AU crash in Logic?". Trigger on phrases like "review my AudioUnit", "check my AUv3", "is my render block safe?", or when you see AURenderCallback, internalRenderBlock, kAudioUnitProperty_*, or AUAudioUnit in the code.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

Systematic checklist for diagnosing audio artifacts. Use when the user describes a sound quality problem — clicks, pops, crackling, silence, DC offset, aliasing, phase issues, or latency problems. Trigger on phrases like "why do I hear clicks?", "my output has DC offset", "there's aliasing in my oscillator", "phase is wrong in mono", "dropout when CPU spikes". Pairs with audio-dsp-review (realtime safety) and audio-numerics-review (numeric correctness) — use those to fix once the cause is found.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

Reviews audio DSP and audio processing code for realtime safety violations. Use whenever the user asks to review, audit, or check audio processing code — including plugin process callbacks, audio engine render functions, DSP implementations, or any code that runs on the audio thread. Trigger on phrases like "review my processBlock", "check this DSP code", "is this safe for the audio thread?", "review my JUCE plugin", or when you see an audio callback and spot potential realtime violations. Flag issues proactively even when the user hasn't explicitly asked for a review.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

Explains DSP math concepts to developers who need the theory behind an algorithm. Use whenever the user asks how a signal-processing concept works, wants intuition behind a formula, or hits a math-shaped bug. Trigger on phrases like "how does a Fourier transform work", "explain z-transforms", "what is convolution", "why does my biquad ring", "what is windowing for", "what causes aliasing", or "how do I convert gain to dB". Also trigger when the user pastes DSP code and asks why it behaves a certain way.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

Reviews audio DSP code for numerical correctness. Use when the user asks to review, audit, or check DSP code for correctness issues — filters, feedback loops, fixed-point arithmetic, accumulation loops, or any numeric computation in audio code. Trigger on "check this filter for NaN", "why does my reverb blow up?", "is this numerically stable?", "why do I hear DC in my output?". Pairs with audio-dsp-review (realtime safety); this skill covers numeric correctness. Flag issues proactively.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

Profiling strategy for audio CPU issues — xruns, spikes, and buffer underruns. Use when the user reports CPU overload, audio glitches under load, or performance regressions. Trigger on phrases like "I'm getting xruns", "my plugin causes CPU spikes", "dropouts under high voice count", "audio thread is too slow", "how do I profile my DSP". References audio-numerics-review for denormal slowdown and audio-dsp-review for lock contention.

日本語の概要は準備中です。原文の説明を表示しています。

kunitoki/sonic-skills222026年5月21日 更新

kunitoki のスキルをすべて見る

このスキルの問題を報告する