{"id":22316858,"url":"https://github.com/somecho/metrome","last_synced_at":"2025-07-29T12:30:37.518Z","repository":{"id":219788595,"uuid":"749483549","full_name":"somecho/metrome","owner":"somecho","description":"Generate click tracks from text based rhythm scores","archived":false,"fork":false,"pushed_at":"2024-03-02T08:44:47.000Z","size":506,"stargazers_count":2,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T16:46:30.426Z","etag":null,"topics":["audio","cli","clicktrack","metronome","music","wav"],"latest_commit_sha":null,"homepage":"https://docs.rs/metrome/latest/metrome/index.html","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/somecho.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":"2024-01-28T18:00:30.000Z","updated_at":"2024-05-26T09:51:11.000Z","dependencies_parsed_at":"2024-01-29T20:43:11.598Z","dependency_job_id":null,"html_url":"https://github.com/somecho/metrome","commit_stats":null,"previous_names":["somecho/metrum"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/somecho/metrome","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somecho%2Fmetrome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somecho%2Fmetrome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somecho%2Fmetrome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somecho%2Fmetrome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somecho","download_url":"https://codeload.github.com/somecho/metrome/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somecho%2Fmetrome/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135316,"owners_count":23881796,"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":["audio","cli","clicktrack","metronome","music","wav"],"created_at":"2024-12-03T23:08:07.908Z","updated_at":"2025-07-29T12:30:36.652Z","avatar_url":"https://github.com/somecho.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metrome\n\nMetrome is a click track generator. It uses simple text-based rhythm notation to\ngenerate any kind of rhythmic click track. Metrome currently can be used as a\nCLI or as a Rust crate. A web interface is in the plans!\n\n### Why would you use Metrome when you can use a metronome? \n\nYour rhythmic needs may differ. For most musicians, a simple device that beats\nconstant pulses may be enough. For a small portion of musicians, a\n[polyrhythmic metronome](https://github.com/somecho/polymetro) may serve their\nniche rhythmic needs. However, if you find yourself facing pieces with constant\ntempo, meter and pulse changes, you might want to have dedicated click track\nfor practicing the piece. Heck, even pieces with the occasional odd time\nsignature will mess up practicing with a normal metronome.\n\n## Usage\n### CLI \n**System requirements**: you will need Rust to run the Metrome CLI. Follow [this\npage](https://www.rust-lang.org/tools/install) to install Rust.\n\n#### Quickstart\nFor a quick start, you can clone this repo and render the examples.\n\n```\ngit clone https://github.com/somecho/metrome\ncd metrome\n# Linux \u0026 Mac\n./render_examples.sh\n# Windows\n./render_examples.ps1\n```\n\nAfter running this, the root of the metrome directory should now contain many\nWAV files which you can run directly in the command line with cvlc if you have\nVLC player installed. Otherwise, just play the WAV files in your player of\nchoice.\n\n#### Providing your own score\nThe Metrome score is just a textfile with no extensions. To provide your own\nscore to Metrome, simple use the `-p` flag like such: `metrome -p my_score` or\n`cargo run -- -p my_score` in the metrome project directory. Use the\n`-o/--output` flag to specify a custom output path. For more\ninformation on how to write a rhythm score, read the following section.\n\n#### Programmatic Usage Example\n```rust\nuse metrome::{scanner, score::Score};\n\nfn main() {\n    let file = std::fs::read_to_string(\"myscore\").unwrap();\n    let tokens = scanner::scan(file).unwrap();\n    let score = Score::new(tokens).unwrap();\n    score.write_click_track(\"myscore.wav\");\n}\n```\n\n## The Metrome Score\n\nThe score metrome uses to create click track is just a simple text file. Here's\na short example of what it looks like.\n\n\n**Example:**\n\n```\n| q. e q. e    | e e e e h \n| q. e q. e    | e e e e h \n| q q. e e e   | e e q. e e e\n| e e q. e e e | e e q. e e e | \n```\n\n### Bars\n\nAs you can see, it follows traditional notation in that notes are grouped in\nbars (as denoted by the barlines `|` ). However, unlike traditional notation,\nyou do not need to provide a time signature. Bars serve the purpose of\ndifferentiating strong and weak beats, with the first beat of every bar strong\nand the rest weak.\n\n```\n| q  q  q |\n  ^  ^  ^\n  |  |  |\n  |  |  Weak\n  |  Weak\n  Strong\n```\n\n\u003e ⚠ every score **must** begin and end with a barline!\n\n\u003e Tip: you can organize your score however you like. Line breaks do not make a\n\u003e difference.\n\n### Notes, Durations and Ratios\n\nNotes can be represented using these letters:\n- `w` - whole note\n- `h` - half note\n- `q` - quarter note\n- `e` - eighth note\n- `s` - sixteenth note\n- `t` - thirtysecond note\n\nAlternatively, you can also write notes using ratios:\n\n```\nthese two bars are the same: | 1/4 1/4 1/4 1/4 | q q q q |\nratios are great for triples: | 1/6 1/6 1/6 1/6 1/6 1/6 | \n```\n\nYou can use any combination of this. For example, `| q 1/6 1/6 1/6 h |` is a\nvalid bar.\n\n### Dotted Notes\n\nAny note, duration or ratio can be extended using dots `.`, just like in\ntraditional notation. For example, `q.` is as long as `3/8` and `q..` is as\nlong as `7/16`.\n\n### Tempo\nTempo can be specified like this `q = 140` (read: 140 quarter notes per\nminute). The grammar for this is `\u003cnote\u003e = \u003cnumber\u003e`, where `\u003cnote\u003e` is either\na duration represented as a letter or a ratio.\n\nThe tempo can be specified anywhere within a score:\n```\nAt the beginning like a normal score\nq = 140\n| q q q q |\n\nAfter a bar \n| q q q q | h = 90 h h |\n\nIn the middle of a bar like a psycho\n| q q q=150 1/6 1/6 1/6 |\n```\n\n\u003e Note: When no tempo is specified, the Metrome defaults to `q = 120` or 120\n\u003e quarter notes per minute. Pretty sane if you ask me.\n\n### Relative Tempo Changes\nIn many music, tempo changes can be done relatively. For example, ♩=♩. ,\nmeaning dotted quarter notes are now as long as quarter notes. You will\ncommonly find this in music that switched from 4/4 (simple time) to 6/8\n(compound time), where the pulse division turns from two to three stays the\nsame length.\n\nIn Metrome, the equivalent is `q=q.`. Simple, clean. You can do all sorts of\nwild things. You can also do this `1/6=q`, where the quarter notes are now as\nfast as the triplet quarter notes (essentially the same thing, but semantically\nand musically different.\n\n## Examples\n\nCheck out the [examples](./examples/valid) for reference.\n\n## Roadmap \n- [ ] take `stdin` input\n- [ ] floating point tempo \n- [x] `-o` flag for specifying custom output path\n\n---\n\n© 2024 Somē Cho\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomecho%2Fmetrome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomecho%2Fmetrome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomecho%2Fmetrome/lists"}