Skip to content

eventcycles

Read absolute time in k-rate cycles, since the start of an instance of an instrument.

Called at both i-time and k-time. At k-time, the first performance cycle returns 0. A note that runs for N cycles reports cycle indices from 0 through N - 1.

Syntax

kres = eventcycles()
kres eventcycles

Performance

eventcycles is for time in k-rate cycles. So with:

sr    = 44100
ksmps = 7

then after half a second, the eventcycles opcode would report 3150. It will always report an integer.

eventcycles produces a k-rate variable for output. There are no input parameters.

eventcycles is similar to elapsedcycles except it returns the time since the start of this instance of the instrument.

📝 Note

eventcycles starts at 0 on the first performance cycle, while timeinstk starts at 1.

See also

Time Reading

Credits

Author: Eduardo Moguillansky
August 2022