Timeslicing confusion / Pulse to count / Endless Rotary encoder

Hi! I’ve been stuck for a few hours on the following problem. I read the guide and many forum post on time slicing, but this remains the most confusing part about touchdesigner for me.

I have midi input with endless rotary encoders.

When I rotate it, every x degrees of rotation it will send a midi event with the direction (left or right) as value 1 or 127. I’m trying to build a counter whose value I can in- or decrease by turning the knob left or right. Doing + or - 1 every midi event.

First I tried the Midi in CHOP, but since the value remains the same across the events this didn’t seem usable, even though I could see the green lines cook on every individual event.

Now I’m trying the Midi in DAT, but I can’t manage to turn these events into something I can use in CHOP land. I can see the line moving forward in the Dat To every time I turn the knob, but how to turn this into a working counter is a mystery to me.

I tried the count, lag, speed and trigger chop but none seem to help with what im intending.

Any pointing in the right direction would be greatly appreciated!!! <3

Screen Recording 2025-11-27 at 15.12.28 (1)

Hi @dpkn,

in this case make use of the callbacks of the Midi In DAT. Luckily the Count CHOP has seen a very nice usability improvement in the latest builds (2025.30k) and now comes with a Count Up and a Count Down pulse parameter. With this the callback of the Midi In DAT would have to look something like this:

"""
MIDI In DAT Callbacks

me - this DAT
"""


def onReceiveMIDI(dat: midiinDAT, rowIndex: int, message: str, channel: int,
                  index: int, value: int, input: bool, byteData: bytes):

	# make sure this is for the right channel and note
	if channel == 5 and index == 22:
		countOp = op('count1')
		if value == 1:
			countOp.par.countdown.pulse()
		else:
			countOp.par.countup.pulse()
	return

About Time Slicing: your task here is not really related to the idea of Time Slicing which becomes an important feature when frames are dropped and therefor operators, like a Filter CHOP, would potentially produce stepped outputs or other CHOPs would potentially miss events.

Hope this helps
Markus