Skip to content

Instantly share code, notes, and snippets.

@t0dd
Created November 2, 2020 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t0dd/ec860ead16ed8767cc962ee40ef9a9bb to your computer and use it in GitHub Desktop.
Save t0dd/ec860ead16ed8767cc962ee40ef9a9bb to your computer and use it in GitHub Desktop.
Ruby implementation of the Formula for calculating frequencies of musical notes
# given a musical note with a specific frequency (in Hz), how do to calculate the frequency of another note?
def note_freq_calc (base_frequency, number_of_steps_to_next_note)
frequency_of_note = base_frequency * 1.059463094359 ** number_of_steps_to_next_note
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment