Final project: fetal movement visualization

Here is a link to the serial sketch.

I finally got my sketch working in serial with my piezoresistive pressure matrix. My success was in no small part a result of the help of my friend Jeremy Baron. Jeremy and I worked together at Blue Moon Fish at the Grand Army Plaza Greenmarket selling fish on Saturdays for a couple years. He’s a talented coder, a good friend, and I couldn’t gotten serial communication to work with this sensor in any meaningful way without him.

This is an actual recording of a live baby kick visualized through my p5 program

The sensor sends a 40-point array of data in serial to the sketch. That part is easy. The hard part is making sense of that string in a way that activates the colorful ripples in the sketch in a meaningful way. The sensor has 5 columns and 8 rows. That was articulated by the mathematical concept of:

let sensorX = int(i / 5); let sensorY = int(i % 5);

The other tricky part was getting creating a variable that keeps track of time, so the program knows how often to pay attention to whether or not anything has happened with the sensor. It all sounds simple, but actually implementing it was complicated — especially under the duress of impending finals and the Winter Show.

The sketch still has some problems. When it came time to play test it on my wife’s belly, the ripples would spontaneously disappear after 5-45 seconds, and then sometimes reappear equally spontaneously. I talked to Dan Shiffman about it, and he suggests that this may just be a limitation of the p5 web editor, and that I may have more success off-lining and running it in Processing or some other offline editor.

The other problem is that the audio still gets overwhelmed when too many oscillators are made. I tried porting my audio functionality over to the Class I created for the visualization. My theory is that if the oscillators lived as objects in tandem with my ripples, and that if I kept that array to a maximum of ten, then it would actually delete oscillators once they exceeded ten iterations and thus negate the glitches. This would probably solve the problem, but I didn’t quite succeed. This version has other problems. Please feel free to take a look and tell me where I went wrong.

On a personal note, I enjoyed my introduction to computational media, and my introduction to JavaScript a great deal. I’m not entirely sure to what end I will use this knowledge, but I enjoy doing it, so I intend to continue in this vein. Next semester I’m taking Dan Shiffman’s Nature of Code, so stay tuned for my adventures in JavaScript.