sequencer-integration

- Help an application developer and their coding agent integrate and use @kzkymur/sequencer effectively.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "sequencer-integration" with this command: npx skills add kzkymur/sequencer/kzkymur-sequencer-sequencer-integration

Purpose

  • Help an application developer and their coding agent integrate and use @kzkymur/sequencer effectively.

  • Provide minimal, reliable steps with links to focused references.

When To Use

  • Building animations, audio cues, game or UI events, or any timed workflow.

  • Needing linear (serial) or overlapping (parallel) event execution with millisecond control.

Quick Workflow

  • Choose Mode

  • Queue (class Sequencer ): run fragments strictly in order.

  • Independent (class IndependentSequencer ): run fragments by start time; multiple can overlap.

  • Define Fragments

  • Queue: new Fragment(name, durationMs, callback?) .

  • Independent: new IndependentFragment(name, durationMs, startMs, callback?) .

  • Modular: new CustomFragment(name, startMs) then addFragment(...) with independent/custom fragments; duration is computed; callback cannot be set directly.

  • Initialize

  • Queue: const seq = new Sequencer(pitchMs, speed=1.0, loop=false, useUniversalWorker=false) .

  • Independent: const seq = new IndependentSequencer(pitchMs, speed=1.0, loop=false) .

  • Pitch is the tick interval; smaller is smoother but costlier. useUniversalWorker=true improves timer precision.

  • Compose

  • push(fragment) to append.

  • insert(index, fragment) for Queue only (throws on Independent).

  • remove(fragment) by identity.

  • Control

  • await seq.play(delayMs=0) ; throws if already playing or delay < 0.

  • seq.stop(delayMs=0) ; throws if not playing or delay < 0.

  • await seq.waitCompleted() to await natural end (must be playing).

  • await seq.replay(delayMs=0) ; requires not playing; resets time to 0.

  • Visualize (optional)

  • seq.renderToCanvas(ctx, { width?, height?, activeColor?, inactiveColor?, timeIndicatorColor? }) .

Safety & Error Guards (agent-minded)

  • Validate inputs before calling:

  • setPitch(p > 0) , setSpeed(s > 0) ; non-positive or NaN throws.

  • play/stop(delay >= 0) ; negative or NaN throws.

  • insert(0..fragments.length) ; out-of-range throws.

  • Duplicates: pushing a fragment with an existing id throws.

  • Independent mode: insert(...) always throws (unsupported).

  • CustomFragment: cannot set callback; name must be non-empty; start must be ≥ 0.

Handy Getters

  • getFragments() returns a copy of current fragments.

  • getCurrentTime() current elapsed ms.

  • getPitch() , setPitch(...) .

  • setSpeed(...) , setLoopFlag(...) , isLooping() .

Open These References When Needed

  • references/quick-start.md – install + minimal setup.

  • references/api.md – precise method signatures and invariants.

  • references/patterns.md – common patterns (UI, audio, games, tasks).

  • references/testing.md – unit/integration test scaffolds.

  • references/troubleshooting.md – known errors and fixes.

Notes For Coding Agents

  • Prefer creating fragments once and reusing via .copy() when repeating patterns.

  • Await waitCompleted() when callers expect completion before proceeding.

  • For canvas, ensure totalDuration > 0 before rendering to avoid divide-by-zero visuals.

  • For high precision timelines, set useUniversalWorker=true (Queue mode) and avoid heavy work in callbacks.

References

  • See the skill-creator guidance in .agents/skills/skill-creator/ for structure and progressive disclosure patterns.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

dokidoki

Control interactive BLE devices (scan/connect/playback/timeline) from terminal.

Registry SourceRecently Updated
Coding

code

Comprehensive code review assistant that analyzes code quality, identifies bugs, suggests improvements, and ensures adherence to best practices. Use when rev...

Registry SourceRecently Updated
Coding

Markdown Lint

Use this skill immediately when the user needs to: set up markdownlint-cli2 and pre-commit hooks in a repository, fix or batch-repair markdownlint errors lik...

Registry SourceRecently Updated
Coding

Google Seo Assistant

A client-facing SEO assistant grounded in Google's official SEO Starter Guide. Use this skill whenever a user mentions SEO, search rankings, Google visibilit...

Registry SourceRecently Updated
1301gco