{"id":29095774,"url":"https://github.com/implferris/tinytones","last_synced_at":"2025-06-28T11:09:18.108Z","repository":{"id":299637495,"uuid":"1003696403","full_name":"ImplFerris/tinytones","owner":"ImplFerris","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-17T14:27:51.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T14:55:50.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImplFerris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-MIT","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}},"created_at":"2025-06-17T14:27:44.000Z","updated_at":"2025-06-17T14:30:26.000Z","dependencies_parsed_at":"2025-06-17T14:55:52.700Z","dependency_job_id":"922fe3db-04dd-4265-a119-995d96e6acbc","html_url":"https://github.com/ImplFerris/tinytones","commit_stats":null,"previous_names":["implferris/tinytones"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ImplFerris/tinytones","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImplFerris%2Ftinytones","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImplFerris%2Ftinytones/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImplFerris%2Ftinytones/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImplFerris%2Ftinytones/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImplFerris","download_url":"https://codeload.github.com/ImplFerris/tinytones/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImplFerris%2Ftinytones/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262419808,"owners_count":23308101,"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":"2025-06-28T11:09:17.494Z","updated_at":"2025-06-28T11:09:18.100Z","avatar_url":"https://github.com/ImplFerris.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tinytones\n\n**tinytones** is a `#![no_std]` Rust crate for defining and playing musical tones and melodies in embedded systems. It provides:\n\n- Enum-based musical pitches from C0 to B8\n- Standard and dotted note durations\n- Frequency access as `u32` or `f64`\n- Iterator for (pitch, duration) tone playback\n\n## Predefined tones in the crate\n\nThe crate includes a few predefined melodies for convenience:\n\n```rust\nuse tinytones::{Tone, songs::happy_birthday};\n\n\nlet song = Tone::new(happy_birthday::TEMPO, happy_birthday::MELODY);\nfor (pitch, duration_ms) in song.iter() {\n    // Send `pitch.freq_u32()` to a PWM\n    // Wait for `duration_ms` using a delay\n}\n```\n\n\n## Definiting your own Tone\nYou can define your own melody using the provided `Pitch` and `Duration` enums:\n\n```rust\nuse tinytones::{\n    note::{Duration::*, Pitch::*},\n    Tone, Melody,\n};\n\nlet melody = Melody(\u0026[\n    (C4, Quarter),\n    (D4, Quarter),\n    (E4, Half),\n]);\n\nlet tempo = 120;\n\nlet tone = Tone::new(tempo, melody);\n\nfor (pitch, duration_ms) in tone.iter() {\n    // Send `pitch.freq_u32()` to a PWM\n    // Wait for `duration_ms` using a delay\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimplferris%2Ftinytones","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimplferris%2Ftinytones","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimplferris%2Ftinytones/lists"}