{"id":13768500,"url":"https://github.com/scriptify/Chnl","last_synced_at":"2025-05-10T23:31:18.527Z","repository":{"id":57397297,"uuid":"68926655","full_name":"scriptify/Chnl","owner":"scriptify","description":"Chnl - one channel, all effects.","archived":false,"fork":false,"pushed_at":"2017-03-26T13:09:01.000Z","size":41,"stargazers_count":41,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T19:46:00.577Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriptify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-22T13:58:46.000Z","updated_at":"2023-10-25T12:40:46.000Z","dependencies_parsed_at":"2022-09-14T07:00:57.702Z","dependency_job_id":null,"html_url":"https://github.com/scriptify/Chnl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptify%2FChnl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptify%2FChnl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptify%2FChnl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptify%2FChnl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptify","download_url":"https://codeload.github.com/scriptify/Chnl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497296,"owners_count":21917683,"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":[],"created_at":"2024-08-03T16:01:22.211Z","updated_at":"2025-05-10T23:31:16.342Z","avatar_url":"https://github.com/scriptify.png","language":"JavaScript","readme":"# ATTENTION!\n# This package is now maintained as a part of the [sountility collection](https://github.com/scriptify/sountility). This repository won't be used anymore for this package, but it will still be maintained.\n\n# Chnl - one channel, all effects.\n\n## Why would I ever want a _Chnl_?\n\nI needed something with a LOT of audio effects integrated which can be manipulated in many different aspects. And I needed to use this in many different ways: Every native AudioNode should be able to connect to it as it would be a normal AudioNode, but also other Chnls should be able to connect to another Chnl.\nSo I could simply and intuitively create audio graphs with a set of effects.\nNo matter if I connect a song, mic input or even a synthesizer.\n\n__Therefore I created _Chnl_.__\n\n__Attention__: Since the [webaudio-effect-unit](https://github.com/scriptify/webaudio-effect-unit) has reached v.1.1.0, the way how the effects work has changed. Have a look at it's repository for more details. Make sure to do this __BEFORE__ you update. If you have difficulties or question, just open an issue! I am always glad if I can help. :smile:\n## Installation\nVia npm\n```\nnpm i webaudio-chnl -S\n```\n\n\n## Usage\nIt's really simple. And intuitive.\n### Creating a __Chnl__\nYou can create a new _Chnl_ instance by constructing the _Chnl_-class with your _AudioContext object_ as the 1° parameter.\n```javascript\nnew Channel(audioCtx)\n```\n\n### Effects\nYou have access to __a lot of effects__.\nUnder the hood, _Chnl_ uses the [webaudio-effect-units-collection](https://github.com/scriptify/webaudio-effect-units-collection) module. So you have access to a lot of effects which can be enabled and disabled.\n\nYou can access the effects with the _effects_ property of your _Chnl_ instance.\n\n\n_Example_\n```javascript\nconst channel = new Chnl(audioCtx);\nconst {\n  gain,\n  chorus,\n  delay,\n  phaser,\n  overdrive,\n  compressor,\n  lowpass,\n  highpass,\n  tremolo,\n  wahwah,\n  bitcrusher,\n  moog,\n  pingPongDelay\n} = channel.effects;\n\ngain.setValue('gain', 0.55);\n\ndelay.addEffect('delay');\ndelay.setValue('feedback', 0.2);\n```\n\n### Connecting\n#### Connect to a Chnl\nYou can connect any _normal AudioNode_ to a _Chnl_:\n```javascript\nconst channel = new Chnl(audioCtx);\nconst gain = audioCtx.createGain();\ngain.connect(channel);\n```\nBut you can also connect a _Chnl_ to a _normal AudioNode_:\n```javascript\nconst channel = new Chnl(audioCtx);\nconst gain = audioCtx.createGain();\nchannel.connect(gain);\n```\nYou can even connect one _Chnl_ to another one:\n```javascript\nconst channel1 = new Chnl(audioCtx);\nconst channel2 = new Chnl(audioCtx);\nchannel1.connect(channel2);\n```\nHave fun connecting!\n\n### Activating an effect (since v0.0.6)\nPer default, no effect is connected in the interior audio graph. In previous versions, this was the case. I decided to revise the way how effects are used. Because if all effects are initially actively connected, there's way more needless audio processing (also if the effects are initially turned off). Therefore I decided to connect the effects only if they are explicitly needed.\n\n__TLDR:__ Before using an effect, you need to activate it. When activating an effect, the whole audiograph will be rebuilt.\n\n__Note:__ The 'gain'-effect is already activated by default.\n\n_Example_:\n```javascript\nconst chnl = new Chnl(audioCtx);\nchnl.addEffect('delay');\nchnl.addEffect('chorus');\nchnl.effects.delay.setValue('delayTime', 500);\n```\n\n### Disabling an effect (since v0.0.6)\nSince you can activate an effect, it's no surprise that you can also disable the same effect. When you disable an effect, it will be removed from the audiograph to prevent needless processing.\n_Example_:\n```javascript\nconst chnl = new Chnl(audioCtx);\nchnl.addEffect('delay');\nchnl.effects.delay.setValue('delayTime', 500);\nchnl.removeEffect('chorus');\n```\n\n### Final example\nThis a bit more advanced example, which connects an oscillator to a Chnl and applies some effects.\n```javascript\nconst audioCtx = new AudioContext();\nconst chnl = new Chnl(audioCtx);\n\nconst osci = audioCtx.createOscillator();\nosci.frequency.value = 300;\n\nosci.connect(chnl);\nchnl.connect(audioCtx.destination);\n\n// Activate effects\nchnl.addEffect('highpass');\nchnl.addEffect('bitcrusher');\n\nchnl.effects.gain.setValue('gain', 0.2);\nchnl.effects.highpass.setValue('frequency', 500);\nchnl.effects.bitcrusher.setValue('bits', 4);\n\nosci.start();\n```\n","funding_links":[],"categories":["Programming Languages","Sound editing"],"sub_categories":["Javascript","Sound effects/processing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptify%2FChnl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptify%2FChnl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptify%2FChnl/lists"}