{"id":18645164,"url":"https://github.com/danigb/midi-freq","last_synced_at":"2025-04-11T12:31:17.878Z","repository":{"id":57296885,"uuid":"46973709","full_name":"danigb/midi-freq","owner":"danigb","description":"Get frequency of a midi note","archived":false,"fork":false,"pushed_at":"2016-06-13T18:47:15.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T13:46:20.403Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danigb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-27T10:14:04.000Z","updated_at":"2020-12-21T00:48:50.000Z","dependencies_parsed_at":"2022-09-01T13:01:53.185Z","dependency_job_id":null,"html_url":"https://github.com/danigb/midi-freq","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%2Fmidi-freq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmidi-freq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmidi-freq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danigb%2Fmidi-freq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danigb","download_url":"https://codeload.github.com/danigb/midi-freq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401954,"owners_count":21097328,"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:14:54.475Z","updated_at":"2025-04-11T12:31:17.593Z","avatar_url":"https://github.com/danigb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# midi-freq [![npm version](https://img.shields.io/npm/v/midi-freq.svg)](https://www.npmjs.com/package/midi-freq)\n\nA tiny (188 bytes) function to get the frequency of a midi note number:\n\n```js\nvar freq = require('midi-freq')(440)\nfreq(69) // =\u003e 440\n```\n\nIt uses an equal tempered scale. Basically it's just: `Math.pow(2, (midi - 69) / 12) * tuning` with a couple of goodies.\n\n## API\n\n### `freq(tuning, midi)`\n\nGet the frequency of a midi note with the custom tuning. If not specified, is 440Hz by default.\n\n#### Basic usage\n\nGet the frequency:\n\n```js\n// 69 is note A4\nvar freq = require('midi-freq')\nfreq(440, 69) // =\u003e 440\nfreq(null, 69) // =\u003e 440\nfreq(444, 69) /// =\u003e 444\n// 57 is note A3\nfreq(null, 57) // =\u003e 220\nfreq(444, 57) // =\u003e 222\n```\n\n#### Set default tuning\n\nNormally you use the same tuning for all your app. You can partially applied the function:\n\n```js\nvar freq = require('midi-freq')(444)\n// the freq function uses 444 as custom tuning\nfreq(57) // =\u003e 222\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmidi-freq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanigb%2Fmidi-freq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanigb%2Fmidi-freq/lists"}