{"id":18645223,"url":"https://github.com/danigb/note-pitch","last_synced_at":"2025-11-05T03:30:27.042Z","repository":{"id":32265874,"uuid":"35840411","full_name":"danigb/note-pitch","owner":"danigb","description":"Note pitch manipulation in javascript","archived":false,"fork":false,"pushed_at":"2016-06-02T23:04:50.000Z","size":15,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-27T11:34:49.582Z","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-05-18T20:20:22.000Z","updated_at":"2016-06-02T23:04:50.000Z","dependencies_parsed_at":"2022-06-26T19:31:01.104Z","dependency_job_id":null,"html_url":"https://github.com/danigb/note-pitch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fnote-pitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fnote-pitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fnote-pitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fnote-pitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danigb","download_url":"https://codeload.github.com/danigb/note-pitch/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:07.194Z","updated_at":"2025-11-05T03:30:27.008Z","avatar_url":"https://github.com/danigb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## *** deprecated: use [tonal](http://github.com/danigb/tonal) ***\n\n__This library is not longer maintained.__\n\n# note-pitch\n\n[![Code Climate](https://codeclimate.com/github/danigb/note-pitch/badges/gpa.svg)](https://codeclimate.com/github/danigb/note-pitch)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\n\nExtends [note-parser](http://github.com/danigb/note-parser) to add note pitch manipulation.\n\nAs an extension of note-parser, you can parse notes:\n\n```js\nvar Note = require('note-pitch');\nNote.parse('a4'); // =\u003e { pc: 'a', acc: '', oct: 4, midi: 69, freq: 440 }\n```\n\nBut also you can transpose them:\n\n```js\nNote.transpose('e4', 'M2'); // =\u003e 'f#4'\nNote.transpose('c2', [\"P1\",\"M2\",\"M3\"]); // =\u003e ['c2', 'd2', 'e2']\n```\n\nOr find distances (in intervals):\n\n```js\nNote.distance('c2', 'd2'); // =\u003e 'M2'\nNote.distance('c', ['c', 'd', 'eb', 'f', 'g']); // =\u003e ['P1', 'M2', 'm3', 'P4', 'P5']\n```\n\n## Installation\n\nInstall the module: `npm i --save note-pitch` and require it:\n\n```js\nvar Note = require('note-pitch');\n```\n\nIf you want to use it inside a browser you will need a node module compatible\npackager (like browserify or webpack).\n\nThis is part of a higher level library\nthat performs transpositions (and much more) ready to browser:\n[ScoreJs](http://github.com/danigb/ScoreJS)\n\n## API\n\n### Note.parse(note)\n\nReturns the note as parsed object.\nSee [note-parser](http://github.com/danigb/note-parser) for more information.\n\n### Note.semitones(noteA, noteB)\n\nReturns the distance in semitones between noteA and noteB (can be positive or negative number)\n\n### Note.transpose(note, interval)\n\nTranspose the given note by a interval:\n\n```js\nNote.transpose('g5', 'm3'); // =\u003e \"bb5\";\n```\n\nIf you skip the note, you get a _transposer_, a function that transpose notes by\na certain interval:\n\n```js\nvar transposer = Note.transpose('M2');\ntransposer('c2'); // =\u003e \"d2\"\ntransposer('d2'); // =\u003e \"e2\"\ntransposer('e2'); // =\u003e \"f#2\"\n```\n\nAlso, you can specify an array of intervals, ideal for building chords or scales:\n\n```js\nNote.transpose('c2', ['P1', 'M2', 'm3']); // =\u003e [\"c2\", \"d2\", \"eb3\"]\nNote.transpose('a2', ['P1', 'M3', 'P5']); // =\u003e [\"a2\", \"c#3\", \"e3\"]\n```\n\n### Note.distance(root, notes)\n\nReturns the distance between a root note and a list of notes:\n\n```js\nNote.distance('c2', 'd2'); // =\u003e \"M2\"\nNote.distance('c2', ['c2', 'd2', 'e2']); // =\u003e ['P1', 'M2', 'M3']\n```\n\nIf you skip the notes, you get a _distancer_, a function that returns the\ndistance from the root to another note:\n\n```js\nvar distance = Note.distance('c2');\ndistance('c2'); // =\u003e 'P1'\ndistance('d2'); // =\u003e 'M2'\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fnote-pitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanigb%2Fnote-pitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fnote-pitch/lists"}