{"id":20823053,"url":"https://github.com/madskjeldgaard/supercollider-rust-plugin-template","last_synced_at":"2025-05-07T16:46:28.564Z","repository":{"id":226046181,"uuid":"767589395","full_name":"madskjeldgaard/supercollider-rust-plugin-template","owner":"madskjeldgaard","description":"🦀 Template for Rust-based SuperCollider plugins","archived":false,"fork":false,"pushed_at":"2024-03-07T10:08:18.000Z","size":18,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-03-08T10:58:17.718Z","etag":null,"topics":["cmake","corrosion","cxx","dsp","rust","rust-lang","supercollider"],"latest_commit_sha":null,"homepage":"","language":"CMake","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/madskjeldgaard.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}},"created_at":"2024-03-05T15:09:36.000Z","updated_at":"2024-03-07T19:56:18.000Z","dependencies_parsed_at":"2024-03-05T16:43:23.511Z","dependency_job_id":null,"html_url":"https://github.com/madskjeldgaard/supercollider-rust-plugin-template","commit_stats":null,"previous_names":["madskjeldgaard/supercollider-rust-plugin-example"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Fsupercollider-rust-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Fsupercollider-rust-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Fsupercollider-rust-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madskjeldgaard%2Fsupercollider-rust-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madskjeldgaard","download_url":"https://codeload.github.com/madskjeldgaard/supercollider-rust-plugin-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225096535,"owners_count":17420293,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cmake","corrosion","cxx","dsp","rust","rust-lang","supercollider"],"created_at":"2024-11-17T22:17:11.187Z","updated_at":"2024-11-17T22:17:12.861Z","avatar_url":"https://github.com/madskjeldgaard.png","language":"CMake","funding_links":["https://ko-fi.com/X8X6RXV10"],"categories":[],"sub_categories":[],"readme":"[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/X8X6RXV10)\n\n# RustGain\n\nAuthor: Mads Kjeldgaard\n\nAn example of using Rust to create a SuperCollider plugin. This plugin is silly and only uses Rust to change the gain of the samples but you can be creative with it however you want :)\n\nThe project is set up to be as fast and easy to use as possible. No need to clone source codes and place the certain places. Simply run the included commands to build and install. Build dependencies are handled automatically by CPM (C++ and CMake) and Cargo (Rust).\n\nIt is set up to create a small rust libray which is then imported into the C++ side of the plugin. A bridge is automatically generated by the [cxx](https://cxx.rs/) and [corrosion-rs](https://corrosion-rs.github.io/corrosion/) for the CMake part of it. It is all downloaded automatically, including the SuperCollider source code needed, via the CPM package manager. \n\nTo use this, simply clone this repo and replace the \"RustGain\" name throughout the project with your own plugin name.\n\n## Features\n\n- A handy build script `commands.sh` to easily build and install the plugin, no extra steps needed\n- Automatic dependency handling via the CPM package manager (No need to manually clone SuperCollider, etc.)\n- Automatic generation of C++ headers for the Rust code (handled via corrosion-rs and cxxbridge)\n- VSCode / Neovim Overseer build tasks to easily run all build commands from your editor\n\n### Requirements\n\n- CMake \u003e= 3.15\n- Rust\n\n## Workflow\n\nA typical workflow for developing an audio plugin using this template looks like this:\n\n0. Make changes to the code\n1. Run the build commands to build and install (see below)\n2. Recompile the SuperCollider class library:\n    - In the SuperCollider IDE, run `Language\u003e Recompile Class Library`\n    or:\n    - In SuperCollider code, evaluate `thisProcess.recompile()`\n3. Run your plugin by evaluating this code in SuperCollider:\n\n```supercollider\ns.waitForBoot {\n    \"Supercollider sound server booted\".postln;\n\n    play{\n        var sig = SinOsc.ar(440)!2;\n        // Run RustGain plugin on a sine wave\n        RustGain.ar(sig, gain: 0.5)\n    }\n\n}\n```\n\n## Building\n\nClone the project:\n\n    git clone https://github.com/madskjeldgaard/RustGain\n    cd RustGain\n\n### Using commands.sh\n\nAn easier way to build is included via the commands.sh script. This will automatically find the path to your SuperCollider extensions and install the plugin after build.\n\n```bash\n# Only needed once:\nchmod +x scripts/commands.sh\n\n# Configure and build\n./scripts/commands.sh configure_release\n./scripts/commands.sh build\n./scripts/commands.sh build_and_install\n\n# Optionally clean\n./scripts/commands.sh clean\n```\n\n### Using CMake directly\n\nThen, use CMake to configure and build it:\n\n    mkdir build\n    cd build\n    cmake .. -DCMAKE_BUILD_TYPE=Release\n    cmake --build . --config Release\n    cmake --build . --config Release --target install\n\nYou may want to manually specify the install location in the first step to point it at your\nSuperCollider extensions directory: add the option `-DCMAKE_INSTALL_PREFIX=/path/to/extensions` (this is done automatically by commands.sh if you go that route)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Fsupercollider-rust-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadskjeldgaard%2Fsupercollider-rust-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadskjeldgaard%2Fsupercollider-rust-plugin-template/lists"}