Skip to content

Internal Player

For musicians, it is important to put things in time. With the functions presented here you can call specific functions using onsets values. For example, in py4pd-upic I use pd.add_to_player to play svg draws that are used to control parameters. So each svg elements trigger some specific function in a specific point in time.

Set the right configuration

To use this methods the Python Object must be configurable with playable as True. See configuration for player object.

pd.add_to_player

  • Example

    It just returns unique string.

    import pd
    
    def add_to_player(onset, thing):
        pd.add_to_player(onset, thing)
    
  • Arguments

    Parameters Type Description
    arg1 int Onset in milliseconds.
    arg2 Python Object Represents any Python entity; its output corresponds to the timestamp of onset.

pd.clear_player

  • Example

    Used to clear all events in the player.

    import pd
    
    def clear_player():
        pd.clear_player()
    
  • Arguments

    There is no args for this function.