module Sound.MED.Raw.MMD0Sample where

import Sound.MED.Basic.Amiga

data MMD0Sample = MMD0Sample
  { rep        :: UWORD
  , replen     :: UWORD
  , midich     :: UBYTE
  , midipreset :: UBYTE
  , svol       :: UBYTE
  , strans     :: BYTE
  }
  deriving (Show)

peek :: MEM -> PTR -> IO MMD0Sample
peek m p = do
  rep'        <- peekUWORD m (p+0)
  replen'     <- peekUWORD m (p+2)
  midich'     <- peekUBYTE m (p+4)
  midipreset' <- peekUBYTE m (p+5)
  svol'       <- peekUBYTE m (p+6)
  strans'     <- peekBYTE  m (p+7)
  return $ MMD0Sample
    rep' replen' midich' midipreset' svol' strans'