Safe Haskell | None |
---|
This is a collection of functions which are useful for dealing with Players.
- displayPlayer :: MusicalEnvironment -> String -> IO ()
- sleep :: RealFrac a => a -> IO ()
- newPlayer :: String -> String -> String -> String -> Double -> Player
- modifyPlayer :: MusicalEnvironment -> String -> (Player -> Player) -> IO ()
- withPlayers :: MusicalEnvironment -> (Player -> a1) -> [String] -> IO [Maybe a1]
- swapName :: MusicalEnvironment -> String -> String -> IO ()
- swapStatus :: MusicalEnvironment -> String -> PlayerStatus -> IO ()
- swapIOI :: MusicalEnvironment -> String -> String -> IO ()
- swapCounter :: MusicalEnvironment -> String -> Integer -> IO ()
- swapClock :: MusicalEnvironment -> String -> String -> IO ()
- swapActions :: MusicalEnvironment -> String -> String -> IO ()
- swapInterrupt :: MusicalEnvironment -> String -> String -> IO ()
- swapBeat :: MusicalEnvironment -> String -> Double -> IO ()
- swapPauseTime :: MusicalEnvironment -> String -> Double -> IO ()
- play :: MusicalEnvironment -> String -> IO ()
- playAt :: Double -> MusicalEnvironment -> String -> IO ()
- playAtTimeString :: [Char] -> MusicalEnvironment -> String -> IO ()
- playNow :: MusicalEnvironment -> String -> IO ()
- playAtStartOfNMeasure :: MusicalEnvironment -> Int -> String -> IO ()
- basicPlay :: MusicalEnvironment -> String -> PlayerStatus -> IO ()
- pause :: MusicalEnvironment -> String -> IO ()
- stop :: MusicalEnvironment -> String -> IO ()
- reset :: MusicalEnvironment -> String -> IO ()
- playN :: MusicalEnvironment -> [String] -> IO ()
- playAll :: MusicalEnvironment -> IO ()
- pauseN :: MusicalEnvironment -> [String] -> IO ()
- pauseAll :: MusicalEnvironment -> IO ()
- stopN :: MusicalEnvironment -> [String] -> IO ()
- stopAll :: MusicalEnvironment -> IO ()
- resetN :: MusicalEnvironment -> [String] -> IO ()
- resetAll :: MusicalEnvironment -> IO ()
- newPlayerStore :: (String, (String, String, String, Double)) -> IO (TVar (Map String Player))
- addNewPlayer :: MusicalEnvironment -> (String, (String, String, String, Double)) -> IO ()
Documentation
displayPlayer :: MusicalEnvironment -> String -> IO ()Source
Displays information about a single player.
:: 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.
modifyPlayer :: MusicalEnvironment -> String -> (Player -> Player) -> IO ()Source
Used to change a player stored in a MusicalEnvironment.
withPlayers :: MusicalEnvironment -> (Player -> a1) -> [String] -> IO [Maybe a1]Source
swapName :: MusicalEnvironment -> String -> String -> IO ()Source
Change the name of a player from old (second argument) to new (third argument).
swapStatus :: MusicalEnvironment -> String -> PlayerStatus -> IO ()Source
Change the status of a player.
swapIOI :: MusicalEnvironment -> String -> String -> IO ()Source
Change the IOI function of a player (second argument) from old IOI function to new one (third argument).
swapCounter :: MusicalEnvironment -> String -> Integer -> IO ()Source
Change the counter value of a player.
swapClock :: MusicalEnvironment -> String -> String -> IO ()Source
Change the clock a player is following from old (second argument) to new (third argument).
swapActions :: MusicalEnvironment -> String -> String -> IO ()Source
Change the action function of a player from old (second argument) to new (third argument).
swapInterrupt :: MusicalEnvironment -> String -> String -> IO ()Source
Change the interrupt function of a player from old (second argument) to new (third argument).
swapBeat :: MusicalEnvironment -> String -> Double -> IO ()Source
Change the beat of the next event of a player.
swapPauseTime :: MusicalEnvironment -> String -> Double -> IO ()Source
Change the time of the last pause of a player.
play :: 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.
playAt :: Double -> 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] -> 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.
playNow :: MusicalEnvironment -> String -> IO ()Source
playAtStartOfNMeasure :: MusicalEnvironment -> Int -> String -> IO ()Source
basicPlay :: MusicalEnvironment -> String -> PlayerStatus -> IO ()Source
pause :: MusicalEnvironment -> String -> IO ()Source
Pauses the specified player.
stop :: MusicalEnvironment -> String -> IO ()Source
Stops the specified player. Doing so resets both the playerBeat and playerCounter to 0.
reset :: MusicalEnvironment -> String -> IO ()Source
Resets a paused player. Resetting means setting the playerBeat and playerCounter to 0.
playN :: MusicalEnvironment -> [String] -> IO ()Source
playAll :: MusicalEnvironment -> IO ()Source
pauseN :: MusicalEnvironment -> [String] -> IO ()Source
pauseAll :: MusicalEnvironment -> IO ()Source
stopN :: MusicalEnvironment -> [String] -> IO ()Source
stopAll :: MusicalEnvironment -> IO ()Source
resetN :: MusicalEnvironment -> [String] -> IO ()Source
resetAll :: MusicalEnvironment -> IO ()Source
newPlayerStore :: (String, (String, String, String, Double)) -> IO (TVar (Map String Player))Source
Used for setting up the playerStore of a MusicalEnvironment. It automatically creates one player according to the arguments it is given.
addNewPlayer :: MusicalEnvironment -> (String, (String, String, String, Double)) -> IO ()Source
Creates a new player from the given arguments and adds it to the MusicalEnvironment.