{"id":18645221,"url":"https://github.com/danigb/pitch-fifths","last_synced_at":"2025-07-24T05:36:29.942Z","repository":{"id":66458346,"uuid":"44128655","full_name":"danigb/pitch-fifths","owner":"danigb","description":"Pitches and intervals expressed in fifths","archived":false,"fork":false,"pushed_at":"2015-10-12T20:23:35.000Z","size":140,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-12T21:54:45.858Z","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-12T19:15:27.000Z","updated_at":"2015-10-22T14:34:50.000Z","dependencies_parsed_at":"2023-02-20T20:00:28.238Z","dependency_job_id":null,"html_url":"https://github.com/danigb/pitch-fifths","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danigb/pitch-fifths","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fpitch-fifths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fpitch-fifths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fpitch-fifths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fpitch-fifths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danigb","download_url":"https://codeload.github.com/danigb/pitch-fifths/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fpitch-fifths/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796891,"owners_count":23985492,"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-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-07T06:15:07.107Z","updated_at":"2025-07-24T05:36:29.921Z","avatar_url":"https://github.com/danigb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pitch-fifths\n\nPitches and intervals expressed in fifths and octaves:\n\n```js\nvar fifths = require('pitch-fifths')\nfifths([1, 0, 0]) // =\u003e [2, -1]\nfifths.toPitch([2, -1]) // =\u003e [1, 0, 0]\n```\n\nThis library converts from [a-pitch](https://github.com/danigb/a-pitch) arrays to a `[fifths, octaves]` array. This representation of pitches (or intervals) are useful to do [interval arithmetic](https://github.com/danigb/pitch-op).\n\nThis is a low level library. Probably you want to use [tonal](https://github.com/danigb/tonal)\n\n## API\n\n\u003c!-- START docme generated API please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN docme TO UPDATE --\u003e\n\n\u003cdiv\u003e\n\u003cdiv class=\"jsdoc-githubify\"\u003e\n\u003csection\u003e\n\u003carticle\u003e\n\u003cdiv class=\"container-overview\"\u003e\n\u003cdl class=\"details\"\u003e\n\u003c/dl\u003e\n\u003c/div\u003e\n\u003cdl\u003e\n\u003cdt\u003e\n\u003ch4 class=\"name\" id=\"fifths\"\u003e\u003cspan class=\"type-signature\"\u003e\u003c/span\u003efifths\u003cspan class=\"signature\"\u003e(apitch)\u003c/span\u003e\u003cspan class=\"type-signature\"\u003e \u0026rarr; {Array}\u003c/span\u003e\u003c/h4\u003e\n\u003c/dt\u003e\n\u003cdd\u003e\n\u003cdiv class=\"description\"\u003e\n\u003cp\u003eGet a pitch or interval measured in fifths and octaves\u003c/p\u003e\n\u003cp\u003eEvery interval (or pitch) can be expressed by repeating ascending or descending\nfifths and octaves. For exaple, interval major second is two fifths up and\none octave down:\n\u003ccode\u003efifths([1, 0, 0]) // =\u0026gt; [2, -1]\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eThis representation is useful for calculating interval distances, transpositions\nor keys\u003c/p\u003e\n\u003c/div\u003e\n\u003ch5\u003eParameters:\u003c/h5\u003e\n\u003ctable class=\"params\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eName\u003c/th\u003e\n\u003cth\u003eType\u003c/th\u003e\n\u003cth class=\"last\"\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd class=\"name\"\u003e\u003ccode\u003eapitch\u003c/code\u003e\u003c/td\u003e\n\u003ctd class=\"type\"\u003e\n\u003cspan class=\"param-type\"\u003eArray\u003c/span\u003e\n\u003c/td\u003e\n\u003ctd class=\"description last\"\u003e\u003cp\u003ethe pitch or interval as \u003ca href=\"https://github.com/danigb/a-pitch\"\u003ea-pitch\u003c/a\u003e\u003c/p\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cdl class=\"details\"\u003e\n\u003cdt class=\"tag-source\"\u003eSource:\u003c/dt\u003e\n\u003cdd class=\"tag-source\"\u003e\u003cul class=\"dummy\"\u003e\n\u003cli\u003e\n\u003ca href=\"https://github.com/danigb/pitch-fifths/blob/master/index.js\"\u003eindex.js\u003c/a\u003e\n\u003cspan\u003e, \u003c/span\u003e\n\u003ca href=\"https://github.com/danigb/pitch-fifths/blob/master/index.js#L27\"\u003elineno 27\u003c/a\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\u003ch5\u003eReturns:\u003c/h5\u003e\n\u003cdiv class=\"param-desc\"\u003e\n\u003cp\u003ean array with the form [fifths, octaves] where both are integers\u003c/p\u003e\n\u003c/div\u003e\n\u003cdl\u003e\n\u003cdt\u003e\nType\n\u003c/dt\u003e\n\u003cdd\u003e\n\u003cspan class=\"param-type\"\u003eArray\u003c/span\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003ch5\u003eExample\u003c/h5\u003e\n\u003cpre class=\"prettyprint\"\u003e\u003ccode\u003evar fifths = require('pitch-fifths')\nfifths([0, 0, 0]) // =\u003e [0, 0]\nfifths([0, 0, 1]) // =\u003e [0, 1]\nfifths([1, 0, 0]) // =\u003e [2, -1]\u003c/code\u003e\u003c/pre\u003e\n\u003c/dd\u003e\n\u003cdt\u003e\n\u003ch4 class=\"name\" id=\"toPitch\"\u003e\u003cspan class=\"type-signature\"\u003e\u003c/span\u003etoPitch\u003cspan class=\"signature\"\u003e(coord)\u003c/span\u003e\u003cspan class=\"type-signature\"\u003e \u0026rarr; {Array}\u003c/span\u003e\u003c/h4\u003e\n\u003c/dt\u003e\n\u003cdd\u003e\n\u003cdiv class=\"description\"\u003e\n\u003cp\u003eGet the \u003ca href=\"https://github.com/danigb/a-pitch\"\u003ea-pitch\u003c/a\u003e structure from a\nfifths array\u003c/p\u003e\n\u003c/div\u003e\n\u003ch5\u003eParameters:\u003c/h5\u003e\n\u003ctable class=\"params\"\u003e\n\u003cthead\u003e\n\u003ctr\u003e\n\u003cth\u003eName\u003c/th\u003e\n\u003cth\u003eType\u003c/th\u003e\n\u003cth class=\"last\"\u003eDescription\u003c/th\u003e\n\u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n\u003ctd class=\"name\"\u003e\u003ccode\u003ecoord\u003c/code\u003e\u003c/td\u003e\n\u003ctd class=\"type\"\u003e\n\u003cspan class=\"param-type\"\u003eArray\u003c/span\u003e\n\u003c/td\u003e\n\u003ctd class=\"description last\"\u003e\u003cp\u003ethe fifths array\u003c/p\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cdl class=\"details\"\u003e\n\u003cdt class=\"tag-source\"\u003eSource:\u003c/dt\u003e\n\u003cdd class=\"tag-source\"\u003e\u003cul class=\"dummy\"\u003e\n\u003cli\u003e\n\u003ca href=\"https://github.com/danigb/pitch-fifths/blob/master/index.js\"\u003eindex.js\u003c/a\u003e\n\u003cspan\u003e, \u003c/span\u003e\n\u003ca href=\"https://github.com/danigb/pitch-fifths/blob/master/index.js#L45\"\u003elineno 45\u003c/a\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\u003ch5\u003eReturns:\u003c/h5\u003e\n\u003cdiv class=\"param-desc\"\u003e\n\u003cp\u003ethe a-pitch structure\u003c/p\u003e\n\u003c/div\u003e\n\u003cdl\u003e\n\u003cdt\u003e\nType\n\u003c/dt\u003e\n\u003cdd\u003e\n\u003cspan class=\"param-type\"\u003eArray\u003c/span\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003ch5\u003eExample\u003c/h5\u003e\n\u003cpre class=\"prettyprint\"\u003e\u003ccode\u003evar fifths = require('pitch-fifths')\nfifths.toPitch([3, -1]) // =\u003e [6, 0, 1]\u003c/code\u003e\u003c/pre\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\u003c/article\u003e\n\u003c/section\u003e\n\u003c/div\u003e\n\n*generated with [docme](https://github.com/thlorenz/docme)*\n\u003c/div\u003e\n\u003c!-- END docme generated API please keep comment here to allow auto update --\u003e\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fpitch-fifths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanigb%2Fpitch-fifths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fpitch-fifths/lists"}