Collision detection and state change with Leap Motion and Max/MSP.
Second version adding musical finger-painting during the state change.
The 3rd version features a “lack of hand motion” detector which, along with collision detection, fades sounds and triggers state changes.
The non-activity detector is from a Max patch by Mattyo. The spectral filter is from a Max patch by Katja Vetter. In the filter the X,Y, and Z position of hands control number-of-bands, position, and peak width.
As an exercise, I tried to make something like Bloom, using Leap Motion. With your eyes closed you can accurately position your hand at the level of eyes, shoulders, hips, etc., And you can quickly move to a point directly outward from your nose, or shoulders. This is the basis of sobriety tests.
The interface, works with a hand motion like sprinkling seeds. Every time you open your hand, it triggers a note based on the height of your hand. It also triggers one of the “Bloom” circles at the XY position.
Here is a PID controller (proportional, integral, derivative) in Max that controls the pitch of an oscillator so you can watch how a process responds to various setting of PID coefficients. It features an external perturbance generator (ie., noise maker) to check how fast the system can adjust and continue.
Tried using fiddle~ for frequency detection (as the sensor input) but it provides faulty data below about 200hz – and that totally messes up the PID. so I am just using the actually frequency being used to set the oscillator as the response sensor.
update: Tristan Jehan wrote a Max external that extends lower frequency range of [fiddle~]. It would be worth trying for this patch.