[PD] Creating an Automatic Offset Adjuster

Sebastian Valenzuela svalenzuelamusic at gmail.com
Mon Dec 3 05:41:43 CET 2012


I'm creating a patch that will adjust the volume of an incoming signal. It
is controlled by the Yaw of a wii remote connected to my laptop via
bluetooth ("OSCulator" app), but i've found that the data from the remote's
gyroscope is constantly changing. For example, i'll turn the remote so the
yaw turns the volume up 100%, then i'll move it around, but when I come
back to this same position the yaw/volume will be 75% up.

To fix this I've created a subpatch that stores the raw Yaw data into an
array and uses the min/max of that array to adjust the range of the yaw
data controlling the volume. The problem is that i've set the array to
write over itself after the 99th index... so the min/max values are only
stored for a few seconds before being over-written. This auto-offset
adjuster works great ONLY for those few seconds where the array isn't

Does anyone know the best way of doing this?

I've attached the subpatch. Its hot inlet is where i send my raw gyroscope
data, the cold inlet is used to turn on/off the patch, and the outlet is
the scaled data (between 0-1) which controls volume.

Sorry for the long message, thank you for your time.

Sebastian Ignacio Valenzuela Rojas
Composer - Performer
youtube.com/svalenzuelamusic <http://www.youtube.com/svalenzuelamusic>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121202/566fdd48/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: auto_offset.pd
Type: application/octet-stream
Size: 2479 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20121202/566fdd48/attachment.obj>

More information about the Pd-list mailing list