{"id":37319602,"url":"https://github.com/dfl/clap-trap","last_synced_at":"2026-01-19T11:00:37.771Z","repository":{"id":332163716,"uuid":"1132963167","full_name":"dfl/clap-trap","owner":"dfl","description":"headless CLAP host for integration testing","archived":false,"fork":false,"pushed_at":"2026-01-12T20:00:53.000Z","size":60,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T15:22:32.755Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dfl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-12T17:33:22.000Z","updated_at":"2026-01-16T01:13:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dfl/clap-trap","commit_stats":null,"previous_names":["dfl/clap-trap"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dfl/clap-trap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfl%2Fclap-trap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfl%2Fclap-trap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfl%2Fclap-trap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfl%2Fclap-trap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfl","download_url":"https://codeload.github.com/dfl/clap-trap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfl%2Fclap-trap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-16T03:16:25.619Z","updated_at":"2026-01-19T11:00:37.749Z","avatar_url":"https://github.com/dfl.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clap-trap\n\n[![CI](https://github.com/dfl/clap-trap/actions/workflows/ci.yml/badge.svg)](https://github.com/dfl/clap-trap/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GitHub release](https://img.shields.io/github/v/release/dfl/clap-trap)](https://github.com/dfl/clap-trap/releases)\n\nA command-line tool for testing CLAP plugins. Validate, benchmark, render audio, and test state—no DAW required.\n\nSupports both **native** `.clap` plugins and **WASM** `.wclap`/`.wasm` plugins (via [wclap-bridge](https://github.com/WebCLAP/wclap-bridge)).\n\n*It's a trap! ...for catching CLAP plugin bugs.*\n\n## Installation\n\nDownload binaries from [Releases](https://github.com/dfl/clap-trap/releases)—**WASM plugin support is included by default**.\n\n## Commands\n\n### validate\n\nBasic smoke test: load plugin, process audio, check for crashes and bad output.\n\n```bash\n# Native plugin\nclap-trap validate plugin.clap\n\n# WASM plugin bundle\nclap-trap validate plugin.wclap\n\n# Raw WASM file\nclap-trap validate plugin.wasm\n```\n\n```\n✓ Plugin loaded\n✓ Got plugin factory\n✓ Found 1 plugin(s)\n\n── My Plugin ──\n  ✓ create_plugin()\n  ✓ init()\n  ✓ activate(48000 Hz, 256 samples)\n  ✓ start_processing()\n  ✓ process() x10 blocks\n  ✓ stop_processing()\n  ✓ deactivate()\n  ✓ destroy()\n\nAll 1 plugin(s) validated successfully.\n```\n\n### info\n\nDump plugin details: parameters, audio ports, note ports, supported extensions.\n\n```bash\nclap-trap info plugin.clap\n```\n\n### bench\n\nMeasure processing performance.\n\n```bash\nclap-trap bench plugin.clap --blocks 10000\n```\n\n```\nMy Plugin                                  3584.2x realtime    7.3 µs/block  (10000 blocks)\n```\n\n### process\n\nOffline audio rendering. Process a WAV file through a plugin, or render a synth to WAV.\n\n```bash\n# Process audio through an effect\nclap-trap process effect.clap -i input.wav -o output.wav\n\n# Render a synth (silence in, capture output)\nclap-trap process synth.clap -o output.wav --blocks 1000\n\n# Output as 32-bit float\nclap-trap process plugin.clap -i input.wav -o output.wav --float\n```\n\n### state\n\nSave/load plugin state, or test state round-trip.\n\n```bash\n# Save state to file\nclap-trap state plugin.clap -o preset.state\n\n# Load state from file\nclap-trap state plugin.clap -i preset.state\n\n# Test round-trip: save, restore, verify all parameters match\nclap-trap state plugin.clap --roundtrip\n```\n\n```\nPlugin: My Plugin\nTesting state round-trip...\n  Saved state: 1350 bytes\n  Captured 31 parameter values\n  Restored state\n  All 31 parameters match after restore\n```\n\n## Options\n\n| Option | Description |\n|--------|-------------|\n| `--blocks N` | Number of blocks to process |\n| `--buffer-size N` | Buffer size in samples (default: 256) |\n| `--sample-rate N` | Sample rate in Hz (default: 48000) |\n| `-i, --input FILE` | Input WAV file (process) or state file (state) |\n| `-o, --output FILE` | Output WAV file (process) or state file (state) |\n| `--float` | Output 32-bit float WAV (default: 16-bit PCM) |\n| `--roundtrip` | Test state save/load round-trip |\n\n## How is this different from clap-validator?\n\n[clap-validator](https://github.com/free-audio/clap-validator) checks CLAP spec compliance. It's great. Use it.\n\n**clap-trap** is for integration testing:\n- Smoke test plugins in CI before release\n- Benchmark performance\n- Render audio offline for comparison tests\n- Verify state save/load works correctly\n- **WASM plugin support** (.wclap and .wasm files)\n\nUse clap-validator for spec compliance. Use clap-trap for \"does it actually work?\"\n\n### Using both in CI\n\n```yaml\n# In your plugin's CI workflow\n- name: Spec compliance\n  run: clap-validator validate my-plugin.clap\n\n- name: Integration tests\n  run: |\n    clap-trap validate my-plugin.clap\n    clap-trap bench my-plugin.clap --blocks 10000\n    clap-trap state my-plugin.clap --roundtrip\n```\n\n## Advanced\n\n### Building from Source\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake .. -DCMAKE_BUILD_TYPE=Release\ncmake --build .\n```\n\nWASM plugin support is enabled by default ([wclap-bridge](https://github.com/WebCLAP/wclap-bridge) is auto-fetched). For a smaller binary without WASM support:\n\n```bash\ncmake .. -DCMAKE_BUILD_TYPE=Release -DCLAP_TRAP_WASM_SUPPORT=OFF\n```\n\n### Using as a C++ Library\n\nIf you need to write custom tests, clap-trap can be used as a library:\n\n```cmake\nFetchContent_Declare(\n    clap-trap\n    GIT_REPOSITORY https://github.com/dfl/clap-trap.git\n    GIT_TAG main\n)\nFetchContent_MakeAvailable(clap-trap)\n\ntarget_link_libraries(your-target PRIVATE clap-trap)\n```\n\n```cpp\n#include \"clap-trap/clap-trap.h\"\n\nusing namespace clap_trap;\n\nauto loader = PluginLoader::load(\"/path/to/plugin.clap\");\nconst auto* factory = loader-\u003efactory();\n\nTestHost host;\nconst auto* desc = factory-\u003eget_plugin_descriptor(factory, 0);\nconst clap_plugin_t* plugin = factory-\u003ecreate_plugin(factory, host.clapHost(), desc-\u003eid);\n\nplugin-\u003einit(plugin);\nplugin-\u003eactivate(plugin, 48000, 256, 256);\nplugin-\u003estart_processing(plugin);\n\nStereoAudioBuffers buffers(256);\nbuffers.fillInputWithSine(440.0f, 48000.0f);\n\n// ... process audio ...\n\nplugin-\u003estop_processing(plugin);\nplugin-\u003edeactivate(plugin);\nplugin-\u003edestroy(plugin);\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfl%2Fclap-trap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfl%2Fclap-trap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfl%2Fclap-trap/lists"}