{"id":26221094,"url":"https://github.com/mrfrac/goodchords","last_synced_at":"2025-08-08T04:33:41.651Z","repository":{"id":38290838,"uuid":"159825542","full_name":"mrfrac/goodchords","owner":"mrfrac","description":"Music theory library","archived":false,"fork":false,"pushed_at":"2025-06-09T22:59:42.000Z","size":2133,"stargazers_count":7,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-11T22:19:14.641Z","etag":null,"topics":["chord","interval","music","music-theory","note","pitch","scale","tone"],"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/mrfrac.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-11-30T13:12:40.000Z","updated_at":"2025-03-23T08:14:20.000Z","dependencies_parsed_at":"2025-03-12T15:51:49.245Z","dependency_job_id":"5349020d-a6a3-4a74-8f58-5d39010520b4","html_url":"https://github.com/mrfrac/goodchords","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/mrfrac/goodchords","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrfrac%2Fgoodchords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrfrac%2Fgoodchords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrfrac%2Fgoodchords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrfrac%2Fgoodchords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrfrac","download_url":"https://codeload.github.com/mrfrac/goodchords/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrfrac%2Fgoodchords/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269365466,"owners_count":24405229,"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","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"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":["chord","interval","music","music-theory","note","pitch","scale","tone"],"created_at":"2025-03-12T15:51:46.060Z","updated_at":"2025-08-08T04:33:41.610Z","avatar_url":"https://github.com/mrfrac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goodchords\r\n\r\n[![npm version](https://badge.fury.io/js/goodchords.svg)](https://badge.fury.io/js/goodchords)\r\n![GitHub top language](https://img.shields.io/github/languages/top/mrfrac/goodchords?branch=master)\r\n[![Build status](https://ci.appveyor.com/api/projects/status/i8h691mm5an60471?svg=true)](https://ci.appveyor.com/project/mrfrac/goodchords)\r\n[![Coverage Status](https://coveralls.io/repos/github/mrfrac/goodchords/badge.svg?branch=master)](https://coveralls.io/github/mrfrac/goodchords?branch=master)\r\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\r\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=mrfrac_goodchords\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=mrfrac_goodchords)\r\n\r\n\u003e Music theory library\r\n\r\n**The project is under development.**\r\n\r\n## Usage\r\n\r\n### Install\r\n\r\n```bash\r\nnpm install --save goodchords\r\n```\r\n\r\nor\r\n\r\n```bash\r\nyarn add goodchords\r\n```\r\n\r\n### Import (ES6)\r\n\r\n```js\r\nimport { Scale, Chord, Interval, Note } from \"goodchords\";\r\n```\r\n\r\n### Require (ES5)\r\n\r\n```js\r\nconst { Scale, Chord, Interval, Note } = require(\"goodchords\");\r\n```\r\n\r\n### Browser\r\n\r\nUsage example:\r\n\r\n```html\r\n\u003chtml lang=\"en\"\u003e\r\n  \u003chead\u003e\r\n    \u003ctitle\u003eGoodchords\u003c/title\u003e\r\n    \u003cscript src=\"https://cdn.jsdelivr.net/npm/goodchords@X/dist/goodchords.umd.js\"\u003e\u003c/script\u003e\r\n    \u003cscript\u003e\r\n      alert(window.goodchords.Note.fromString(\"A4\").frequency());\r\n    \u003c/script\u003e\r\n  \u003c/head\u003e\r\n\u003c/html\u003e\r\n```\r\n\r\n\u003e Replace X with correct version\r\n\r\n### API\r\n#### Note\r\n\r\n```js\r\nconst note = new Note(\"A\", \"#\", 4);\r\n// or\r\nconst note = Note.fromString(\"A#4\");\r\nnote.transpose(\"M3\").toString(); // C##5\r\nnote.toString(); // A#4\r\nnote.frequency(); // 466.16\r\nnote.distanceTo(\"A#5\"); // 12\r\nnote.number(); // 58\r\n```\r\n\r\n#### Interval\r\n\r\n```js\r\nconst interval = new Interval(8, \"P\");\r\n// or\r\nconst interval = Interval.fromString(\"8P\"); // or P8\r\ninterval.semitones(); // 12\r\ninterval.isValid(); // true\r\ninterval.isCompound(); // false\r\nNote.fromString(\"A4\").transpose(interval).toString(); // A5\r\n```\r\n\r\n#### Scale\r\n\r\n```js\r\nconst majorScaleFormula = [\"P1\", \"M2\", \"M3\", \"P4\", \"P5\", \"M6\", \"M7\"];\r\nconst scale = new Scale(\"A\", majorScaleFormula);\r\nscale.getNotes().map((note) =\u003e note.toString()); // [\"A4\", \"B4\", \"C#5\", \"D5\", \"E5\", \"F#5\", G#5\", ]\r\nconst ionian = new Scale(\"C\", \"ionian\");\r\nionian.getNotes().map((note) =\u003e note.toString()); // [\"C4\", \"D4\", \"E4\", \"F4\", \"G4\", \"A4\", \"B4\", ]\r\nionian.getChords(); // get chords for scale by degree\r\nionian.getScaleInfo(); // { name: \"Major\", formula: \"\u003c...\u003e\", altNames: [\"Bilaval theta\", \"Ethiopian (A raray)\", \"Ionian\", \"Mela Dhirasankarabharana (29)\", ]}\r\n```\r\n\r\n#### Chords\r\n\r\n```js\r\nconst chord = new Chord(\"C\", \"m\");\r\n// or\r\nconst chord = Chord.fromString(\"Cm\");\r\nchord.getNotes(); // [\"C4\", \"Eb4\", \"G4\"]\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrfrac%2Fgoodchords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrfrac%2Fgoodchords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrfrac%2Fgoodchords/lists"}