{"id":18645260,"url":"https://github.com/danigb/music.interval","last_synced_at":"2025-11-05T03:30:27.038Z","repository":{"id":66458351,"uuid":"44740638","full_name":"danigb/music.interval","owner":"danigb","description":"Music intervals","archived":false,"fork":false,"pushed_at":"2015-10-28T15:32:34.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-27T11:34:52.162Z","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-22T11:20:08.000Z","updated_at":"2019-07-08T11:51:37.000Z","dependencies_parsed_at":"2023-02-20T20:00:28.233Z","dependency_job_id":null,"html_url":"https://github.com/danigb/music.interval","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic.interval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic.interval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic.interval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmusic.interval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danigb","download_url":"https://codeload.github.com/danigb/music.interval/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:13.606Z","updated_at":"2025-11-05T03:30:26.999Z","avatar_url":"https://github.com/danigb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# music.interval\n\n[![Build Status](https://travis-ci.org/danigb/music.interval.svg?branch=master)](https://travis-ci.org/danigb/music.interval)\n[![Code Climate](https://codeclimate.com/github/danigb/music.interval/badges/gpa.svg)](https://codeclimate.com/github/danigb/music.interval)\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://img.shields.io/npm/v/music.interval.svg)](https://www.npmjs.com/package/music.interval)\n[![license](https://img.shields.io/npm/l/music.interval.svg)](https://www.npmjs.com/package/music.interval)\n[![music.kit](https://img.shields.io/badge/music-kit-yellow.svg)](https://www.npmjs.com/package/music.kit)\n\nSimple and fast musical interval library:\n\n```js\nvar interval = require('music-interval')\ninterval.simplify('9M') // =\u003e '2M'\ninterval.invert('3M') // =\u003e '6m'\n```\n\nThis is part of [music.kit](https://www.npmjs.com/package/music.kit). It uses [music.interval.parser](https://github.com/danigb/music.interval.parser) to parse intervals so see this library to understand interval string notation.\n\n## Install\n\nVia npm: `npm i --save music-interval`. Use browserify or webpack to create a browser compatible distribution, or get the [whole thing](https://github.com/danigb/music.kit)\n\n## Usage\n\n#### Simplify an interval\n\nA simple interval is any interval that spawns an octave or less. You can simplify any interval (simplify a simple interval return itself):\n\n```js\ninterval.simplify('9M') // =\u003e '2M'\ninterval.simplify('2M') // =\u003e '2M'\n```\n\n#### Get inversion of an interval\n\nYou can [invert](https://en.wikipedia.org/wiki/Inversion_(music)#Intervals) an interval with the `invert` function. Notice that all inverted intervals are simples:\n\n```js\ninterval.invert('2M') // =\u003e '7m'\ninterval.invert('1P') // =\u003e '8P'\n```\n\n#### More ...\n\nRead the [generated documentation](https://github.com/danigb/music.interval/blob/master/API.md) or take a look to [music.kit](https://github.com/danigb/music.kit)\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmusic.interval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanigb%2Fmusic.interval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmusic.interval/lists"}