{"id":18645275,"url":"https://github.com/danigb/music-gamut","last_synced_at":"2025-11-05T03:30:27.819Z","repository":{"id":66458358,"uuid":"44348927","full_name":"danigb/music-gamut","owner":"danigb","description":"Manipulate notes made easy","archived":false,"fork":false,"pushed_at":"2015-10-21T18:32:39.000Z","size":212,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T11:34:52.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/danigb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","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":"2015-10-15T22:23:47.000Z","updated_at":"2020-08-02T23:38:24.000Z","dependencies_parsed_at":"2023-02-20T20:00:16.793Z","dependency_job_id":null,"html_url":"https://github.com/danigb/music-gamut","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic-gamut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic-gamut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic-gamut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic-gamut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danigb","download_url":"https://codeload.github.com/danigb/music-gamut/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449552,"owners_count":19640532,"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-11-07T06:15:24.141Z","updated_at":"2025-11-05T03:30:27.773Z","avatar_url":"https://github.com/danigb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# music-gamut\n\n[![Build Status](https://travis-ci.org/danigb/music-gamut.svg?branch=master)](https://travis-ci.org/danigb/music-gamut)\n[![Test Coverage](https://codeclimate.com/github/danigb/music-gamut/badges/coverage.svg)](https://codeclimate.com/github/danigb/music-gamut/coverage)\n[![Code Climate](https://codeclimate.com/github/danigb/music-gamut/badges/gpa.svg)](https://codeclimate.com/github/danigb/music-gamut)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n[![npm version](https://badge.fury.io/js/music-gamut.svg)](https://badge.fury.io/js/music-gamut)\n[![pitch-array](https://img.shields.io/badge/pitch--array-compatible-yellow.svg)](https://github.com/danigb/pitch-array)\n\n`music-gamut` is a javascript library to manipulate notes (or intervals):\n\n```js\ngamut.pitchSet('C2 D3 C4 E5') // =\u003e ['C', 'D', 'E']\ngamut.transpose('2M', 'C D E F G') // =\u003e ['D', 'E', 'F#', 'G', 'A']\ngamut.distances('C2', 'C3 C4') // =\u003e ['8P', '15P']\n```\n\nIt's fast, easy and side-effects free (all pure functions).\n\n## Install\n\nFor node users: `npm i --save music-gamut`. For browser users, use webpack, browserify or similar tool.\n\n## Usage\n\nIn `music-gamut`, a gamut is list of notes or intervals. The list can be expressed as arrays or as strings separated by spaces, commas or bars:\n\n```js\ngamut(['C', 'D', 'E']) // =\u003e ['C', 'D', 'E']\ngamut('C D E') // =\u003e ['C', 'D', 'E']\ngamut('C | D | E') // =\u003e ['C', 'D', 'E']\ngamut('C, D, E') // =\u003e ['C', 'D', 'E']\n```\n\nYou can use the functions `notes` and `intervals` and to filter the type:\n\n```js\ngamut.notes('C2 blah D3') // =\u003e ['C2', null, 'D3']\ngamut.intervals('1 2 3 blah 4 5') // =\u003e ['1P', '2M', '3M', null, '4P', '5P']\n```\n\nYou have a collection of funtions to manipulate the lists. All the functions returns a new copy of the list (no mutations):\n\n- transpose: transpose a list of notes by an interval\n- add: add an interval to a list of intervals\n- distances: get distances of the gamut from a note\n- pitchSet: get the pitch set from the gamut\n- intervalSet: get the interval set from the gamut\n- uniq: remove duplicates and nulls\n- pitchClasses: remove the octaves from the notes\n\n(... and some more. Read the [docs](https://github.com/danigb/music-gamut/blob/master/API.md))\n\n## What is this for?\n\nSee [music-scale](https://github.com/danigb/music-scale), [music-chord](https://github.com/danigb/music-chord) or [tonal](https://github.com/danigb/tonal)\n\n## Documentation\n\n[Generated API documentation is here](https://github.com/danigb/music-gamut/blob/master/API.md)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmusic-gamut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanigb%2Fmusic-gamut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmusic-gamut/lists"}