note-freq

1.0.1 • Public • Published

note-freq npm version

tonal

Get frequency of a note:

var freq = require('note-freq')
freq(440, 'a4') // => 440

It works with midi numbers too:

freq(440, 57) // => 222

Usage

Get the frequency using a custom tunning:

// 69 is note A4
var freq = require('note-freq')
freq(440, 'a4') // => 440
freq(null, 'a4') // => 440
freq(444, 'a4') /// => 444
freq(null, 'a3') // => 220
// 57 is note A3
freq(444, 57) // => 222

Set default tuning

Normally you use the same tuning for all your app. You can partially apply the function to set the default tuning:

var freq = require('note-freq')(444)
// the freq function uses 444 as custom tuning
freq('A3') // => 222

License

MIT License

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    2

Package Sidebar

Install

npm i note-freq

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • danigb