{"id":21490633,"url":"https://github.com/kyle-shanks/dot","last_synced_at":"2025-07-15T17:32:06.445Z","repository":{"id":57215291,"uuid":"361966381","full_name":"Kyle-Shanks/Dot","owner":"Kyle-Shanks","description":"A simple web audio library","archived":false,"fork":false,"pushed_at":"2021-12-20T17:43:15.000Z","size":598,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T21:59:52.854Z","etag":null,"topics":["audio","synthesizer","web-audio-api"],"latest_commit_sha":null,"homepage":"https://dot-docs.netlify.app/","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/Kyle-Shanks.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":"2021-04-27T03:17:53.000Z","updated_at":"2022-08-08T18:48:22.000Z","dependencies_parsed_at":"2022-08-24T21:00:51.190Z","dependency_job_id":null,"html_url":"https://github.com/Kyle-Shanks/Dot","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/Kyle-Shanks%2FDot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyle-Shanks%2FDot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyle-Shanks%2FDot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kyle-Shanks%2FDot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kyle-Shanks","download_url":"https://codeload.github.com/Kyle-Shanks/Dot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226057438,"owners_count":17566950,"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","synthesizer","web-audio-api"],"created_at":"2024-11-23T14:44:56.036Z","updated_at":"2024-11-23T14:44:56.609Z","avatar_url":"https://github.com/Kyle-Shanks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dot\nDot is a simple web audio library for creating synthesizers and other real-time audio synthesis projects.\n\n# Installation\nInstall using npm\n```bash\nnpm install dot-audio\n```\n\nInstall using yarn:\n```bash\nyarn add dot-audio\n```\n\nImporting Dot in a project:\n```js\nimport * as Dot from 'dot-audio'\n```\n\nImporting specific nodes/classes:\n```js\nimport { MonoSynth, Keyboard } from 'dot-audio'\n```\n\n# Overview\nDot includes a collection of nodes, classes, and utility functions to make creating audio projects as easy as possible, while still remaining lightweight and flexible.\n\nA general overview of what is available:\n- Wrappers for most native web audio api nodes (gain, filter, delay, etc.)\n- ADSR envelope nodes (general-purpose envelope, gain envelope, filter envelope)\n- Effect nodes (chorus, distortion, reverb, etc.)\n- Source nodes for signal generation and modulation (oscillator, lfo, noise generator, etc.)\n- Custom instruments for general use (MonoSynth, PolySynth, FMSynth, etc.)\n- Pre-built keyboard input class (more input classes will be added in the future)\n\nMore extensive documentation is available on the [docs site](https://dot-docs.netlify.app/).\n\n# Basic Usage\n\nBasic Example:\n```js\nimport * as Dot from 'dot-audio'\n\n// Audio context of your choosing\nconst AC = new AudioContext()\n\n// Props to create a square wave pluck sound\nconst pluckProps = {\n    waveform: 'square',\n    filterFrequency: 0, // Filter frequency value\n    filterAmount: 1000, // Filter envelope amount\n    filterDecay: 0.4, // Filter envelope decay time\n    filterSustain: 0, // Filter envelope sustain value\n}\n// Create polyphonic synth with pluck props\nconst synth = new Dot.PolySynth(AC, pluckProps)\n\n// Connect synth to destination and play Cm7 chord\nsynth.connect(AC.destination)\nsynth.noteOn(['C4', 'D#4', 'G4', 'A#4'])\n```\n\nNode-Chaining Example:\n```js\nimport * as Dot from 'dot-audio'\n\n// Audio context\nconst AC = new AudioContext()\n\n// Create polyphonic synth\nconst synth = new Dot.PolySynth(\n    AC,\n    {\n        waveform: 'square',\n        filterFrequency: 0,\n        filterAmount: 1000,\n        filterDecay: 0.4,\n        filterSustain: 0,\n    }\n)\n\n// Create chorus and reverb effects for a nice lush sound\nconst chorus = new Dot.Chorus(AC, { amount: 0.4 })\nconst reverb = new Dot.Reverb(AC, { amount: 0.25 })\n\n// Create a limiter to tame the output\nconst limiter = new Dot.Limiter(AC)\n\n// Connect all nodes together and play Cm7 chord\nDot.chain(synth, chorus, reverb, limiter, AC.destination)\nsynth.noteOn(['C4', 'D#4', 'G4', 'A#4'])\n```\n\nKeyboard Example:\n```js\nimport * as Dot from 'dot-audio'\n\nconst AC = new AudioContext()\n\n// Nodes\nconst synth = new Dot.PolySynth(\n    AC,\n    {\n        waveform: 'square',\n        filterFrequency: 0,\n        filterAmount: 1000,\n        filterDecay: 0.4,\n        filterSustain: 0,\n        filterRelease: 0.1,\n    }\n)\nconst chorus = new Dot.Chorus(AC, { amount: 0.4 })\nconst reverb = new Dot.Reverb(AC, { amount: 0.25 })\nconst limiter = new Dot.Limiter(AC)\n\n// Connect\nDot.chain(synth, chorus, reverb, limiter, AC.destination)\n\n// Keyboard setup\nconst keyboard = new Dot.Keyboard({\n    onPress: (noteInfo) =\u003e {\n        // Start context when the user tries to play a note\n        if (AC.state === 'suspended') AC.resume()\n\n        synth.noteOn(noteInfo.fullNote)\n    },\n    onRelease: (noteInfo) =\u003e {\n        synth.noteOff(noteInfo.fullNote)\n    },\n})\n\n// Start keyboard listeners\nkeyboard.on()\n```\n\n**NOTE:** Browsers will not play audio by default without some form of interaction from the user (i.e. a click or key press). The above example also demonstrates a method to resume the audio context when the user attempts to play a note.\n\n# Nodes\nAll nodes are created using the following syntax:\n```js\nconst node = new Dot.NodeName(AC, props)\n```\n\nAll DotAudioNodes have access to a `::connect` and `::disconnect` methods to connect to other DotAudioNodes or native audio nodes.\n\n**Warning:** Native audio nodes will not be able to connect to DotAudioNodes directly, but may be connected to params via the `::getParam` and `::getParams` methods.\n\n## Core Nodes\nDot includes the following core nodes:\n- ChannelMerger\n- ChannelSplitter\n- Compressor\n- Convolver\n- Delay\n- Filter\n- Gain\n- StereoPanner\n- WaveShaper\n\n## Instruments\nInstruments are pre-built general purpose sound sources for easy use in a project. All instruments have methods to set their primary properties and `::noteOn`, `::noteOff`, and `::noteStop` methods to play notes that are passed in and trigger the instrument's envelope(s). (FMSynth is the only exception due to the algorithms having different carriers. The `::triggerAttack` and `::triggerRelease` methods can be used to trigger the envelope in that case)\n\nDot includes the following instruments:\n- Synth - Oscillator connected to a gain envelope\n- MonoSynth - Oscillator connected to a gain envelope and filter envelope\n- PolySynth - An 8 voice polyphonic synth built using MonoSynths\n- SimpleFMSynth - One modulator and one carrier connected to a gain envelope\n- FMSynth - Uses 4 modulators that are connected via different built-in algorithms, then connected to a gain envelope\n\n## Effects\nThere are many effect nodes, each with their own methods to control their properties.\n\nDot includes the following effects:\n- Chorus\n- Distortion\n- EQ2\n- Flanger\n- FeedbackDelay\n- PingPongDelay\n- Reverb\n\n# Docs\nMore extensive documentation on the general API for all nodes, instruments, effects, and more is available on the [docs site](https://dot-docs.netlify.app/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyle-shanks%2Fdot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkyle-shanks%2Fdot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkyle-shanks%2Fdot/lists"}