{"id":21331430,"url":"https://github.com/eibens/pitch","last_synced_at":"2026-05-20T19:33:38.975Z","repository":{"id":57675534,"uuid":"384770367","full_name":"eibens/pitch","owner":"eibens","description":"Tools for working with musical pitch in TypeScript for Deno.","archived":false,"fork":false,"pushed_at":"2021-08-07T00:16:04.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-05T05:17:18.156Z","etag":null,"topics":["deno","diatonic","frequency","library","midi","music","pitch","tuning","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/eibens.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}},"created_at":"2021-07-10T18:59:59.000Z","updated_at":"2021-12-10T15:43:12.000Z","dependencies_parsed_at":"2022-09-26T20:41:34.367Z","dependency_job_id":null,"html_url":"https://github.com/eibens/pitch","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fpitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fpitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fpitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eibens%2Fpitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eibens","download_url":"https://codeload.github.com/eibens/pitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809848,"owners_count":20351407,"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":["deno","diatonic","frequency","library","midi","music","pitch","tuning","typescript"],"created_at":"2024-11-21T22:33:05.886Z","updated_at":"2026-05-20T19:33:38.930Z","avatar_url":"https://github.com/eibens.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pitch\n\n[pitch] is a collection of tools for working with musical pitch. It is\nimplemented in TypeScript for [Deno].\n\n[![License][license-shield]](LICENSE) [![Deno doc][deno-doc-shield]][deno-doc]\n[![Deno module][deno-land-shield]][deno-land]\n[![Github tag][github-shield]][github] [![Build][build-shield]][build]\n[![Code coverage][coverage-shield]][coverage]\n\n# [cent.ts](cent.ts)\n\nA [Cent] is a musical unit that equals 1/1200th of an octave.\n\n# [centitone.ts](centitone.ts)\n\nA [centitone] is a musical unit that equals 1/600th of an octave, which is equal\nto 2 [cent].\n\n# [diatonic.ts](diatonic.ts)\n\nA [diatonic scale] consists of seven of the twelve tones of the chromatic scale.\n\n# [midi.ts](midi.ts)\n\nThe MIDI standard associates numbers with the notes of the chromatic scale, for\nexample `69` for the pitch `A4`.\n\n# [mts.ts](mts.ts)\n\nThe [MIDI Tuning Standard] (MTS) defines how MIDI numbers get converted to\nabsolute frequencies. For example, A4 at [440 hz] corresponds to MIDI number 69.\n\n# [pitch.ts](pitch.ts)\n\nThe `Pitch` type defines an absolute pitch with a `Letter`, `Accidental`, and\noctave `number`. The `Chroma` type defines a pitch without an octave and models\nthe concept of a [pitch class].\n\n# [spn.ts](spn.ts)\n\nIn [Scientific Pitch Notation] (SPN) a musical pitch is specified by combining a\nmusical note name (with accidental if needed) and a number identifying the\npitch's octave. For example, `A4`, `C#4`, and `Eb2` are valid pitches in SPN.\nSuch strings can be parsed with the `parse` function.\n\n```ts\nimport { parse } from \"https://deno.land/x/pitch/spn.ts\";\n\nconst { letter, accidental, octave } = parse(\"C#4\");\nconsole.assert(letter === \"C\");\nconsole.assert(accidental === \"#\");\nconsole.assert(octave === 4);\n```\n\nGiven a `Pitch` object, the `stringify` function generates an SPN string.\n\n```ts\nimport { stringify } from \"https://deno.land/x/pitch/spn.ts\";\n\nconst spn = stringify({\n  letter: \"C\",\n  accidental: \"#\",\n  octave: 4,\n});\n\nconsole.assert(spn === \"C#4\");\n```\n\n[pitch]: #\n[Deno]: https://deno.land\n[cent]: https://en.wikipedia.org/wiki/Cent_(music)\n[centitone]: https://en.wikipedia.org/wiki/Cent_(music)#Centitone\n[diatonic scale]: https://en.wikipedia.org/wiki/Diatonic_scale\n[MIDI tuning standard]: https://en.wikipedia.org/wiki/MIDI_tuning_standard\n[440 hz]: https://en.wikipedia.org/wiki/A440_(pitch_standard)\n[scientific pitch notation]: https://en.wikipedia.org/wiki/Scientific_pitch_notation\n[pitch class]: https://en.wikipedia.org/wiki/Pitch_class\n\n\u003c!-- badges --\u003e\n\n[github]: https://github.com/eibens/pitch\n[github-shield]: https://img.shields.io/github/v/tag/eibens/pitch?label\u0026logo=github\n[coverage-shield]: https://img.shields.io/codecov/c/github/eibens/pitch?logo=codecov\u0026label\n[license-shield]: https://img.shields.io/github/license/eibens/pitch?color=informational\n[coverage]: https://codecov.io/gh/eibens/pitch\n[build]: https://github.com/eibens/pitch/actions/workflows/ci.yml\n[build-shield]: https://img.shields.io/github/workflow/status/eibens/pitch/ci?logo=github\u0026label\n[deno-doc]: https://doc.deno.land/https/deno.land/x/pitch/mod.ts\n[deno-doc-shield]: https://img.shields.io/badge/doc-informational?logo=deno\n[deno-land]: https://deno.land/x/pitch\n[deno-land-shield]: https://img.shields.io/badge/x/pitch-informational?logo=deno\u0026label\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feibens%2Fpitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feibens%2Fpitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feibens%2Fpitch/lists"}