Measure pulse width


I have a step sequencer (8) that gives me a pulse via midi that I would like to make use of.
This would help me identify what step I am on.

the parameter is called “sense” and pulses with variable width 8 times and then starts over

How can I create a counter that makes each pulse a number between 1 and 8 depending on the width of the pulse?

Use the start of a high value of your signal to reset and start a Timer CHOP, and the start of a low value to stop it. You can use a CHOP Exec DAT for this (the onOffToOn and onOntoOff callbacks). After every Timer stop you can get the width of the pulse by reading the current value of the Timer CHOP.
Then, by using 8 blocks of Python if…else statements you can execute code based on the 8 different possible widths of your pulses.

See examples for CHOP Execute DAT and the Timer CHOP in Help ->Operator Snippets.

1 Like