Clock
Basics
To stop all player objects, you can press Ctrl+. (Hold Ctrl and hit the period). Which is a shortcut for the command:
Change the tempo (this takes effect at the next bar) Default is 120.
To see what is scheduled to be played.
To see what the latency is
Sometimes you want to know when the start of the next X beat cycle. To do this we use the ‘mod’ method. For example if we want to see when the start of the next 32 beat cycle is we can do
Advanced
The clock can schedule anything with a call method using. It takes an absolute time clue to schedule a functions - Clock.schedule needs to know the beat to call something on.
Schedule an event after a certain durations - Clock.future needs to know how many beats ahead to call something
These are equivalent
To schedule something else
We can call something every n beats
Get the current clock and add 2. - Useful for scheduling.
Issue command on the next bar
With a decorator
You can create your own function, and decorate it, to be able to use it in an .every on a Player object
And cancel it with