diff --git a/samples/user-interface/haptics/README.md b/samples/user-interface/haptics/README.md index 8bcef253..1d0c883c 100644 --- a/samples/user-interface/haptics/README.md +++ b/samples/user-interface/haptics/README.md @@ -56,7 +56,7 @@ animation has ended. ## Bounce -This example showcases the the PRIMITIVE_THUD as an example of using vibration +This example showcases the PRIMITIVE_THUD as an example of using vibration effects to simulate physical interactions. In the example the ball drops with multiple bounces, playing the primitive at a decreased intensity each time. @@ -79,6 +79,33 @@ to a looser spinning sensation. Screenshot of wobble effect. +### LavaBeats + +The `WaveformEnvelopeBuilder` is a powerful API to create complex haptics by +enabling the control of amplitude and frequency segments in a vibration. This +example demonstrates how to use this API to create a haptic sensation of +"liveliness". + +In the example, two biomarkers of a typical electrocardiogram (ECG) signal are +represented with vibration pulses of varying amplitudes and frequencies. The +first pulse represents the QRS complex of the ECG, which shows as a sharp peak +of high amplitude and short duration. The second pulse is the T wave, which has +lower amplitude, longer duration, and a smoother shape. + +The `WaveformEnvelopeBuilder` is used to construct various repetitions of these +two pulses separated by a fixed first-to-second pulse delay. The first pulse is +a chirp signal that starts at a low frequency and ends at a higher frequency +over a short duration. The second pulse is a single period of a low frequency +sinusoid. The two pulses are composed into a beat, and repeated several times +with delay in-between following a typical beats-per-minute (bpm) rate. The +result is a haptic effect that resembles a beating heart. + +LavaBeats also allows users to configure all the parameters of the effect to +emulate various beating patterns. It also displays a lava-lamp visualization +that beats at the same rhythm as the haptic pattern. + +Screenshot of the lavabeats example. + ## License ``` diff --git a/samples/user-interface/haptics/screenshots/lavabeats.gif b/samples/user-interface/haptics/screenshots/lavabeats.gif new file mode 100644 index 00000000..e2650a08 Binary files /dev/null and b/samples/user-interface/haptics/screenshots/lavabeats.gif differ