{"id":33933021,"url":"https://github.com/acknak/ghakuf","last_synced_at":"2026-04-06T06:04:20.186Z","repository":{"id":62439445,"uuid":"96551875","full_name":"acknak/ghakuf","owner":"acknak","description":"A Rust library for parsing/building SMF (Standard MIDI File).","archived":false,"fork":false,"pushed_at":"2021-01-09T06:03:32.000Z","size":93,"stargazers_count":37,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-17T01:19:02.353Z","etag":null,"topics":["parsing","rust","rust-library","smf"],"latest_commit_sha":null,"homepage":null,"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/acknak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-07T15:28:41.000Z","updated_at":"2026-01-30T20:12:07.000Z","dependencies_parsed_at":"2022-11-01T22:16:00.430Z","dependency_job_id":null,"html_url":"https://github.com/acknak/ghakuf","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/acknak/ghakuf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acknak%2Fghakuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acknak%2Fghakuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acknak%2Fghakuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acknak%2Fghakuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acknak","download_url":"https://codeload.github.com/acknak/ghakuf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acknak%2Fghakuf/sbom","scorecard":{"id":163028,"data":{"date":"2025-08-11","repo":{"name":"github.com/acknak/ghakuf","commit":"343abfd24961ec2bc3d5fbace3c016b5cce60ffb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":1,"reason":"Found 4/24 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T14:04:58.062Z","repository_id":62439445,"created_at":"2025-08-16T14:04:58.062Z","updated_at":"2025-08-16T14:04:58.062Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["parsing","rust","rust-library","smf"],"created_at":"2025-12-12T13:01:34.189Z","updated_at":"2026-04-06T06:04:20.181Z","avatar_url":"https://github.com/acknak.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"ghakuf\n======\n\nA Rust library for parsing/building SMF (Standard MIDI File).\n\n[![Build Status](https://travis-ci.org/acknak/ghakuf.svg?branch=master)](https://travis-ci.org/acknak/ghakuf)\n[![Crates.io](https://img.shields.io/crates/v/ghakuf.svg)](https://crates.io/crates/ghakuf)\n\n## Examples\n\n`ghakuf` has parse module and build module separatory.\n\n### Perser\n\n`ghakuf`'s parser is made by Event-driven online algorithm. You must prepare original handler implementing Handler trait to catch SMF messages. Any number of handlers you can add for parser if you want.\n\n```rust\nuse ghakuf::messages::*;\nuse ghakuf::reader::*;\nuse std::path;\n\nlet path = path::Path::new(\"test.mid\");\nlet mut handler = HogeHandler{};\nlet mut reader = Reader::new(\n    \u0026mut handler,\n    \u0026path,\n).unwrap();\nlet _ = reader.read();\n\nstruct HogeHandler {}\nimpl Handler for HogeHandler {\n    fn header(\u0026mut self, format: u16, track: u16, time_base: u16) {\n      // Something\n    }\n    fn meta_event(\u0026mut self, delta_time: u32, event: \u0026MetaEvent, data: \u0026Vec\u003cu8\u003e) {\n      // you\n    }\n    fn midi_event(\u0026mut self, delta_time: u32, event: \u0026MidiEvent) {\n      // want\n    }\n    fn sys_ex_event(\u0026mut self, delta_time: u32, event: \u0026SysExEvent, data: \u0026Vec\u003cu8\u003e) {\n      // to\n    }\n    fn track_change(\u0026mut self) {\n      // do\n    }\n}\n```\n\n### Builder\n\n`ghakuf` build SMF by Message enums. Message enum consists of MetaEvent, MidiEvent, SysExEvent, and TrackChange. You can use running status if you want. At track change, you should use not only MetaEvent::EndOfTrack message, but also TrackChange message.\n\n```rust\nuse ghakuf::messages::*;\nuse ghakuf::writer::*;\nuse std::path;\n\nlet tempo: u32 = 60 * 1000000 / 102; //bpm:102\nlet write_messages: Vec\u003cMessage\u003e = vec![\n    Message::MetaEvent {\n        delta_time: 0,\n        event: MetaEvent::SetTempo,\n        data: [(tempo \u003e\u003e 16) as u8, (tempo \u003e\u003e 8) as u8, tempo as u8].to_vec(),\n    },\n    Message::MetaEvent {\n        delta_time: 0,\n        event: MetaEvent::EndOfTrack,\n        data: Vec::new(),\n    },\n    Message::TrackChange,\n    Message::MidiEvent {\n        delta_time: 0,\n        event: MidiEvent::NoteOn {\n            ch: 0,\n            note: 0x3c,\n            velocity: 0x7f,\n        },\n    },\n    Message::MidiEvent {\n        delta_time: 192,\n        event: MidiEvent::NoteOn {\n            ch: 0,\n            note: 0x40,\n            velocity: 0,\n        },\n    },\n    Message::MetaEvent {\n        delta_time: 0,\n        event: MetaEvent::EndOfTrack,\n        data: Vec::new(),\n    }\n];\nlet path = path::Path::new(\"examples/example.mid\");\nlet mut writer = Writer::new();\nwriter.running_status(true);\nfor message in \u0026write_messages {\n    writer.push(\u0026message);\n}\nlet _ = writer.write(\u0026path);\n```\n\n## Supported SMF Event\n\nYou can use three type events. In Message enum, these events have delta time and data.\n\n### Meta Event\n\n* SequenceNumber\n* TextEvent\n* CopyrightNotice\n* SequenceOrTrackName\n* InstrumentName\n* Lyric\n* Marker\n* CuePoint\n* MIDIChannelPrefix\n* EndOfTrack\n* SetTempo\n* SMTPEOffset\n* TimeSignature\n* KeySignature\n* SequencerSpecificMetaEvent\n\n### MIDI Event\n\n* NoteOff { ch: u8, note: u8, velocity: u8 }\n* NoteOn { ch: u8, note: u8, velocity: u8 }\n* PolyphonicKeyPressure { ch: u8, note: u8, velocity: u8 }\n* ControlChange { ch: u8, control: u8, data: u8 }\n* ProgramChange { ch: u8, program: u8 }\n* ChannelPressure { ch: u8, pressure: u8 }\n* PitchBendChange { ch: u8, data: i16 }\n\n### System Exclusive Event\n\n* (F0 event)\n* (F7 event)\n\n## License\n\n`ghakuf` is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.\n\nSee LICENSE-APACHE, and LICENSE-MIT for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facknak%2Fghakuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facknak%2Fghakuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facknak%2Fghakuf/lists"}