i wondered if it's possible to use multiple [hid]'s in one patch?
i'm currently working on a patch where i want to use an old computermouse for controlling the dry/wet of some fx and an old keyboard as a footswitch. both are connected with the computer via an USB PS/2 adapter (something like http://ergopages.com/pix/ck/USBPS22.gif).
i try to get the data of the keyboard and the mouse using two [hid]'s: assigning the first one to open 6 (= port of external keyboard) and the second one to open 7 (= port of external mouse). now it appears that only one of the objects is able to get information: namely the one i assigned last.
does anyone got some experience w/ this kind of problem ?
or does anyone know a solution ?
btw: using Pd-extended 0.42.5 on OSX.
i have a hard time processing the data received by a mouse, maybe you can help me? I understand from the hid help file the mousedata is relative. So it should give us the amount of units it has moved since the last value was returned in axe X&Y.
so basically when the mouse stopped moving, in my understanding this value should be 0 or it shouldn't bang information at all. but when i connect an usb-mouse or use my internal trackpad, it keeps banging the last received input before i stopped moving the mouse. this is mostly a 1 or -1, but not always. it can be any value.
do you guys got an idea to filter this datanoise away? my first thought was to install a sort a counter connected to a gate so after an amount of the same values, the gate would block the received data. but this would basically say you can't move in a constant speed, or otherwhise the data would be zero.
or do i maybe interpret the data completely wrong ?
thanks a lot
that's a pity. it's cool that you found out about that weird quirk. suppose i will find something else to get around it . i'm using mac os x.
a ha, that explains the [moses 1]! really strange that different operating systems are reacting differently.
thanks anyway for the effort, stutter
really appreciated it!
thanks for your response. at first sight the patch doesn't work on my system. now i'm trying to figure out what's going on inside detect_motion and checking your theory of the information bursts. i wondered if you could help me with some questions about it.
[timer] detects the amount of time between the incoming messages. so normally when doing nothing, the messages are received at the polling rate (in this case being 25). when moving with the mouse i detected that this number increased sometimes, but not always, in a range of 50 - 200. is this what you ment with the bursts of messages? shouldn't it then always increase when moving the mouse instead of increasing sometimes?
what i also don't understand is that there is this [moses 1] after [timer], because isn't the output of timer always > 1?
shouldn't it be
etc... or something like that ?
thanks a lot lead and stutter,
lead: great patch. had something similar, but more complex. still a newbie in pd . but the patch doesn't solve the problem when the mouse is moving in a continuous speed.
stutter: nice to know that i'm not the only one trying to solve this puzzle. you got some good ideas. will try to implement them in my patch too. looking forward to any breakthroughs.
jes, i'm using [hid] connected to an external mechanical mouse.
[change] would indeed filter out the repeated values.
but when moving the mouse in a continuous speed,
the X and Y outputs would be a stream of repeated
values too, so [change] would filter those values out
also. and i don't want that
here is a video of the project i'm currently working on.
the strings are attached to the X and Y axis of a mechanical mice.
here i worked with [cyclone/MouseState] (the right arm, but the range
was too small) and with [hid]'s raw data (the left arm, because i didn't
know how to process it).
first i would like to thank you for the feedback
i heard of MouseState before and used it already. it works really smoothly, but it only gives me the absolute and relative value of the cursor. so it is restricted to the boundaries of my screen. i would like to use the information received by the USB-mouse, instead of the GUI-information.
So i thought of using HID; but then i encounter my problem.
is there an object to detect if a physical object gives information?
so i could use it for creating a gate to filter al the white noise?
thanks a lot