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

yup-guide

Step-by-step guide for building a YUP audio plugin from scratch. Use when the user asks "how do I create a YUP plugin", "set up a YUP project", "add parameters to my YUP plugin", "package my CLAP or VST3", or "how do I wire up AudioParameterHandle". Trigger on phrases like "create a YUP plugin", "YUP CMake setup", "yup_audio_plugin", "AudioParameterBuilder", "AudioParameterHandle", or "createPluginProcessor".

インストール方法を見る

含まれるファイル(1)

  • SKILL.md5.7 KB

SKILL.md(原文)

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

YUP Audio Plugin - Build Guide

Five steps from empty folder to a working CLAP/VST3/standalone plugin. Do each step in order; skip none.

Step 1 - Project setup (CMake + YUP)

  • Add YUP as a git submodule or FetchContent target; disable examples/tests for plugin projects unless needed.
  • Use yup_audio_plugin (...) to declare the plugin target.
  • Set TARGET_NAME, TARGET_VERSION, TARGET_APP_ID, TARGET_APP_NAMESPACE, and TARGET_CXX_STANDARD 20.
  • Set plugin metadata in the same call: PLUGIN_ID, PLUGIN_NAME, PLUGIN_VENDOR, PLUGIN_VERSION, PLUGIN_DESCRIPTION, PLUGIN_IS_SYNTH, and PLUGIN_IS_MONO.
  • Enable only the formats you need: PLUGIN_CREATE_CLAP, PLUGIN_CREATE_VST3, PLUGIN_CREATE_STANDALONE.
  • Link at least yup::yup_gui and yup::yup_audio_processors in MODULES.
  • Add plugin sources to ${target_name}_shared; the format targets link against that shared interface target.

Step 2 - AudioProcessor skeleton

  • Subclass yup::AudioProcessor.
  • Construct it with a processor name and immutable yup::AudioBusLayout, e.g. stereo output: AudioProcessor ("MyPlugin", yup::AudioBusLayout ({}, { yup::AudioBus ("main", yup::AudioBus::Audio, yup::AudioBus::Output, 2) })).
  • Override prepareToPlay (float sampleRate, int maxBlockSize), releaseResources(), processBlock (yup::AudioSampleBuffer& audioBuffer, yup::MidiBuffer& midiBuffer), and flush().
  • In prepareToPlay: store sample rate, allocate worst-case scratch storage, initialise AudioParameterHandles, and reset all filters, envelopes, oscillators, delay lines, MIDI/voice state, and smoothers.
  • In processBlock: assume realtime constraints; no allocation, locks, yup::String formatting, logging, file/network access, or UI calls.
  • Implement preset and state methods: getCurrentPreset, setCurrentPreset, getNumPresets, getPresetName, setPresetName, loadStateFromMemory, and saveStateIntoMemory.
  • Export the plugin entry point:
extern "C" yup::AudioProcessor* createPluginProcessor()
{
    return new MyPluginProcessor();
}

Step 3 - Parameters via AudioParameterBuilder

  • Add parameters in the processor constructor with addParameter (...).
  • Keep each yup::AudioParameter::Ptr as a processor member; parameter IDs must be stable and unique.
  • Use yup::AudioParameterBuilder().withID (...).withName (...).withRange (...).withDefault (...).withSmoothing (...).build().
  • For audio-thread reads, construct a yup::AudioParameterHandle in prepareToPlay with the parameter and sample rate.
  • In processBlock, call handle.updateNextAudioBlock() once per block, then use getNextValue() per sample or skip (numSamples) for block ramps.
  • From the editor, wrap user drags with beginChangeGesture() and endChangeGesture(), and use setValueNotifyingHost() for host-visible parameter changes.
  • For presets or state restore, prefer setting the real value with setValue() or setNormalizedValue() from a non-audio thread, then let the audio handle pick it up next block.

Step 4 - Editor and UI

  • Subclass yup::AudioProcessorEditor.
  • Implement isResizable(), getPreferredSize(), paint (yup::Graphics&), and resized().
  • The editor owns UI components; the processor must work correctly with no editor open.
  • The editor may keep AudioParameter::Ptrs and poll values from a yup::Timer for display sync.
  • Do not store a raw editor pointer in the processor. Use hasEditor() and createEditor() as the factory boundary.
  • UI controls should notify parameters through gestures, e.g. slider drag start/end plus setValueNotifyingHost().

Step 5 - Build, test, package

  • Configure: cmake -B build -DCMAKE_BUILD_TYPE=Release -DYUP_BUILD_TESTS=OFF -DYUP_BUILD_EXAMPLES=OFF
  • Build: cmake --build build --config Release
  • Validate the produced CLAP/VST3/standalone targets in at least one host.
  • Test sample-rate changes, buffer-size changes, transport reset, preset recall, automation, MIDI timing, bypass/suspend/resume, and editor open/close.
  • If the plugin reports latency or tail, override getLatencySamples() and getTailSamples() and verify hosts receive correct values.

Common pitfalls

PitfallCorrect approach
Reading raw AudioParameter values directly for smoothed DSPUse AudioParameterHandle initialised in prepareToPlay
Forgetting updateNextAudioBlock()Call it once at the top of each audio block before getNextValue() or skip()
Calling setValueNotifyingHost() from processBlockUse it from UI/host-control paths; keep audio-thread changes local or lock-free
Allocating MIDI voices on note-onPreallocate a bounded voice pool in prepareToPlay
Hard-coding stereo processing without matching AudioBusLayoutDeclare the layout explicitly and guard channel access
Missing state methodsImplement loadStateFromMemory / saveStateIntoMemory; hosts depend on them for recall
Holding getProcessLock() from UI/background workKeep state swaps short; the CLAP wrapper uses a try-lock around processing
Leaving state stale after prepareToPlay or flush()Reset voices, smoothers, filter history, delay buffers, and pending MIDI unconditionally

Use the yup-review skill to audit finished processor code for YUP-specific thread, parameter, wrapper, and bus-layout issues.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

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 のスキルをすべて見る

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