From apc-mini-tools
TypeScript and Node.js code samples for APC Mini MK2 development. Use when user needs "code example", "implementation", "easymidi", "@julusian/midi", "sample code", "how to implement", or wants working code for LED control, button handling, or MIDI communication.
npx claudepluginhub naporin0624/claude-plugin-apc-mini --plugin apc-mini-toolsThis skill uses the workspace's default tool permissions.
Quick start examples. For complete implementation details, see [reference.md](reference.md).
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Quick start examples. For complete implementation details, see reference.md.
# Rapid development
npm install easymidi && npm install -D @types/easymidi
# Production
npm install @julusian/midi
import easymidi from 'easymidi';
const createConnection = () => ({
output: new easymidi.Output('APC mini mk2'),
input: new easymidi.Input('APC mini mk2')
} as const);
// Red at full brightness (channel 6)
const setPad = (output: Output, note: number, velocity: number, channel = 6): void =>
output.send('noteon', { note, velocity, channel });
// Turn off
const setPadOff = (output: Output, note: number): void =>
output.send('noteon', { note, velocity: 0, channel: 0 });
const onPadPress = (input: Input, callback: (pad: number) => void): void =>
input.on('noteon', (msg) => {
if (msg.note < 64 && msg.velocity > 0) callback(msg.note);
});
const onTrackButton = (input: Input, callback: (track: number) => void): void =>
input.on('noteon', (msg) => {
if (msg.note >= 100 && msg.note <= 107) callback(msg.note - 99);
});
const onSceneButton = (input: Input, callback: (scene: number) => void): void =>
input.on('noteon', (msg) => {
if (msg.note >= 112 && msg.note <= 119) callback(msg.note - 111);
});
const onFader = (input: Input, callback: (fader: number, value: number) => void): void =>
input.on('cc', (msg) => {
if (msg.controller >= 48 && msg.controller <= 56) {
callback(msg.controller - 47, msg.value);
}
});
const encodeRGB = (v: number): readonly [number, number] =>
[(v >> 7) & 0x01, v & 0x7F] as const;
const setRGB = (output: Output, pad: number, r: number, g: number, b: number): void =>
output.send('sysex', [
0xF0, 0x47, 0x7F, 0x4F, 0x24, 0x00, 0x08,
pad, pad, ...encodeRGB(r), ...encodeRGB(g), ...encodeRGB(b),
0xF7
]);
const Colors = {
OFF: 0, WHITE: 3, RED: 5, ORANGE: 9, YELLOW: 13,
GREEN: 21, CYAN: 33, BLUE: 45, PURPLE: 49, MAGENTA: 53
} as const;