• ### Computing the vector drawn on an xy pad in realtime

My objective is to create a xy pad in vanilla pure data (so I can use mobmuplat on my android). I would like to process the data so that when you swipe across the xy pad, pure data computes the vector between where your finger currently is and where it was recently (sort of a hazy definition but I am not sure the best way to do this yet).

The angle of the vector from the y axis would be mapped to the pitch of an oscillator and the magnitude of the vector mapped to the amplitude of the oscillator.

I hacked something together like this in processing, but it was full of glitches and pops. I just picked up puredata because I ran into mobmuplat and saw that getting an instrument controlled the way I describe above onto a phone might not be a pipedream for me.

I am trying to put together a pure data patch where readouts from an xy pad are fed into x and y tables/arrays with a clock incrementing the index of the tables at almost an audio rate. One pair of xy values are read out from the table along with another offset backwards by a set amount. My idea here is to get a really simple approximation of what the vector is that best describes the movement of a finger by just using two values, the current one and one in the past

I am posting here because I am not sure if I am approaching this the right way. Should I be using metronome or something else? Am I just going to melt pure data if I try to do this or am I just doing it horribly wrong?

Here is my currently terrible patch, forgive me if I am making some pretty fundamental errors but any help/advice would be super appreciated!
xy_mightwork_test.pd

• Posts 3 | Views 125
• @tylab This might help for getting the angle and radius (base at x= -1 y= -1 and total size -1 to +1 for x and y so you would need to scale your grid)........ vector.zip
Pretty sure it is all vanilla.
David.

• Thank you, with some fiddling I was able to get this working! I really appreciate the help and if I manage to build something halfway musical I will share.

Posts 3 | Views 125
Internal error.

Oops! Looks like something went wrong!