2.6 Groupsπ
Introductionπ
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:
Groups can be assigned to a variable to be used repeatedly
Methodsπ
.stop()π
Stops all of the Players in the group.
.solo()π
Mutes all other Players i.e. only the Players in the Group can be heard.
.only()π
Stops all Players not in the group
Default 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.