conductive-base-0.2: a library for livecoding and real-time musical applications

Sound.Conductive.Player

Description

This is a collection of functions which are useful for dealing with Players. The Player data type is in the MusicalEnvironment module.

Synopsis

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.

newPlayerSource

Arguments

:: 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.

pause :: MVar MusicalEnvironment -> String -> IO ()Source

Pauses the specified player.

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.

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.

sleep :: RealFrac a => a -> IO ()Source

Creates a thread delay specified in seconds.

stop :: MVar MusicalEnvironment -> String -> IO ()Source

Stops the specified player. Doing so resets both the playerBeat and playerCounter to 0.

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.