This is a collection of functions which are useful for dealing with Players. The Player data type is in the MusicalEnvironment module.
- addNewPlayer :: MVar MusicalEnvironment -> (String, (String, String, String, Double)) -> IO MusicalEnvironment
- displayPlayer :: MVar MusicalEnvironment -> String -> IO ()
- modifyPlayer :: MVar MusicalEnvironment -> String -> (Player -> Player) -> IO MusicalEnvironment
- newPlayer :: String -> String -> String -> String -> Double -> Player
- newPlayerStore :: (String, (String, String, String, Double)) -> Map String Player
- pause :: MVar MusicalEnvironment -> String -> IO ()
- pauseN :: MVar MusicalEnvironment -> [String] -> IO ()
- pauseAll :: MVar MusicalEnvironment -> IO ()
- play :: MVar MusicalEnvironment -> String -> IO ()
- playN :: MVar MusicalEnvironment -> [String] -> IO ()
- playAll :: MVar MusicalEnvironment -> IO ()
- playAt :: Double -> MVar MusicalEnvironment -> String -> IO ()
- playNAt :: MVar MusicalEnvironment -> [Char] -> [String] -> IO ()
- playAllAt :: MVar MusicalEnvironment -> [Char] -> IO ()
- playAtTimeString :: [Char] -> MVar MusicalEnvironment -> String -> IO ()
- reset :: MVar MusicalEnvironment -> String -> IO ()
- resetN :: MVar MusicalEnvironment -> [String] -> IO ()
- resetAll :: MVar MusicalEnvironment -> IO ()
- sleep :: RealFrac a => a -> IO ()
- stop :: MVar MusicalEnvironment -> String -> IO ()
- stopN :: MVar MusicalEnvironment -> [String] -> IO ()
- stopAll :: MVar MusicalEnvironment -> IO ()
- swapActions :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironment
- swapBeat :: MVar MusicalEnvironment -> String -> Double -> IO MusicalEnvironment
- swapClock :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironment
- swapCounter :: MVar MusicalEnvironment -> String -> Integer -> IO MusicalEnvironment
- swapIOI :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironment
- swapInterrupt :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironment
- swapName :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironment
- swapPauseTime :: MVar MusicalEnvironment -> String -> Double -> IO MusicalEnvironment
- swapStatus :: MVar MusicalEnvironment -> String -> PlayerStatus -> IO MusicalEnvironment
- timeDiff :: TempoClock -> Double -> IO Double
Documentation
addNewPlayer :: MVar MusicalEnvironment -> (String, (String, String, String, Double)) -> IO MusicalEnvironmentSource
Creates a new player from the given arguments and adds it to the MusicalEnvironment.
displayPlayer :: MVar MusicalEnvironment -> String -> IO ()Source
Displays information about a single player.
modifyPlayer :: MVar MusicalEnvironment -> String -> (Player -> Player) -> IO MusicalEnvironmentSource
Used to change a player stored in a MusicalEnvironment.
:: String | the name of the player |
-> String | the clock it should follow |
-> String | the name of the IOI function to use |
-> String | the name of the action to use |
-> Double | the beat to start on when played |
-> Player |
Creates a new player.
newPlayerStore :: (String, (String, String, String, Double)) -> Map String PlayerSource
Used for setting up the playerStore of a MusicalEnvironment. It automatically creates one player according to the arguments it is given.
pauseAll :: MVar MusicalEnvironment -> IO ()Source
play :: MVar MusicalEnvironment -> String -> IO ()Source
Plays a player, specified by the string, from a MusicalEnvironment. The start time is determined by the playerBeat field of the player.
playAll :: MVar MusicalEnvironment -> IO ()Source
playAt :: Double -> MVar MusicalEnvironment -> String -> IO ()Source
Plays a player, specified by the string, from a MusicalEnvironment. The start time is given in beats as the first argument (the Double), from which the player automatically adjusts the playerBeat record.
playAtTimeString :: [Char] -> MVar MusicalEnvironment -> String -> IO ()Source
Plays a player, specified by the string, from a MusicalEnvironment. The start time is given as a time string as the first argument (the Double), from which the player automatically adjusts the playerBeat record. Time strings are specified in the MusicalTime module.
reset :: MVar MusicalEnvironment -> String -> IO ()Source
Resets a paused player. Resetting means setting the playerBeat and playerCounter to 0.
resetAll :: MVar MusicalEnvironment -> IO ()Source
stop :: MVar MusicalEnvironment -> String -> IO ()Source
Stops the specified player. Doing so resets both the playerBeat and playerCounter to 0.
stopAll :: MVar MusicalEnvironment -> IO ()Source
swapActions :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironmentSource
Change the action function of a player from old (second argument) to new (third argument).
swapBeat :: MVar MusicalEnvironment -> String -> Double -> IO MusicalEnvironmentSource
Change the beat of the next event of a player.
swapClock :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironmentSource
Change the clock a player is following from old (second argument) to new (third argument).
swapCounter :: MVar MusicalEnvironment -> String -> Integer -> IO MusicalEnvironmentSource
Change the counter value of a player.
swapIOI :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironmentSource
Change the IOI function of a player from old (second argument) to new (third argument).
swapInterrupt :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironmentSource
Change the interrupt function of a player from old (second argument) to new (third argument).
swapName :: MVar MusicalEnvironment -> String -> String -> IO MusicalEnvironmentSource
Change the name of a player from old (second argument) to new (third argument).
swapPauseTime :: MVar MusicalEnvironment -> String -> Double -> IO MusicalEnvironmentSource
Change the time of the last pause of a player.
swapStatus :: MVar MusicalEnvironment -> String -> PlayerStatus -> IO MusicalEnvironmentSource
Change the status of a player.