Increase/decrease values using arrow keys with key/keyup function

Casey Moir's icon

How do you use [key] [keyup] to have a keypress trigger a number to increase/decrease with the key-release stopping it? I've used [key] [keyup] previously to trigger record/record stop but wish to now use it to trigger a metro tempo float where pressing the up arrow (on computer keyboard) makes it continuously increase in value, and the down arrow makes it decrease. I can only get it to increase one step per keypress at a time, but want to be able to hold an arrow key down and have the float keep increasing/decreasing until I release it.

Holland Hopson's icon

Here's a solution using the "inc" and "dec" messages to the [incdec] object.

Max Patch
Copy patch and select New From Clipboard in Max.

Roman Thilenius's icon


non-GUI toggle: t 1 behind key and t 0 behind keydown, followed by a change.

for the metros of your incdec, that is.


mine can haz stepsize and predelay:


Source Audio's icon

with so many objects one can add speed control

Roman Thilenius's icon

green desert version only can haz fixed speed via argument. i haz found it sufficient for the majority of controls (basically numberboxes or sliders)

but actually i haz built that in 1967 to have a float version(!)

Roman Thilenius's icon


moment, source audio, you are using indec? indec has that built-in.

green desert IS indec.