Tutorial 9: Groups🔗
Attributes of players, such as degree or scale, can also be changed by directly assigning values to it such that
is equivalent to
This is useful if you want to assign the same values to multiple Player Object simultaneously, like so:
p1 >> pads([0,2,4,2])
p2 >> pads([2,1,0,4])
p3 >> pads([2,3])
p1.dur=p2.dur=p3.dur=[1,1/2,1/4,1/4]
p1.stop()
p2.stop()
p3.stop()
You can reference all the members with similar names
or
Or...
Or...
To reduce the amount of typing, Player Objects can be grouped together and their attributes modified in a simpler way:
p1 >> pads([0,2,4,2])
p2 >> pads([2,1,0,4])
p3 >> pads([2,3])
g1 = Group(p1, p2, p3)
g1.dur=[1,1/2,1/4,1/4]
You can group will _all groups
Set the volume on for 4 beats, then off for 4 This overrides existing amplitudes set in the player object
You can use functions to group things together. To execute use CTRL+Return, not ALT+Return.
or schedule the clock to call other grouped functions