{"id":26227872,"url":"https://github.com/benji6/cycle-audio-graph","last_synced_at":"2025-04-19T16:20:21.668Z","repository":{"id":3101984,"uuid":"45038406","full_name":"benji6/cycle-audio-graph","owner":"benji6","description":"Audio graph driver for Cycle.js based on virtual-audio-graph","archived":false,"fork":false,"pushed_at":"2022-04-10T22:47:43.000Z","size":48,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T10:04:03.927Z","etag":null,"topics":["cyclejs","web-audio","web-audio-api"],"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/benji6.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-10-27T12:07:27.000Z","updated_at":"2023-10-09T18:41:44.000Z","dependencies_parsed_at":"2022-08-06T13:15:26.147Z","dependency_job_id":null,"html_url":"https://github.com/benji6/cycle-audio-graph","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benji6%2Fcycle-audio-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benji6%2Fcycle-audio-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benji6%2Fcycle-audio-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benji6%2Fcycle-audio-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benji6","download_url":"https://codeload.github.com/benji6/cycle-audio-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249736816,"owners_count":21318319,"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":["cyclejs","web-audio","web-audio-api"],"created_at":"2025-03-12T20:20:20.008Z","updated_at":"2025-04-19T16:20:21.642Z","avatar_url":"https://github.com/benji6.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":["Drivers"],"readme":"# cycle-audio-graph\n\n[![npm version](https://badge.fury.io/js/cycle-audio-graph.svg)](https://badge.fury.io/js/cycle-audio-graph)\n[![Build Status](https://travis-ci.org/benji6/cycle-audio-graph.svg)](https://travis-ci.org/benji6/cycle-audio-graph)\n\nAudio graph driver for [Cycle.js](https://github.com/cyclejs) based on [virtual-audio-graph](https://github.com/benji6/virtual-audio-graph).\n\nCheck out [Awesome Cycle.js](https://github.com/vic/awesome-cyclejs) for more Cycle.js resources.\n\n## Installation\n\n```bash\nnpm i -S cycle-audio-graph\n```\n\n## Usage\n\n### makeAudioGraphDriver\n\nThe default export of `cycle-audio-graph` is `makeAudioGraphDriver` which takes an optional configuration object with two optional key-value pairs:\n\n```javascript\nimport makeAudioGraphDriver from 'cycle-audio-graph'\n\nconst audioContext = new AudioContext()\n\n// if no configuration object is provided the defaults\n// detailed below will be used\nmakeAudioGraphDriver({\n  // if audioContext is not provided then cycle-audio-graph\n  // will attempt to construct its own instance\n  audioContext,\n  // output could be any valid AudioNode destination.\n  // If not provided then cycle-audio-graph will use\n  // the destination of its audioContext instance\n  output: audioContext.destination,\n})\n\n```\n\n### Very Basic Example\n\n```javascript\nimport {run} from '@cycle/core'\nimport makeAudioGraphDriver from 'cycle-audio-graph'\n\nconst audioContext = new AudioContext()\n\nconst main = responses =\u003e {\n  // ... example$ could be some sort of user input\n  graph$ = example$.map(_ =\u003e {\n    // ...\n    const {currentTime} = audioContext\n    return {\n      0: ['gain', 'output', {gain: 0.2}],\n      1: ['oscillator', 0, {\n        type: 'square',\n        frequency: 440,\n        startTime: currentTime + 1,\n        stopTime: currentTime + 2,\n      }],\n    }\n  })\n  return {\n    audioGraph: graph$,\n    // ... etc.\n  }\n}\n\nconst drivers = {\n  audioGraph: makeAudioGraphDriver({\n    audioContext,\n    output: audioContext.destination,\n  }),\n  // ... etc.\n}\n\nrun(main, drivers)\n```\n\n### virtual-audio-graph\n\nFor more info on the `graph` objects in the `graph$` check out the documentation for [virtual-audio-graph](https://github.com/benji6/virtual-audio-graph).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenji6%2Fcycle-audio-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenji6%2Fcycle-audio-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenji6%2Fcycle-audio-graph/lists"}