module Sound.Conductive.ConductiveBaseData where
import Sound.Conductive.MutableMap
data MusicalTime = MusicalTime { measure :: Int
, beat :: Double
} deriving (Show)
data TempoChange = TempoChange { newTempo :: Double
, beatOfTempoChange :: Double
, timeOfTempoChange :: Double
} deriving (Show)
data TimeSignature = TimeSignature { startingMeasure :: Int
, startingBeat :: Double
, timeSignature :: Int
} deriving (Show)
data TempoClock = TempoClock { startTime :: Double
, tempoChanges :: [TempoChange]
, timeSignatureChanges :: [TimeSignature]
} deriving (Show)
data MusicalEnvironment = MusicalEnvironment
{ environmentName :: String
, playerStore :: MutableMap String Player
, tempoClockStore :: MutableMap String TempoClock
, iOIStore :: MutableMap String (MusicalEnvironment -> Player -> Double -> Double -> IO Double)
, actionStore :: MutableMap String (MusicalEnvironment -> Player -> Double -> Double -> IO ())
, interruptStore :: MutableMap String ([IO ()])
}
instance Show MusicalEnvironment where
show x = environmentName x
data PlayerStatus = Stopped
| Playing
| Pausing
| Paused
| Stopping
| Resetting
deriving (Eq,Show)
data Player = Player
{ playerName :: String
, playerStatus :: PlayerStatus
, playerCounter :: Integer
, playerClock :: String
, playerIOI :: String
, playerAction :: String
, playerInterrupt :: String
, playerBeat :: Double
, playerStartingBeat :: Double
, playerPauseTime :: Double
} deriving (Show)