{"id":18250653,"url":"https://github.com/asivery/netmd-tocmanip","last_synced_at":"2025-07-03T17:34:52.190Z","repository":{"id":37645866,"uuid":"505851916","full_name":"asivery/netmd-tocmanip","owner":"asivery","description":"A library that lets you parse and edit Minidiscs' table of contents with ease","archived":false,"fork":false,"pushed_at":"2024-03-14T00:11:30.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-14T15:21:19.988Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asivery.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-06-21T13:19:35.000Z","updated_at":"2023-04-27T17:36:09.000Z","dependencies_parsed_at":"2024-03-14T01:30:20.119Z","dependency_job_id":null,"html_url":"https://github.com/asivery/netmd-tocmanip","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.11111111111111116","last_synced_commit":"8053b3910fb4856bce5b8c603b924590beb38c1e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-tocmanip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-tocmanip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-tocmanip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetmd-tocmanip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asivery","download_url":"https://codeload.github.com/asivery/netmd-tocmanip/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209406,"owners_count":20901770,"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-11-05T09:45:28.650Z","updated_at":"2025-04-04T16:31:36.382Z","avatar_url":"https://github.com/asivery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetMD Tocmanip\n\n## What is it?\nNetMD Tocmanip is a library created to parse and edit the ToC (Table of Contents) sections of Sony's Minidiscs.\nIt is not meant to be used as a standalone program.\nNote that this library can only work on raw bytes - it itself cannot fetch the ToC from a NetMD device. (See [netmd-js](https://github.com/cybercase/netmd-js) for that.)\n\n## Which TOC sectors are currently supported?\n- Sector 0 - Position and address sector. Stores the positions of tracks on the disc\n- Sector 1 - Half-width title sector. Stores ASCII and katakana titles.\n- Sector 2 - Timestamp sector. Stores tracks' date and time of recording and recorder timestamp.\n- Sector 3 - Full-width title sector. Stores kanji, hiragana, full-width katakana and full-width ascii titles. (Not supported yet.)\n\n## How to use it?\nThe two most basic functions for interacting with netmd-tocmanip are `parseTOC()` and `reconstructTOC()`.\n\n### parseTOC()\nBelow is an example of how to use `parseTOC()` to load the table of contents from a minidisc using a supported NetMD device.\n```ts\n// Assuming `netmdInteface` is an instance of netmd-js's NetMDInterface\nconst factoryInterface = await netmdInterface.factory();\nconst sector0 = await readUTOCSector(factoryInterface, 0);\nconst sector1 = await readUTOCSector(factoryInterface, 1);\n\n// As sectors are independent of each other, it's possible to skip a sector when using parseTOC()\nconst sector2 = null; //await readUTOCSector(factoryInterface, 2);\n\nconst toc = parseTOC(sector0, sector1, sector2);\n```\n\n### reconstructTOC()\nBelow is an example of how to use `reconstructTOC()` to recreate the binary representation of the ToC, and write it back to disc. \n```ts\n// Assuming `netmdInterface` is an instance of netmd-js's NetMDInterface and `toc` is an instance of this library's ToC\nconst factoryInterface = await netmdInterface.factory();\nconst sectors = reconstructTOC(toc);\nfor(let sector = 0; sector\u003csectors.length; sector++){\n    if(sector !== null){\n        await writeUTOCSector(factoryInterface, sector, sectors[sector]);\n    }\n}\n// WARNING:\n// The `writeUTOCSector` calls don't force a ToC Edit. If the ToC becomes 'dirty' by, f. ex. changing a track's name\n// the player will first flush its copy of sector 0 from SRAM back to the TOC caching peripheral, overwriting the data written via NetMD.\n// To prevent that from happening, it's necessary to trigger a non-flushing ToC Edit with the help of netmd-exploits.\n// (https://github.com/asivery/netmd-exploits)\n```\n## Contributions\nEvery contribution is welcome, but please stick to the TOC's specification.\nThis library isn't the place to implement custom features used only by new NetMD software.\n\n## Credits\nWriting this library would be much harder without the excellent article about the TOC on minidisc.org: https://www.minidisc.org/md_toc.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetmd-tocmanip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasivery%2Fnetmd-tocmanip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetmd-tocmanip/lists"}