Making Wiimote axis useable
Hi everyone,
I am currently developing an application that contains a variety of applications that uses the motions a Wiimote. Im using the wii.tk object which is excellent. I am developing this project for a special needs school, therefore I will be encapsulating (at a later stage) the remote into a ball, possibly foam and the size of a football, so it can be rolled along the floor, handled, and shook.
I have managed so far to take the X,Y,Z axis and create a mean value to when the remote is shook then it plays an audio file. However the overall aim is to take the X,Y,Z value i.e. when the ball is rolled, and take those values and be able to scroll through a piece of audio. The idea is that the when the Wiimote is rolled (inside this ball), the faster the ball rolls, the faster it will scroll through a piece of audio. I just cant seem to understand how to take the data and make it useable. I don't have jitter unfortunately so I cant use those objects. I hope I have explained myself clearly enough :)
Any help on this will be greatly apreciated. I just need to get over this first hurdle.
Thanks again,
Nick
Hi Nick,
Do you have the separate X, Y, Z values coming in from the Wii remote?
Firstly, you will need to perform some type of filtering on the values so as to gain more control over the parameters. You will need to assign a range and interval for sampling of the input values, there are several methods for doing this.
Secondly for greater control over the audio file it is not possible to use the [sfplay~] object which I assume you are using now? You will need to use a buffer, which is the [buffer~] object with optional arguments specifying the name, size of the buffer, then the number of channels. Apply a "read" message to the left inlet to load a file into the buffer, then double click the object to visualise the waveform in a separate window, there are many other functions available with this.
Finally you will need to use an advanced method of playback for the buffer, which can be achieved by using the [groove~] object. Arguments specify name (matches set buffer) and number of channels. This object allows manipulation of the sound file which is loaded into the buffer. See the help file for [groove~] for more information.
Hope this helps,
Regards,
1CS Support Team,
support@1stcreativesolutions.co.uk
www.1stcreativesolutions.co.uk
Hi 1CS,
Many thanks for your reply. This is very helpful, thankyou. I was going to impliment the Groove object in the first place as you stated, it has better control and more features.
The Wiimote object gives you X,Y and Z as individual channels and have managed to take the three individual values. I am just a little unsure about filtering or scaling, thats all. I have used the scale object before but with limited success.
If I applied a filter to each slider for example, would this lower that slight unpredicatble glitch like nature of the sensor, as when you put the Wiimote down it still moves.
I think for me the difficulty lies in the filtering and usability of the data.
Thankyou for your help, much appreciated.
Regards,
Nick