#pragma once

#include <cmath>

double frequencyToMidi(double f) {
    return ((12 * std::log(f / 220.0) / std::log(2.0)) + 57.01);
}

int frequencyToNearestMidi(double f) {
    return (int) frequencyToMidi(f);
}
