{"id":18616694,"url":"https://github.com/sile/ffmml","last_synced_at":"2025-04-11T01:32:07.084Z","repository":{"id":65106975,"uuid":"578396225","full_name":"sile/ffmml","owner":"sile","description":"Famicon Flavored Misic Macro Language","archived":false,"fork":false,"pushed_at":"2024-08-27T04:28:26.000Z","size":532,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T07:12:46.354Z","etag":null,"topics":["chiptune","famicon","mml","music-macro-language","nes","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sile.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-12-15T00:33:03.000Z","updated_at":"2024-08-27T04:28:30.000Z","dependencies_parsed_at":"2023-12-27T01:27:30.444Z","dependency_job_id":"2c29d3b7-1c7e-417d-958c-96955a2d0a24","html_url":"https://github.com/sile/ffmml","commit_stats":{"total_commits":139,"total_committers":1,"mean_commits":139.0,"dds":0.0,"last_synced_commit":"92c46f8abfa6b0b5b4f45c766fa33f0ff2fa6940"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fffmml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fffmml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fffmml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sile%2Fffmml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sile","download_url":"https://codeload.github.com/sile/ffmml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980808,"owners_count":21027803,"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":["chiptune","famicon","mml","music-macro-language","nes","rust"],"created_at":"2024-11-07T03:37:39.292Z","updated_at":"2025-04-11T01:32:06.406Z","avatar_url":"https://github.com/sile.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"ffmml\n=====\n\n[![ffmml](https://img.shields.io/crates/v/ffmml.svg)](https://crates.io/crates/ffmml)\n[![Documentation](https://docs.rs/ffmml/badge.svg)](https://docs.rs/ffmml)\n[![Actions Status](https://github.com/sile/ffmml/workflows/CI/badge.svg)](https://github.com/sile/ffmml/actions)\n![License](https://img.shields.io/crates/l/ffmml)\n\nParser and player of **F**amicon **F**lavored **M**usic **M**acro **L**anguage (FFMML).\n\nFamicon is also known as NES (Nintendo Entertainment System).\n\n🎵 [Web Player][demo]\n\n📝 [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=sile.ffmml)\n\nThe language specification of FFMML is based on [MCK].\nBut there are (known) differences between FFMML and MCK as follows:\n\n- FFMML doesn't support the following features:\n  - `#INCLUDE` directive\n  - `#OCTAVE-REV` directive\n  - `@n` command (direct frequency select)\n  - `n` command (direct note select)\n  - `y` command (direct memory entry)\n  - DPCM channel\n- FFMML features `#CHANNEL \u003cCHANNEL_NAME\u003e \u003cOSCILLATOR\u003e` directive that defines custom channels:\n  - `\u003cCHANNEL_NAME\u003e`: `A..=Z`\n  - `\u003cOSCILLATOR\u003e`: `1` (pulse wave), `2` (triangle wave), or `3` (noise)\n\n[MCK]: https://www.nesdev.org/mckc-e.txt\n\nExamples\n--------\n\nThe following example parses an MML script and generates audio data:\n```rust\nlet mml = r#\"; From https://www.nesdev.org/mck_guide_v1.0.txt\n#TITLE My First NES Chip\n#COMPOSER Nullsleep\n#PROGRAMER 2003 Jeremiah Johnson\n\n@v0 = { 10 9 8 7 6 5 4 3 2 }\n@v1 = { 15 15 14 14 13 13 12 12 11 11 10 10 9 9 8 8 7 7 6 6 }\n@v2 = { 15 12 10 8 6 3 2 1 0 }\n@v3 = { 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 }\n\nABCD t150\n\nA l8 o4 @01 @v0\nA [c d e f @v1 g4 @v0 a16 b16 \u003ec c d e f @v1 g4 @v0 a16 b16 \u003ec\u003c\u003c]2\n\nC l4 o3 q6\nC [c e g8 g8 a16 b16 \u003ec8 c e g8 g8 a16 b16 \u003ec8\u003c\u003c]4\n\nD l4 @v2 @0\nD [@v2 b @v3 e @v2 b @v3 e @v2 b @v3 e @v2 b @v3 e8 @v2 b8]4\"#;\n\nlet music = mml.parse::\u003cffmml::Music\u003e().unwrap_or_else(|e| panic!(\"{e}\"));\nlet mut player = music.play(48000);\nlet audio_data = (\u0026mut player).collect::\u003cVec\u003c_\u003e\u003e();\nplayer.take_last_error().map(|e| panic!(\"{e}\"));\n```\n\nTo play the music defined by the above MML script, run the following commands:\n```console\n$ cargo install ffmmlc\n$ cat examples/music01.mml | ffmmlc \u003e music01.wav\n$ play music01.wav\n```\n\nReferences\n----------\n\n### About MML\n\n- [MCK reference](https://www.nesdev.org/mckc-e.txt)\n- [MCK guide](https://www.nesdev.org/mck_guide_v1.0.txt)\n- [MCK reference (Japanese)](https://wikiwiki.jp/mck/MML%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9)\n- [What's MML? (Japanese)](https://geolog.mydns.jp/www.geocities.co.jp/Playtown-Denei/9628/whatsmml.html)\n\n### Abount Famicon sound\n\n- [NES APU (audio processing unit)](https://www.nesdev.org/wiki/APU)\n- [FC sound source (Japanese)](https://dic.nicovideo.jp/t/a/fc%E9%9F%B3%E6%BA%90)\n- [MCK Wiki (Japanese)](https://wikiwiki.jp/mck/%E3%83%95%E3%82%A1%E3%83%9F%E3%82%B3%E3%83%B3%E9%9F%B3%E6%BA%90%E8%A9%B3%E7%B4%B0)\n\n[demo]: https://sile.github.io/ffmml/?mml=%3B+From+https%3A%2F%2Fwww.nesdev.org%2Fmck_guide_v1.0.txt%0A%23TITLE+My+First+NES+Chip%0A%23COMPOSER+Nullsleep%0A%23PROGRAMER+2003+Jeremiah+Johnson%0A%0A%40v0+%3D+%7B+10+9+8+7+6+5+4+3+2+%7D%0A%40v1+%3D+%7B+15+15+14+14+13+13+12+12+11+11+10+10+9+9+8+8+7+7+6+6+%7D%0A%40v2+%3D+%7B+15+12+10+8+6+3+2+1+0+%7D%0A%40v3+%3D+%7B+15+14+13+12+11+10+9+8+7+6+5+4+3+2+1+0+%7D%0A%0AABCD+t150%0A%0AA+l8+o4+%4001+%40v0%0AA+%5Bc+d+e+f+%40v1+g4+%40v0+a16+b16+%3Ec+c+d+e+f+%40v1+g4+%40v0+a16+b16+%3Ec%3C%3C%5D2%0A%0AC+l4+o3+q6%0AC+%5Bc+e+g8+g8+a16+b16+%3Ec8+c+e+g8+g8+a16+b16+%3Ec8%3C%3C%5D4%0A%0AD+l4+%40v2+%400%0AD+%5B%40v2+b+%40v3+e+%40v2+b+%40v3+e+%40v2+b+%40v3+e+%40v2+b+%40v3+e8+%40v2+b8%5D4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fffmml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsile%2Fffmml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsile%2Fffmml/lists"}