Butterfly Effect(SuHwee & ZiFeng) Week 13 Final Milestone


Through this disastrous week, we focused on getting the the final batch of butterflies for the presentation, writing the max patch, Arduino code and also purchased a 19 inch monitor which got ruined by a single drop of raindrop and also, setting up the “habitat” for the butterflies in the acrylic case we made.

As for the butterflies, since we released all of our 8 butterflies last week due to the agreement with Mr Foo, the conservationist, we have 0 butterflies on hand for our project and as he agreed with us previously, he would give us in batches, and this week he direct me to a school teacher Sarah, who gave me two of the Leopard Lacewing Chrysalis. Since we know two is not enough, we decided to try our luck to catch some more butterflies a few days before the presentation just make sure they will be at least visually attractive for the final submission.

The Deformed Leopard Lacewing with one wing much smaller than the other.

Both of the butterfly is female although we hope for them to be male which are more visually appealing. however, one of the two butterflies which Sarah gave us have deformed wings and is not able to fly very well. it is still relatively healthy other than that.

And we went to Yewtee park on 3 separate occasion, on the first occasion, we bought a short net which was unable to reach the butterfly and therefore we bought a long extension for the net the following day.

Problem: Not enough butterfly.
Solution: Catch them


During this week, we also use code that allows to use jit.blob and jit.op @absdiff to prepend in the colour in the frame and enable us to locate the center of the blob, the problem here is that we can only unpack the multiple blobs into one XYZ value. Therefore we looked online and tried many different patches and finally came to using [jit.spill @plane(number)] -> [unpack 0. 0. 0.] to unpack many blobs into many XYZ coordinate. hence enable us to track multiple blob’s location at once.

using those cordinate, we also followed a tutorial that taught us how to use jit.lcd, we use the cordinate from the blob centroid to draw the lines in the lcd, we also use timer function to change the RGB value of the lines created in the lcd


up till here, we found out from Prof LPD that we we cant or it is very hard to map many point that attract the particle system as they only “move to destination” but not really is “attracted to” the point. so we decided to find another patch to learn and build our patch on.


This is a screen shot of the final patch we used for the presentation.
just a day before the presentation, we decided not to use the particle system as we think it is not that more is better, it is the effect that we wanted that is important. basically, we found a way to change the camera to using external camera that we have(vdev/input), since the external web-camera is longer in the width, we decide to let it lie by the side and rotate the orientation and scale it accordingly to the screen size we have. (jit.rota) and also changed the original patch from a standard (importmovie colorswatch.png bang) to (qmetro 500 -> jit.noise 3 char 6 6) which produce a new 6 by 6 random RGB boxes every half a second and thus changing the effect of the fluid effect.

Next after we solved the fluid effect, we build the very simple code that uses (serial c 9600) to send a integer over to Arduino which is linked to a relay that controls the 220v table fan which turns off after 8000 ms

And that is roughly it for the codes that we wrote this week, we also settled the logistic part like the screen with a self made stand for the visual generated to be place under the butterfly casing, the flower for the butterfly to stay onto while adding to the overall visual appeal for the whole project, lastly we searched online for the species of butterflies we have and made a information about our project for the butterflies.

We purchased the second hand monitor on carousell and it was working, WAS. and then on the way to school while raining, a drip of rain water goes into the system and killing it once we turn it on. talk about unluckyness. so now, we’ve got a spoilt monitor screen, and we still need one so we searched online for more monitor, in the end we borrowed a 22inch monitor from the IT department which is slightly oversize but great nonetheless.

While I was doing this, SuHwee was arranging the flower carefully, although it may look easy to do so, having the balance and the need to consider the size and the butterfly is quite hard.

we put the screen and the butterfly box together, did up the information board to it and transferred the butterflies in, tore off the paper protecting the acrylic and we’re done!

We will update/upload the video for our project soon!

Butterfly Effect(SuHwee & ZiFeng) Week 12 Milestone

This is the first time I’ve seen the butterfly emerged from chrysalis, these chrysalis of lime butterfly were given to us by our friend YaYu.



These 3 different species were given by the conservationist Mr.Foo, there were a total of 7 Chrysalis, 5 Leopard Lacewing, 1 Plain Tiger and 1 Lemon Emigrant. All 5 Leopard Lacewing had emerged this week and the other 2 will be coming out tonight or tomorrow morning.

Did a lot of butterfly related task this week which includes getting the chrysalis from Mr.Foo, setting the chrysalis up for documentation, waking up way too early to get the video of the eclosing process. laser cutting and build the final casing for the butterfly and presentation, Researched on what butterfly eats and how to feed them. buying Curry leaves from supermarket with vegetables for the butterfly to live with. And tried to get a second hand monitor screen from an online seller, the seller did not turn up and did not reply. Our 160 degree wide angle web camera had arrived from china and we will test it out really soon with Max.

While I was writing this post, The Lemon Emigrant eclosed! (and I diden see it nor video it!) now that the Lemon Emigrant came out, the last one that will be coming out will be the Plain Tiger.

