TouchOSC Pushbutton Sample&Hold

gtoledo3's picture

I was making a grid of buttons with TouchOSC yesterday, and wanted to set it up so that each button had a value assigned to it, and when someone pushes the button for the value to stick until they push the next button. So, if button 1 is pressed, it delivers a 1, then if button 5 is pressed it delivers a 5, for example - with only one value allowed to be generated in the button grid.

When I was looking through the options, there are pushbutton types that generate a value only when your finger is on the button, and then toggle types that you push on, then off.

The "problem" for using the toggle type for me, was that you could have multiple buttons depressed, whereas I needed the grid of buttons to only be able to deliver one output value - the last pressed.

I started fiddling around with some math patches and sample&holds, and realized I'd started recreating a part of smokris's VCR composition.

The solution is pretty simple - use the pushbuttons, and multiple each button value by the ID # that the button is supposed to have. Then, sum them all. Connect the output of the summing to the value input on a Sample & Hold. That's it! :-) I'm attaching a picture to show the setup.

OSC Web Dance 3 (Composition by Prack)

Author: Prack
Date: 2012.01.05
Compatibility: 10.5, 10.6
Required plugins:
Audio Tools, gl tools, qcOSC

OSC Web Dance 3 by PrackVJ aka Marcos Prack

With this comp you can control a differents meshes. You can rotate, change colors, and make some funny things. You need an IPod Touch, or an IPad running TouchOSC app, and some more things.

You need to download the zip file, they have the .dae files, a readme file and the TouchOSC files.

You need to install some patches from Kineme: the Kineme Audio Tools and the Kineme GL Tools. Additionally you need to install the Hexler's qcOSC plugin, you can found it at

This is an excersise I made for my vjing session, you can use it, and modify it as you want. You can change the .dae files if you like too.

If you have any question you can write me to:

mprack at gmail dot com

I'm not an expert, so, the composition could be better, if you can improve it, please, send me your file, I like to learn from you. Thanks a lot, and thanks to the QC community.


TouchOSC with Quartz Composer

scalf's picture

Here is a simple video explaining how to connect TouchOSC with Quartz Composer.