parameters
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "add a parameter", "define parameters", "create an enum parameter", "add a gain control", "add a frequency…
от iPlug2★ 2 458 звёзд на GitHubОб этом скилле
Parameter System
Guidance for defining, grouping, manipulating, smoothing, and serializing parameters in iPlug2 plugins.
Core Pattern
Parameters are defined as an enum in the plugin header and initialized in the constructor:
// Plugin.h
enum EParams {
kGain = 0,
kFreq,
kNumParams
};
// Plugin.cpp constructor
GetParam(kGain)->InitGain("Gain", 0., -70., 24., 0.5);
GetParam(kFreq)->InitFrequency("Frequency", 1000., 20., 20000.);
kNumParams is passed to the plugin config and determines the fixed parameter count. Parameters are accessed by index throughout the plugin.
Choosing an Init Method
Use the most specific Init method available -- it sets sensible defaults for range, step, label, unit, and shape:
| Need | Method | Defaults |
|---|---|---|
| General continuous value | InitDouble(name, default, min, max, step, label) |
Linear shape |
| On/off toggle | InitBool(name, default) |
"off"/"on" display text |
| List of choices | InitEnum(name, default, {"A", "B", "C"}) |
Stepped, auto-indexed |
| Integer range | InitInt(name, default, min, max) |
Stepped |
| Volume/gain in dB | InitGain(name, default) |
-70 to 24 dB, 0.5 step |
| Frequency in Hz | InitFrequency(name, default) |
0.1 to 10000 Hz, log shape |
| 0-100% | InitPercentage(name, default) |
0 to 100 |
| Time in seconds | InitSeconds(name, default) |
0 to 10 s |
| Time in ms | InitMilliseconds(name, default) |
0 to 100 ms |
| MIDI note number | InitPitch(name, default) |
0 to 128 |
| Angle | InitAngleDegrees(name, default) |
0 to 360 |
| Clone another param | Init(otherParam, search, replace, newGroup) |
Copies all settings |
All Init methods accept optional flags and group arguments. InitDouble additionally takes a shape, unit, and displayFunc.
For complete Init method signatures and all IParam methods, consult references/iparam-api.md.
Parameter Shapes
Shapes control how normalized (0-1) values map to real values. This affects both UI control feel and automation curves:
| Shape | Use Case | Example |
|---|---|---|
ShapeLinear() |
Default, uniform mapping | Gain, percentage |
ShapePowCurve(3.) |
Skew toward low end | ADSR times, where fine control at small values matters |
ShapePowCurve(0.5) |
Skew toward high end | Rarely used |
ShapeExp() |
Exponential (true log) | Frequency sweeps |
GetParam(kAttack)->InitDouble("Attack", 10., 1., 1000., 0.1, "ms",
IParam::kFlagsNone, "ADSR", IParam::ShapePowCurve(3.));
Parameter Groups
Group parameters for organization and batch operations. Pass the group name as the group argument to any Init method:
GetParam(kAttack)->InitDouble("Attack", 10., 1., 1000., 0.1, "ms", 0, "ADSR", IParam::ShapePowCurve(3.));
GetParam(kDecay)->InitDouble("Decay", 10., 1., 1000., 0.1, "ms", 0, "ADSR", IParam::ShapePowCurve(3.));
GetParam(kSustain)->InitPercentage("Sustain", 50., 0., 100., 0, "ADSR");
GetParam(kRelease)->InitDouble("Release", 10., 2., 1000., 0.1, "ms", 0, "ADSR");
Groups enable batch operations:
ForParamInGroup("ADSR", [](int idx, IParam& param) { /* ... */ });
RandomiseParamValues("ADSR");
DefaultParamValues("ADSR");
CopyParamValues("ADSR Input", "ADSR Output");
Groups are also used by hosts to organize automation lists and by IGraphics for IVGroupControl visual grouping.
Batch Operations and Randomization
Operate on parameters in bulk by range or group:
| Method | Purpose |
|---|---|
RandomiseParamValues() |
Randomize all parameters |
RandomiseParamValues(start, end) |
Randomize a range |
RandomiseParamValues("group") |
Randomize a group |
DefaultParamValues() |
Reset all to defaults |
DefaultParamValues(start, end) |
Reset a range |
DefaultParamValues("group") |
Reset a group |
CopyParamValues(srcIdx, destIdx, n) |
Copy values between ranges |
CopyParamValues("srcGroup", "destGroup") |
Copy values between groups |
ForParamInRange(start, end, func) |
Apply lambda to range |
ForParamInGroup("group", func) |
Apply lambda to group |
InitParamRange(start, end, countStart, fmt, ...) |
Init many params at once |
CloneParamRange(srcStart, srcEnd, destStart) |
Clone with name substitution |
PrintParamValues() |
Debug-print all values |
// Custom randomization with constraints
ForParamInGroup("ADSR", [](int idx, IParam& param) {
double range = param.GetRange();
param.Set(param.GetMin() + range * std::rand() / RAND_MAX);
});
// Initialize 16 similar parameters at once
InitParamRange(kStep0, kStep15, 0, "Step %i", 0., 0., 1., 0.01, "", 0, "Sequencer");
// Clone a set of parameters with name substitution
CloneParamRange(kOsc1Freq, kOsc1Detune, kOsc2Freq, "Osc 1", "Osc 2", "Oscillator 2");
For the complete batch operations API, consult references/batch-operations.md.
Parameter Access in ProcessBlock
Reading parameter values must be realtime-safe. Use `Value()
Установить parameters в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл parameters?
This skill should be used when the user asks to "add a parameter", "define parameters", "create an enum parameter", "add a gain control", "add a frequency parameter", "use parameter groups", "randomize parameters", "reset to defaults", "smooth a parameter", "use LogParamSmooth", "create presets", "serialize state", "handle OnParamChange", "copy parameter values", "use InitDouble", "use InitEnum", "use InitBool", "use parameter shapes", "use ShapePowCurve", "parameter flags", or discusses parameter definition, grouping, batch operations, smoothing, presets, or state serialization in an iPlug2 plugin.
Как установить скилл parameters?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл parameters запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic