Groups

Sometimes it is useful to apply effects to multiple Player objects at once. That is where the Group object comes in!

Group(*players)

Create a group object, which can be treated like a simple Player object. Effects can be applied like so:

# Soften several Players at once
Group(p1, p2, p3).amp = 0.25

Groups can be assigned to a variable to be used repeatedly

my_group = Group(p1, p2, p3)
my_group.amp = 1/2
my_group.hpf = 500

Methods

stop()

Stops all of the Players in the group.

Group(p1, p2, p3).stop()
solo()

Mutes all other Players i.e. only the Players in the Group can be heard.

Group(p1, p2, p3).solo() 
only()

Stops all other Players

Group(p1, p2, p3).only()

Existing Groups

There already exist several Group objects in FoxDot for certain sets of Player Objects based on the variable name, ending with the suffix _all. So for each character, e.g. “a”, there is a group called a_all that contains a1, a2, a3, …, a9. So if you organise your players by variable name, it is easy to apply effects or stop them all at once:

d1 >> play("x-o-")
d2 >> play("   *  * *")

p1 >> pads([0, 4, -2, 3], dur=4)
p2 >> pluck([0, 1, 3, 4], dur=1/4)

# Apply a filter
p_all.hpf = 500

# Stop only the Players beginning with 'd'
d_all.stop()

You can access a Group of all the currently active Players by using the Master() function, which returns a Group object.

d1 >> play("x-o-")
p1 >> pluck([0, 2, 4, 2])

# Applies the filter to all Players
Master().hpf = 500

# Stop everything
Master().stop()