Count events per second

Is there an easy way of counting number of triggers per second, (e.g. from an onset detector)? Feels like it should be obvious, but my brain isn’t working at the minute

Does this help?

Ndef(\trigCounter, {
	var trig =;
	var delayedTrig =
		in: trig,
		maxdelaytime: 1.0,
		delaytime: 1.0
	var counter =;
	var delayedCounter =;

If you need the value within sclang, you can use SendReply to transfer the value from server to lang :slight_smile:

Thank you, that’s very elegant!