pitch-to-frequency

Pitch to frequency and frequency to pitch converter.

Usage no npm install needed!

<script type="module">
  import pitchToFrequency from 'https://cdn.skypack.dev/pitch-to-frequency';
</script>

README

Use

Converts a MIDI pitch to a frequency or a frequency to a MIDI pitch.

ptf = require('pitch-to-frequency')

ptf.frequencyToPitch(440)
// { pitchClass: 'A', octave: 4, cents: 0 }

ptf.pitchToFrequency({ pitchClass: 'A', octave: 4, cents: 0 })
// 440