module Pitch (Pitch,toCents) where

import Data.Ratio

class Pitch p where
    toCents::p->Double

instance (Integral a) => Pitch (Ratio a) where
    toCents ratio = 1200 * log (fromIntegral (numerator ratio) / fromIntegral (denominator ratio)) / log 2
