My motivation for this iteration was to 1) create an intuitive and haptic method to control volume and 2) setup our system to work separately and then later combine easily. My approach for 1) was to setup a physical string apparatus as a reference to recreate its plucking feel on the Haply; this approach was inspired by Lab 1 and 2. For 2), my approach was to restructure the code to be modular and loosely coupled. I used an Object-Oriented strategy with a Haply class responsible for communicating to the Haply. In this class's constructor, the user passes a Model instance. I had each teammate do their work in their own model child class that would inherit from this Model. That way, it was easy to swap and add different models to the Haply. I setup the code so it would be easy to test with either one or both Haplys. The outcome of this structure was faster development because of less debugging time; it was easy to merge our code together in the end and test everything with minimal changes.
The commented code on the left shows the Pure Data file from the previous iteration which I simplified and added comments to. We decided to focus more on the Haply side of development so I kept the sound rendering minimal. We will develop this sound file in the next iteration through the addition of timbre.
Haptic Rendering: PullingThe left video shows haptic force with volume control for the right Haply. As the user pulls downwards, the volume increases and the Haply provides resistance upwards. This produces a pulling sensation; I associated the metaphor of opening a valve under tension to release air. I based this force on the spring equation with the volume as a function of its displacement from from its resting position (0 force).
Haptic Rendering: StringThe left video shows the right Haply producing the feeling of plucking a string, through visuals and haptics. I explored having the string horizontal instead of vertical like in the previous example, but I felt vertical to be more natural. I learned this layout depends on the type of haptic experience, a string might feel most natural vertically, while a pulling could be horizontal. In close proximity pushing against the string, I modelled the force response similar to a spring, but past a threshold distance away from the string's center (or "breaking point") I removed the force suddenly, thus creating a plucking effect. I varied this threshold distance as a function of velocity, the faster (or harder) the user plucked, the smaller the distance. I felt this corresponded to the actual variation of plucking depending on the speed or force (I used velocity as a proxy for force) the user plucks the string.
I found one very important aspect of making the string plucking feel realistic was adding a subtle vibration force (as a function of time in a sine function) at the moment after the pluck, which decayed to 0 in less than a second. This was a very small, almost imperceptible addition that I felt made a huge difference in terms of realism for the haptics (feeling a "buzz") and visually (seeing the string oscillate).