Also for coding, we further researched about our max patch and spend most of our time studying and trying to merge/tweak the standard patch as well as what other people did for their project, some of the patch were too hard to understand until today’s lesson when LPD explained most of what the patch does then we understands(slightly) what the patch does.

From this week to next week we will focus mainly on the max patch and get something that could roughly work in terms of butterfly/motion tracking, visual generation and output to control a real life appliance using UDP or the wireless I-Cube X.


Butterfly Effect(SuHwee & ZiFeng) Week 11 Milestone

Planned Milestone for Week 10-11:

  • Write up a rough Max Patch for Motion tracking using camera and particle/visual generation from the point/blob that was tracked by the motion tracking.
  • Catch more caterpillar/cocoon from different area and see how long they need to become butterfly + research more about butterfly.

Actual Milestone Done in Week 10 -11

  • Purchased the materials and built box for the project using acrylic.
  • Purchased a mini webcam and tested it with Max, the viewing angle is
  • Tried to find caterpillar off the wild and also met two community gardener in different location who said there wasn’t any caterpillar seen recently.
  • Managed to get two chrysalis of butterfly from friend.
  • Managed to talk to a conservationist in Singapore and he agreed to give us some chrysalis of butterfly of different species for our project.
  • searched for particle system and tutorials for Max and had been trying to make them work.


We went to Dama in Ubi to purchase our acrylic to build the box for this project, the box have the length of 2.5ft by 1ft by 1( 76 x 30 x 30 cm ) and net will be attached to one side of the box for ventilation.

Helping the Chrysalis to shift the house from the insect container to a proper container for better documentation process and prepare for the timelapse during the emerging process.

The lid of the container was replaced with a net hotglued in place for proper ventilation for the Crysalis.

Also, I’ve joint a butterfly community in singapore and tried to ask for people to help me to get caterpillars of chrysalis of butterfly, and Mr Foo, a conservationist in Singapore agreed to give us some chrysalis for the project!


Butterfly Effect(SuHwee & ZiFeng) Week 10 Milestone

Our Project will take the idea of “The Butterfly Effect”

Basically for this project, we will be having many butterflies in a container with a habitat that allows them to survive for weeks, the butterflies will be used as an input for the camera’s tracking system and every time a butterfly fly over certain area, a visual will be generated through Max MSP.

The whole container will be placed on a specially made table with a projector in the table and a square hole directly below the container of butterflies, the bottom of the container will be opaque and the projector in the table will be projecting up to the bottom of the container through the square hole, making a screen like appearance at the base of the container.

For our project, we need to have real butterflies, after our research, we found out that Oh’ Farms will be selling caterpillars, on Saturday, we went there trying to purchase the caterpillars, however they were sold out and said the primary school purchased all of their caterpillars and they will restock in 2 weeks time, the shopkeeper also said that it will take around a month for the caterpillars to fully grow into butterfly, so unless we got the caterpillar this week, it will be not possible for us to have butterfly for the submission. So… Alternative plan is to go catch caterpillars/cocoon of butterfly ourself
This is Stick insect Oh’ Farms sell, I think its kind of interesting.

As for the butterfly, I think the best way is to find for butterfly in the park and instead of catching the butterfly straight, it will be easier to catch caterpillar or cocoon, therefore we went to Parks and look for butterfly, since there is butterfly of the species there, there will be its caterpillar nearby.
Acraea violae (Tawny Coster)

Eurema hecabe contubernalis (Common Grass Yellow)

Zizula hylax pygmaea (Pygmy Grass Blue)

The above photo was taken in Yewtee Park, I also found 4 cocoon from the trees and bush there, it might be the cocoon of moth, but nonetheless, if it look like butterfly, it will work


For this week Milestone,

We’ve got our idea out, found where to find butterfly/cocoon/caterpillars and got ourself some cocoon to try wether it will become a moth or butterfly, we also purchased some cheap mini webcam from the web and will use it for our project.

our planned timeline for our project will be:

Week 10-11:

  • Write up a rough Max Patch for Motion tracking using camera and particle/visual generation from the point/blob that was tracked by the motion tracking.
  • Catch more caterpillar/cocoon from different area and see how long they need to become butterfly + research more about butterfly.

Week 11-12:

  • Build the Container for the butterfly and test the max patch within the container with fake butterfly mockup from paper.
  • Catch more caterpillar/cocoon from different area and see how long they need to become butterfly + how long could a butterfly survive + more butterfly research + get food for butterfly/caterpillar

Week 12-13:

  • refine the max patch to get it to work with a smooth flow and generate good visual worthy for submission
  • try to connect two computer together
  • learn how to output control real life electronics like a fan or light bulb, either straight from max or serial to Arduino.
  • Catch more caterpillar/cocoon from different area + get food for butterfly/caterpillar

Week 13-14:

  • further refine everything and make sure all component of the project works seamlessly.
  • Shoot the video for our final submission
  • Edit the video
  • Catch more caterpillar/cocoon from different area + get food for butterfly/caterpillar

Before 21st April:

upload everything we have onto OSS.