{"id":29101718,"url":"https://github.com/open-sl/chords-transposer","last_synced_at":"2025-06-28T21:08:02.183Z","repository":{"id":94341747,"uuid":"78454551","full_name":"Open-SL/Chords-Transposer","owner":"Open-SL","description":"Chords Transposer and raw string parse into chords and lyrics","archived":false,"fork":false,"pushed_at":"2024-02-03T08:29:02.000Z","size":229,"stargazers_count":16,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-02-03T09:21:47.369Z","etag":null,"topics":["chords","chords-transposer","javascript-library","parse","scale"],"latest_commit_sha":null,"homepage":"https://open-sl.github.io/Chords-Transposer/","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/Open-SL.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":"2017-01-09T18:02:35.000Z","updated_at":"2024-02-03T09:21:47.940Z","dependencies_parsed_at":null,"dependency_job_id":"906b1fbd-3ca5-4a09-807b-a9c2edc8f1cc","html_url":"https://github.com/Open-SL/Chords-Transposer","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Open-SL/Chords-Transposer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-SL%2FChords-Transposer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-SL%2FChords-Transposer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-SL%2FChords-Transposer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-SL%2FChords-Transposer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Open-SL","download_url":"https://codeload.github.com/Open-SL/Chords-Transposer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Open-SL%2FChords-Transposer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262497267,"owners_count":23320298,"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":["chords","chords-transposer","javascript-library","parse","scale"],"created_at":"2025-06-28T21:08:00.671Z","updated_at":"2025-06-28T21:08:02.170Z","avatar_url":"https://github.com/Open-SL.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chords Transposer\n\nThe Chord Transposer is a TypeScript/JavaScript library designed to manipulate and transpose chords within text-based songs. This library is intended for browser use and offers functionalities to parse song texts, identify chord positions, and apply transformations like transposing and highlighting chords.\n\n## Features\n\n- **Chord Parsing:** Parses song texts to identify and extract chords.\n- **Chord Transposition:** Allows shifting chords up or down by a specified interval.\n- **HTML Tag Insertion:** Supports highlighting chords by inserting HTML tags around them.\n\n## Getting Started\n\nOnce installed, import the `chords-transposer` library into your project,\n\n```js\nimport Transposer from \"chords-transposer\";\n```\n\n### 1. Parsing Chord Progressions\n\nCreate a Transposer object by passing the chord progression string:\n\n```js\nconst song = \"Gm  F    Gm Eb     B   F     B  Gm\";\nconst transposer = new Transposer(song);\n```\n\n### 2. Getting Chords with Tags\n\nRetrieve the chord progression with HTML span tags for styling:\n\n```js\nconst chordsWithTags = transposer.getWithTags();\nconsole.log(chordsWithTags);\n```\n\nThe output will be:\n\n```html\n\u003cspan class=\"chords-highlighted\"\u003eGm\u003c/span\u003e  \u003cspan class=\"chords-highlighted\"\u003eF\u003c/span\u003e    \u003cspan class=\"chords-highlighted\"\u003eGm\u003c/span\u003e \u003cspan class=\"chords-highlighted\"\u003eEb\u003c/span\u003e     \u003cspan class=\"chords-highlighted\"\u003eB\u003c/span\u003e   \u003cspan class=\"chords-highlighted\"\u003eF\u003c/span\u003e     \u003cspan class=\"chords-highlighted\"\u003eB\u003c/span\u003e  \u003cspan class=\"chords-highlighted\"\u003eGm\u003c/span\u003e\n```\n\n### 3. Shifting Scale\n\nTranspose the chord progression by shifting the scale:\n\n```js\nconst shiftedChords = transposer.shiftScaleBy(1).getWithTags();\nconsole.log(shiftedChords);\n```\n\n### 4. Shifting Scale From One Key to Another\n\nTranspose the chord progression by specifying the original and target keys:\n\n```js\nconst transposedChords = transposer.shiftScaleFromTo(\"G\", \"A\").getWithTags();\nconsole.log(transposedChords);\n```\n\n### 5. Complex Scale Shifting\n\nCombine multiple scale shifts for complex transpositions:\n\n```js\nconst complexTransposition = transposer.shiftScaleBy(1).shiftScaleBy(1).shiftScaleBy(1).getWithTags();\nconsole.log(complexTransposition);\n```\n\n## API Reference\n\nThe library exposes the following main methods:\n\n1. `constructor(song: string)`: Initializes the library with the song text.\n2. `shiftScaleBy(shiftBy: number)`: Shifts chords by the specified number of semitones.\n3. `shiftScaleFromTo(from: string, to: string)`: Shifts chords from a specific chord to another.\n4. `getWithTags()`: Returns the updated song text with HTML tags around chords.\n\nRefer to the library source code or documentation for more detailed API information.\n\n## Contributing\n\nContributions to this library are welcome! If you encounter issues or have ideas for enhancements, feel free to create an issue or pull request on the GitHub repository.\n\n## License\nThis library is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-sl%2Fchords-transposer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-sl%2Fchords-transposer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-sl%2Fchords-transposer/lists"}