{"id":17685587,"url":"https://github.com/cmpadden/chords.ts","last_synced_at":"2026-03-08T14:32:47.695Z","repository":{"id":44886240,"uuid":"448122973","full_name":"cmpadden/chords.ts","owner":"cmpadden","description":"Musical Chord Identification","archived":false,"fork":false,"pushed_at":"2022-01-20T13:37:19.000Z","size":156,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T14:06:27.141Z","etag":null,"topics":[],"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/cmpadden.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":"2022-01-14T22:22:22.000Z","updated_at":"2024-10-27T05:18:44.000Z","dependencies_parsed_at":"2022-09-16T14:02:27.548Z","dependency_job_id":null,"html_url":"https://github.com/cmpadden/chords.ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fchords.ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fchords.ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fchords.ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmpadden%2Fchords.ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmpadden","download_url":"https://codeload.github.com/cmpadden/chords.ts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249312038,"owners_count":21249316,"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":"2024-10-24T10:28:21.238Z","updated_at":"2026-03-08T14:32:47.641Z","avatar_url":"https://github.com/cmpadden.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![chords ts](https://user-images.githubusercontent.com/5807118/149641313-4e6abbb0-b49c-4645-8d50-67f7ced3b92c.png)\n\n![License](https://img.shields.io/npm/l/chords.ts)\n[![Test](https://github.com/cmpadden/chords.ts/workflows/Test/badge.svg)](https://github.com/cmpadden/chords.ts/actions)\n[![npm](https://img.shields.io/npm/v/chords.ts)](https://www.npmjs.com/package/chords.ts)\n\n_This software is in the alpha stage of development and is subject to change!_\n\n\u003c/div\u003e\n\n## Goal\n\nThis library provides a way to identify chord names, and the associated root\nnote, given a sequence of MIDI notes or note intervals. The current\nimplementation can identify all 2- and 3-note permutations along with some\npopular chords.\n\nIf you have a MIDI keyboard attached to your computer, you can interact with a\ndemo of this library at https://cmpadden.github.io/playground/chords\n\n## Usage\n\n```ts\nimport { identify } from \"chords.ts\";\n\n// Identify a sequence of MIDI notes\nidentify([48, 52, 55]).name;\n// =\u003e 'C Major'\n\n// Identify a sequence note letters\nidentify([\"E\", \"F# / Gb\", \"A\"]).name;\n// =\u003e 'F# / Gb Minor 7'\n```\n\n## How It Works\n\nNote intervals are determined relative to the lowest note being played. For\nexample, the notes `E, G#, and B` have the note interval `0, 4, 7`. This\ninterval is used to find the associated chord name in a lookup table. In this\ncase, the interval maps to a Major chord, with a root note at 0, identified as\nthe chord _E Major_. To reduce the number of possible note-permutations,\nduplicates are removed in other octaves: `E, G#, B, E` is identical to `E, G#,\nB` and is also identified as an _E Major_ chord.\n\nThe repeating pattern of note intervals allows us to drastically reduce the\nnumber of possible note permutations. If it weren't for this pattern, there\nwould be 220 possible permutations of 3-note chords within a 12 note scale: for\n12 elements (`n=12`), take 3 (`k=3`), using the equation `n! / k!(n - k)!`.\n\n## Improvements\n\n- Instead of saying a chord is `G# / Ab` it would be better to differentiate\n  between the two. See [this link](https://music.stackexchange.com/a/52209) on\n  StackExchange for more context.\n\n## Contributions\n\nContributions \u0026 collaboration are very much welcome. This is meant to be a fun\nside-project that stemmed from an interest in how the chord-identifier works in\nLogic Pro. This initial prototype is likely a naive solution, and\nrecommendations for alternative approaches are most definitely welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpadden%2Fchords.ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmpadden%2Fchords.ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmpadden%2Fchords.ts/lists"}