{"id":16125676,"url":"https://github.com/dy/gl-spectrum","last_synced_at":"2025-08-10T13:12:03.247Z","repository":{"id":66081325,"uuid":"58590180","full_name":"dy/gl-spectrum","owner":"dy","description":":chart_with_downwards_trend: Spectrum visualizer","archived":false,"fork":false,"pushed_at":"2023-03-01T15:15:51.000Z","size":38134,"stargazers_count":99,"open_issues_count":12,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-25T09:16:44.311Z","etag":null,"topics":["audio","spectrum"],"latest_commit_sha":null,"homepage":"https://dy.github.io/gl-spectrum","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/dy.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,"governance":null}},"created_at":"2016-05-11T23:30:12.000Z","updated_at":"2025-05-17T07:29:39.000Z","dependencies_parsed_at":"2023-09-24T06:31:29.472Z","dependency_job_id":null,"html_url":"https://github.com/dy/gl-spectrum","commit_stats":{"total_commits":150,"total_committers":1,"mean_commits":150.0,"dds":0.0,"last_synced_commit":"342033ae177afc8b0847c97587fbb468ae1faeac"},"previous_names":["dfcreative/gl-spectrum","audio-lab/gl-spectrum","dy/gl-spectrum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dy/gl-spectrum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fgl-spectrum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fgl-spectrum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fgl-spectrum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fgl-spectrum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/gl-spectrum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fgl-spectrum/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269728978,"owners_count":24465743,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","spectrum"],"created_at":"2024-10-09T21:30:36.320Z","updated_at":"2025-08-10T13:12:03.225Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-spectrum [![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)\n\nSpectrum rendering component with webgl or context2d.\n\n[![Spectrum](https://raw.githubusercontent.com/dy/gl-spectrum/gh-pages/preview.png \"Spectrum\")](http://dy.github.io/gl-spectrum/)\n\n\n## Usage\n\n[![npm install gl-spectrum](https://nodei.co/npm/gl-spectrum.png?mini=true)](https://npmjs.org/package/gl-spectrum/)\n\n```js\nvar Spectrum = require('gl-spectrum');\n\nvar spectrum = new Spectrum({\n\tcontainer: document.body,\n\n\t//if undefined, new canvas will be created\n\tcanvas: null,\n\n\t//existing webgl-context and some context options\n\tcontext: null,\n\talpha: false,\n\n\t//enable render on every frame, disable for manual rendering\n\tautostart: true,\n\n\t//visible range\n\tmaxDb: 0,\n\tminDb: -100,\n\tmaxFrequency: 20000,\n\tminFrequency: 20,\n\tsampleRate: 44100,\n\n\t//perceptual loudness weighting, 'a', 'b', 'c', 'd', 'itu' or 'z' (see a-weighting)\n\tweighting: 'itu',\n\n\t//display grid, can be an object with plot-grid settings\n\tgrid: true,\n\n\t//place frequencies logarithmically\n\tlog: true,\n\n\t//smooth series of data\n\tsmoothing: 0.75,\n\n\t//0 - bottom, .5 - symmetrically, 1. - top\n\talign: 0,\n\n\t//peak highlight balance\n\tbalance: .5,\n\n\t//display max value trail\n\ttrail: true,\n\n\t//style of rendering: line, bar or fill\n\ttype: 'line',\n\n\t//width of the bar, applicable only in bar mode\n\tbarWidth: 2,\n\n\t//colormap for the levels of magnitude. Can be a single color for flat fill.\n\tpalette: ['black', 'white'],\n\n\t//by default transparent, to draw waveform\n\tbackground: null,\n\n\t//pan and zoom to show detailed view\n\tinteractions: false\n});\n\n//pass values in decibels (-100...0 range)\nspectrum.set(magnitudes);\n\n//update style/options\nspectrum.update(options);\n\n//hook up every data set\nspectrum.on('data', (magnitudes, trail) =\u003e {});\n\n//for manual mode of rendering you may want to call this whenever you feel right\nspectrum.render();\nspectrum.draw();\n```\n\n\n## Related\n\n* [gl-waveform](https://github.com/dy/gl-waveform)\n* [gl-spectrogram](https://github.com/dy/gl-spectrogram)\n* [a-weighting](https://github.com/audio-lab/a-weighting) — perception loudness weighting for audio.\n* [colormap](https://github.com/bpostlethwaite/colormap) — list of js color maps.\n* [cli-visualizer](https://github.com/dpayne/cli-visualizer) — C++ spectrum visualizer.\n* [spectrum](https://github.com/mattdesl/spectrum) by mattdesl\n* [audioMotion](https://github.com/hvianna/audioMotion.js/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fgl-spectrum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fgl-spectrum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fgl-spectrum/lists"}