{"id":13768830,"url":"https://github.com/okaybenji/subpoly","last_synced_at":"2025-06-28T11:04:48.555Z","repository":{"id":57373960,"uuid":"43435011","full_name":"okaybenji/subpoly","owner":"okaybenji","description":"a Web Audio subtractive, polyphonic synthesizer","archived":false,"fork":false,"pushed_at":"2016-12-10T15:53:43.000Z","size":26,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-11T02:08:51.945Z","etag":null,"topics":["javascript","synth","synthesizer","webaudio"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/okaybenji.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}},"created_at":"2015-09-30T13:37:30.000Z","updated_at":"2025-03-26T02:58:01.000Z","dependencies_parsed_at":"2022-09-17T16:51:55.117Z","dependency_job_id":null,"html_url":"https://github.com/okaybenji/subpoly","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/okaybenji/subpoly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okaybenji%2Fsubpoly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okaybenji%2Fsubpoly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okaybenji%2Fsubpoly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okaybenji%2Fsubpoly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okaybenji","download_url":"https://codeload.github.com/okaybenji/subpoly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okaybenji%2Fsubpoly/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259350365,"owners_count":22844338,"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":["javascript","synth","synthesizer","webaudio"],"created_at":"2024-08-03T16:01:26.404Z","updated_at":"2025-06-28T11:04:48.536Z","avatar_url":"https://github.com/okaybenji.png","language":"JavaScript","readme":"# subpoly\nA Web Audio subtractive, polyphonic synthesizer. Just need one voice? Check out [submono](https://github.com/okaybenji/submono)!\n\n### Create a synth.\n```\nvar audioCtx = new AudioContext();\nvar synth = new Polysynth(audioCtx);\n```\n\n**Your new `synth` has an array of [submono](https://github.com/okaybenji/submono) `voices` attached.**\n\n### Play a note.\n`synth.voices[i].start();`\n\n### Stop playing.\n`synth.voices[i].stop();`\n\n### Play all voices.\n`synth.start();`\n\n### Stop all notes.\n`synth.stop();`\n\n### Use methods to access a voice's pitch and waveform...\n```\nsynth.voices[i].pitch(440);              // in hertz\nconsole.log(synth.voices[i].waveform()); // 'sawtooth'\n```\n\n### ...get or set any other properties directly.\n```\nsynth.voices[i].maxGain = 0.5; // out of 1\nsynth.voices[i].attack = 1.0;  // in seconds\n```\n\n### Use methods to set any property for all voices at once.\n```\nsynth.maxGain(0.5);         // out of 1\nsynth.attack(1.0);          // in seconds\nsynth.pitch(440);           // in hertz\nsynth.waveform('sawtooth'); // or sine, triangle, square\n```\n\n### Set the stereo width.\n`synth.width(1.0); // out of 1`\n\n### Configure any or all the properties on initialization.\n```\nvar config = {\n  waveform: 'sawtooth', // or sine, triangle, square\n  pitch: 440,           // in hertz\n  maxGain: 0.5,         // out of 1\n  attack: 0.1,          // in seconds\n  decay: 0.0,           // in seconds\n  sustain: 1.0,         // out of 1\n  release: 0.8,         // in seconds\n  stereoWidth: 0.5,     // out of 1\n  numVoices: 5,         // unlimited\n  cutoff: {\n    maxFrequency: 7500, // in hertz\n    attack: 0.1,        // in seconds\n    decay: 2.5,         // in seconds\n    sustain: 0.2        // 0-5; maxFrequency multiplied by this\n  }\n};\n\nvar synth = new Polysynth(audioCtx, config);\n```\n\n### Demo\n[musical typing](http://okaybenji.github.io/web-synth/)\n","funding_links":[],"categories":["MIDI instruments"],"sub_categories":["Synths"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokaybenji%2Fsubpoly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokaybenji%2Fsubpoly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokaybenji%2Fsubpoly/lists"}