{"id":19133139,"url":"https://github.com/tversteeg/usfx","last_synced_at":"2025-04-05T06:08:22.810Z","repository":{"id":57671316,"uuid":"251007442","full_name":"tversteeg/usfx","owner":"tversteeg","description":"🎼 Realtime procedurally generated sound effects","archived":false,"fork":false,"pushed_at":"2025-03-19T10:14:28.000Z","size":84,"stargazers_count":55,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T05:08:44.346Z","etag":null,"topics":["audio","procedural-generation","rust","sfx","sfxr"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tversteeg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-03-29T10:37:56.000Z","updated_at":"2025-03-05T19:43:51.000Z","dependencies_parsed_at":"2024-03-05T04:27:43.908Z","dependency_job_id":"c489a00e-9219-4705-b345-b7bebb8c796b","html_url":"https://github.com/tversteeg/usfx","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.125,"last_synced_commit":"b876029b7b72a8484b128c8c446234c22ef150e2"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":"tversteeg/library-github-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tversteeg%2Fusfx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tversteeg%2Fusfx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tversteeg%2Fusfx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tversteeg%2Fusfx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tversteeg","download_url":"https://codeload.github.com/tversteeg/usfx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294539,"owners_count":20915340,"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":["audio","procedural-generation","rust","sfx","sfxr"],"created_at":"2024-11-09T06:21:08.646Z","updated_at":"2025-04-05T06:08:22.785Z","avatar_url":"https://github.com/tversteeg.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eμsfx\u003c/h1\u003e\n\t\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/tversteeg/usfx/actions\"\u003e\u003cimg src=\"https://github.com/tversteeg/usfx/workflows/CI/badge.svg\" alt=\"CI\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://crates.io/crates/usfx\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/usfx.svg\" alt=\"Version\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://docs.rs/usfx\"\u003e\u003cimg src=\"https://img.shields.io/badge/api-rustdoc-blue.svg\" alt=\"Rust Documentation\"/\u003e\u003c/a\u003e\n\t\u003cimg src=\"https://img.shields.io/crates/l/usfx.svg\" alt=\"License\"/\u003e\n\t\u003cbr/\u003e\n\u003c/p\u003e\n\n\u003c!-- cargo-rdme start --\u003e\n\nGenerate sound effects for your game in realtime.\n\n## Example\n\n```rust\n// Create a simple blip sound\nlet mut sample = usfx::Sample::default();\nsample.volume(0.5);\n\n// Use a sine wave oscillator at 500 hz\nsample.osc_type(usfx::OscillatorType::Sine);\nsample.osc_frequency(500);\n\n// Set the envelope\nsample.env_attack(0.02);\nsample.env_decay(0.05);\nsample.env_sustain(0.2);\nsample.env_release(0.5);\n\n// Add some distortion\nsample.dis_crunch(0.5);\nsample.dis_drive(0.9);\n\n// Create a mixer so we can play the sound\nlet mut mixer = usfx::Mixer::default();\n\n// Play our sample\nmixer.play(sample);\n\n// Plug our mixer into the audio device loop\n// ...\nmixer.generate(\u0026mut audio_device_buffer);\n```\n\n\u003c!-- cargo-rdme end --\u003e\n\nThe [`cpal`](examples/cpal.rs) \u0026 [`sdl`](examples/sdl2.rs) examples illustrate how to use it with different audio libraries. The [`music`](examples/music.rs) example shows how to create procedurally generated music with it (don't expect a masterpiece though, it's obvious I'm not a musician).\n\n### CPAL Example\n\nTo build the [`cpal`](examples/cpal.rs) \u0026 [`music`](examples/music.rs) examples on Linux you will need to have the alsa development libraries:\n\n```bash\nsudo apt install libasound2-dev\n```\n\n### SDL Example\n\nTo build the [`sdl`](examples/sdl2.rs) you will need the SDL2 development libraries, on Linux:\n\n```bash\nsudo apt install libsdl2-dev\n```\n\n## Tools\n\n- [usfx-test](https://github.com/emmabritton/uxfs-test) - pretty GUI program for playing with the parameters by @emmabritton\n\n## Special Thanks\n\n- [sfxr-rs](https://github.com/bzar/sfxr-rs) - inspiration\n- [amsynth](https://github.com/amsynth/amsynth) - distortion algorithm\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftversteeg%2Fusfx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftversteeg%2Fusfx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftversteeg%2Fusfx/lists"}