{"id":31053097,"url":"https://github.com/lunar-rf/emu8910","last_synced_at":"2025-09-15T01:52:04.979Z","repository":{"id":154754803,"uuid":"342252346","full_name":"lunar-rf/emu8910","owner":"lunar-rf","description":"Tiny General Instrument AY-3-8910 emulator core.","archived":false,"fork":false,"pushed_at":"2025-09-07T23:17:35.000Z","size":299,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T01:13:54.041Z","etag":null,"topics":["ay-3-8910","ay8910","chiptune","emulator","psg","ym2149","zx-spectrum"],"latest_commit_sha":null,"homepage":"https://files.lunar.sh/apps/AYSir","language":"TypeScript","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/lunar-rf.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-25T13:24:07.000Z","updated_at":"2025-09-07T23:17:38.000Z","dependencies_parsed_at":"2024-12-12T16:24:40.520Z","dependency_job_id":"a39407c4-b720-497a-ad62-ce9131f3055b","html_url":"https://github.com/lunar-rf/emu8910","commit_stats":null,"previous_names":["lunarbin/emu8910","lunarjournal/emu8910","lunar-rf/emu8910"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lunar-rf/emu8910","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunar-rf%2Femu8910","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunar-rf%2Femu8910/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunar-rf%2Femu8910/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunar-rf%2Femu8910/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lunar-rf","download_url":"https://codeload.github.com/lunar-rf/emu8910/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lunar-rf%2Femu8910/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275194021,"owners_count":25421441,"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-09-14T02:00:10.474Z","response_time":75,"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":["ay-3-8910","ay8910","chiptune","emulator","psg","ym2149","zx-spectrum"],"created_at":"2025-09-15T01:52:04.058Z","updated_at":"2025-09-15T01:52:04.959Z","avatar_url":"https://github.com/lunar-rf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emu8910\n\n```\n   ______  _____  _____ ___ ______ \n  / __/  |/  / / / ( _ ) _ \u003c  / _ \\\n / _// /|_/ / /_/ / _  \\_, / / // /\n/___/_/  /_/\\____/\\___/___/_/\\___/ \n                                   \n```\nThis repository contains a single file `Typescript` implementation of General Instrument's [`A-3-8910`](https://en.wikipedia.org/wiki/General_Instrument_AY-3-8910) `PSG` (programmable sound generator) in\nless than `1K` lines and without any magic constants! \n\nThe emulator allows for fine tuning of the DAC look up table though modification of the following variables:\n```\nconst DAC_DECAY = 1.3;\nconst DAC_SHIFT = 40;\n```\n\nIt implements most of the `PSG's` original registers. \u003cbr\u003e\n\nThe offical datasheet for the `PSG` can be found [`here`](http://map.grauw.nl/resources/sound/generalinstrument_ay-3-8910.pdf).\n\n\u003e **Online Player/Emulator by DrSnuggles** \u003cbr\u003e\n\u003e [`player link`](https://files.lunar.sh/apps/AYSir/?engine=lunar) [[`source`](https://github.com/DrSnuggles/AYSir)]\n\nSound output is achieved in the browser through an `AudioContext()` hook. \u003cbr\u003e\nThis `emulator` also adds interrupt support (with variable frequency) for updating the `PSG's` registers.\n\n\u003e Note: `FIR` LPF data is generated procedurally.\n\nCompile with `tsc emu8910.ts`.\n\nTo use simply create a `PSG49` object as follows:\n```\nvar emu8910 = new PSG49(YM_CLOCK_ZX, 50);\n```\nWhich sets the default clock speed (`1.75 MHz`) and interrupt frequency (`50 Hz`). \n\nThis exposes a `PSG` `register` file in the `emu8910.register` object:\n```\nemu8910.register.A_FINE\nemu8910.register.A_COARSE\nemu8910.register.B_FINE\nemu8910.register.B_COARSE\nemu8910.register.C_FINE\nemu8910.register.C_COARSE\nemu8910.register.NOISE_PERIOD\nemu8910.register.MIXER\nemu8910.register.A_VOL\nemu8910.register.B_VOL\nemu8910.register.C_VOL\nemu8910.register.ENV_FINE\nemu8910.register.ENV_COARSE\nemu8910.register.ENV_SHAPE\n```\n\nThe `register` file is then used to control the `PSG` or extract state information.\n\nTo play a `FYM` module:\n```\nsong = new FYMReader(\u003cBUFFER\u003e);\nemu8910.interrupt.routine = \u003cISR_FUNC\u003e\nemu8910.clock.frequency = song.getClockRate()\nemu8910.interrupt.frequency = song.getFrameRate()\n```\n\n\u003e Note: You can download modules from [https://ftp.modland.com/pub/modules/](https://ftp.modland.com/pub/modules/)\n\nThis sets the `ISR` (Interrupt Service Routine) function, `clock` and `interrupt` frequency for a specific module.\n\nTo stop playback:\n```\nemu8910.driver.device.suspend()\nemu8910.interrupt.frequency = 0\n```\nTo resume:\n```\nemu8910.driver.device.resume()\nemu8910.interrupt.frequency = song.getFrameRate()\n```\n\n\u003e Note: You can access the emulator's internal `register` file with `emu8910.register`.\n\nThese registers need to be updated at the frequency of the `ISR`.\n\nFiles:\n\n* `src/emu8910.ts` - `core` emulator implementation.\n* `fym.js` - `FYM` `(Fast YM)` format parser.\n* `parser.js` - `PSG` register parser.\n* `index.html` - `HTML` boilerplate.\n\nTo run demo start web server: `python -m http.server 8000` and navigate to `index.html`.\n\n\u003e Note: Click anywhere on the page to start audio output.\n\n# Signature\n\n```\n+---------------------------------------+\n|     .-.       .-.       .-.           |\n|    /   \\     /   \\     /   \\     +    |\n|         \\   /     \\   /     \\   /     |\n|          \"_\"       \"_\"       \"_\"      |\n|                                       |\n|  _   _   _ _  _   _   ___   ___ _  _  |\n| | | | | | | \\| | /_\\ | _ \\ / __| || | |\n| | |_| |_| | .` |/ _ \\|   /_\\__ \\ __ | |\n| |____\\___/|_|\\_/_/ \\_\\_|_(_)___/_||_| |\n|                                       |\n|                                       |\n| Lunar RF Labs                         |\n| https://lunar.sh                      |\n|                                       |\n| Research Laboratories                 |\n| Copyright (C) 2022-2024               |\n|                                       |\n+---------------------------------------+\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunar-rf%2Femu8910","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flunar-rf%2Femu8910","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flunar-rf%2Femu8910/lists"}