packages feed

synthesizer-alsa-0.4: src/Synthesizer/MIDIValue/BendWheelPressure.hs

{-# LANGUAGE NoImplicitPrelude #-}
module Synthesizer.MIDIValue.BendWheelPressure where

import qualified Data.Accessor.Basic as Accessor

import Control.DeepSeq (NFData, rnf, )

import NumericPrelude.Numeric
import NumericPrelude.Base


data T = Cons {bend_, wheel_, pressure_ :: Int}
   deriving (Show, Eq)

deflt :: T
deflt = Cons 0 0 0


bend, wheel, pressure :: Accessor.T T Int
bend =
   Accessor.fromSetGet
      (\b (Cons _ w p) -> Cons b w p)
      bend_

wheel =
   Accessor.fromSetGet
      (\w (Cons b _ p) -> Cons b w p)
      wheel_

pressure =
   Accessor.fromSetGet
      (\p (Cons b w _) -> Cons b w p)
      pressure_


instance NFData T where
   rnf (Cons b w p) =
      case (rnf b, rnf w, rnf p) of
         ((), (), ()) -> ()