mpc-plugin-dsp — скилл для Claude Code: DSP в MPC-плагинах
Скилл mpc-plugin-dsp для Claude Code помогает писать и менять DSP-код MPC-плагина. Включается при работе с синтезом, эффектами, MIDI или параметрами.
MIT ★ 200 обновлён 2026-11-07
npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a claude-codeЧто делает mpc-plugin-dsp
Скилл помогает писать и менять аудиокод MPC-плагинов: DSP, голоса, обработку MIDI, параметры и сохранение состояния. Он опирается на SDK-фреймворк и направляет к framework/mpc_plugin.h, где описан класс mpc::Plugin. Новые параметры добавляют в конец списка, не меняя порядок и строки id существующих параметров.
Для синтезатора описан шаблон с dsp::VoiceAllocator<8>, а для эффектов — обработка входов и выходов с миксом dry/wet. В process() нельзя выделять память, обращаться к файлам или использовать мьютексы; аудиоданные и коэффициенты загружают или готовят заранее. После правок нужно пересобрать плагин и запустить симулятор хоста с помощью скилла mpc-plugin-test.
Если добавлены параметры, обновляют ui.json и список параметров в README, а в plugin.json меняют version. Для файлов плагина разрешена только распространяемая аудиоданные; их лицензию записывают в README.
Какие задачи решает
- добавить голос, параметр или MIDI-обработку в MPC-плагин
- изменить алгоритм синтеза или аудиоэффекта
- перенести DSP-код в MPC-плагин
- проверить ограничения реального времени в
process()
Примеры запросов агенту
- Добавь параметр громкости и подключи его к обработке звука MPC-плагина.
- Перенеси этот алгоритм синтеза в MPC-плагин через SDK.
- Исправь MIDI-обработку и проверь код в
process().
Как установить mpc-plugin-dsp
1Через Skills CLI (Vercel)
npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a claude-code2Вручную: положить файлы
~/.claude/skills/mpc-plugin-dsp/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/mpc-plugin-dsp/
1Через Skills CLI (Vercel)
npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a codex2Вручную: положить файлы
.agents/skills/mpc-plugin-dsp/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a cursor2Вручную: положить файлы
.cursor/skills/mpc-plugin-dsp/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install inmusic-software/mpc-plugin-builder-sdk .agents/skills/mpc-plugin-dsp2Вручную: положить файлы
.github/skills/mpc-plugin-dsp/SKILL.md1Через Skills CLI (Vercel)
npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a gemini-cli2Командой платформы
gemini skills install https://github.com/inmusic-software/mpc-plugin-builder-sdk --path .agents/skills/mpc-plugin-dspВручную: положить файлы
.devin/skills/mpc-plugin-dsp/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о mpc-plugin-dsp
Как установить mpc-plugin-dsp в Claude Code?
Выполни npx skills add inmusic-software/mpc-plugin-builder-sdk --skill mpc-plugin-dsp -a claude-code. Файл скилла появится по пути ~/.claude/skills/mpc-plugin-dsp/SKILL.md.
Что делает mpc-plugin-dsp?
Скилл помогает менять DSP-код MPC-плагина: синтез, эффекты, обработку голосов и MIDI, параметры и состояние. Также он описывает ограничения аудиокода реального времени.
Какие ограничения есть у кода в process()?
В process() нельзя выделять память, обращаться к файлам, использовать мьютексы или печатать в консоль. Данные и коэффициенты нужно подготовить заранее.
Исходный текст
SKILL.md · MIT
---
name: mpc-plugin-dsp
description: Write or change the audio code (DSP, voices, MIDI handling, parameters, state) of an MPC plugin using the SDK framework. Use when adding features, fixing sound problems, adding parameters, changing synthesis or effect algorithms, or porting existing DSP to an MPC plugin.
---
# Working on plugin DSP
## Know the framework
Read `framework/mpc_plugin.h` (class `mpc::Plugin`) before editing. Key points:
- Declare parameters in the constructor with `addParam(mpc::floatParam/logParam/intParam/boolParam/choiceParam(...))`; keep the returned index in a member. Order = parameter index = what the MPC sees. Append new parameters at the end; never reorder or rename `id` strings.
- Read values in `process()` with `get(i)` (plain value), `getBool(i)`, `getInt(i)`. Smooth anything audible with `dsp::Smoother`.
- `process(mpc::ProcessContext& ctx)`: `ctx.inputs[ch][i]` (may be null for 0-input instruments), `ctx.outputs[ch][i]` (already zeroed), `ctx.numFrames`, `ctx.midi[0..numMidiEvents)` sorted by `sampleOffset`, `ctx.transport` (bpm, ppqPos, playing), `ctx.sampleRate`.
- `prepare(sampleRate, maxBlock)` allocates and sets coefficients; `reset()` clears state (called on resume and after state load).
- Extra state beyond parameters: `saveExtraState` / `loadExtraState` (byte vector). Built-in presets: `addProgram`.
- **Files shipped with the plugin (samples, wavetables, impulse responses, data tables)**: put them in `plugins/<Name>/Content/` (any subfolders). `build.py` copies that to `Content/` beside `Plugin Skins/`. In code, `#include "dsp/wav.h"` (mpc_plugin.h already pulls in `mpc_resources.h`) and use `mpc::contentPath("Samples/kick.wav")`, `dsp::loadWav(path, wav)` (PCM 8/16/24/32 + float WAV -> float channels), `mpc::readFile` / `mpc::readTextFile` for anything else, `mpc::pluginFolder()` for the plugin folder. The path comes from where the loaded library lives (VST2 gives no other way), never hard-code one. Load in the constructor / `prepare()` / `loadExtraState()`, never in `process()`; keep data in members; if loading fails, fall back to a generated sound. Keep memory small (each instance loads its own copy). Test under `host_sim` works without setup (it finds the project's `Content/`); `MPC_PLUGIN_FOLDER=<dir>` overrides. Only use content you may redistribute and record the licence in the README. See cookbook §11b.
- Custom value text: override `formatValue(index, plain, out)`.
## Patterns
- **Poly synth**: `dsp::VoiceAllocator<8>` + per-voice oscillator/filter/envelopes; render voices into the output, apply master gain. See `examples/SimpleSynth`.
- **Drum instrument**: map notes to voices; one-shot envelopes; multi-out by writing to `ctx.outputs[2..3]`. See `examples/DrumSynth`.
- **Effect**: read `ctx.inputs`, write `ctx.outputs`; dry/wet mix; tempo-sync via `ctx.transport.bpm` and `dsp/tempo.h`. See `examples/StereoDelay`.
- **Sequencer-instrument**: derive the step from `ctx.transport.ppqPos` when `playing`, trigger internal voices; never use wall-clock time.
- **MIDI**: handle `isNoteOn`, `isNoteOff`, `isAllNotesOff`, `isPitchBend` (`pitchBend()` −8192..8191), `isController` (CC 1 mod wheel, 64 sustain). Note-on with velocity 0 is a note-off (`isNoteOff()` already covers it).
## Realtime rules
No `new`/`malloc`/`std::vector::push_back`/`std::string` in `process`; no mutex; no `printf`; no file access. Treat `maxBlockSize` as a ceiling. Check array indices (note numbers 0–127, voice indices, delay reads). Avoid per-sample `std::pow`, `std::exp`, `std::sin` in inner loops; compute coefficients per block or use `dsp/math.h` approximations. Denormals are flushed by the framework.
## Performance budget
One instance should use well under 15% of a Cortex-A17 core at 128 frames / 44.1 kHz. Rough costs: a PolyBLEP oscillator ≈ cheap, a TPT SVF ≈ cheap, `std::sin` per sample ≈ expensive, 8 voices × (2 osc + filter + 2 env) ≈ fine, oversampling ≈ multiply everything.
## After changing code
Rebuild and run the host simulator (`mpc-plugin-test` skill). If you added parameters, update `ui.json` and the README's parameter list, and bump `version` in `plugin.json`.
More: `docs/dsp-cookbook.md`, `docs/host-contract.md`.
© inmusic-software · MIT · inmusic-software/mpc-plugin-builder-sdk