https://github.com/danigb/note.freq
Get frequency of a note
https://github.com/danigb/note.freq
Last synced: 5 months ago
JSON representation
Get frequency of a note
- Host: GitHub
- URL: https://github.com/danigb/note.freq
- Owner: danigb
- License: mit
- Created: 2015-11-30T17:50:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-30T17:50:18.000Z (over 9 years ago)
- Last Synced: 2024-12-27T11:34:49.025Z (7 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
# note.freq
[](https://travis-ci.org/danigb/note.freq)
[](https://codeclimate.com/github/danigb/note.freq/coverage)
[](https://codeclimate.com/github/danigb/note.freq)
[](https://github.com/feross/standard)
[](https://www.npmjs.com/package/note.freq)
[](https://www.npmjs.com/package/note.freq)
[](https://www.npmjs.com/browse/keyword/tonal)`note.freq` is a function (1.3kb minified) to get the frequency from a note name:
```js
var freq = require('note.freq')
freq(440, 'A3') // => 220
```This is part of [tonal](https://github.com/danigb/tonal)
## Installation
Install via npm: `npm install --save note.freq` or use add the dist file to the html page.
## API
## `note.freq`
Get the pitch frequency in herzs with custom concert tuning
This function is currified so it can be partially applied (see examples)
### Parameters
* `tuning` **`Float`** the frequency of A4 (null means 440)
* `note` **`String or Array`** the note name### Examples
```js
note.freq(null, 'A4') // => 440
note.freq(444, 'A4') // => 444
```
```js
// partially applied
['A4', 'A#4', 'B5'].map(note.freq(440)) // => [440, ...]
var baroque = note.freq(415)
baroque('A3') // => 207.5
```Returns `Float` the frequency of the note
## License
MIT License