{"id":857,"date":"2020-10-16T20:29:05","date_gmt":"2020-10-17T00:29:05","guid":{"rendered":"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/?p=857"},"modified":"2020-10-16T20:29:05","modified_gmt":"2020-10-17T00:29:05","slug":"infinity-icosahedron-final-documentation","status":"publish","type":"post","link":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/cctulig\/infinity-icosahedron-final-documentation\/","title":{"rendered":"Infinity Icosahedron &#8211; Final Documentation"},"content":{"rendered":"\n<p>My initial inspiration for this project idea came from a variety of sources. The idea started from being intrigued by the effects of light inside infinity mirrors and infinity cubes from our initial light artist and general research. I then wanted to personalize the project by both changing the shape to be the same as a twenty sided die (d20) used in Dungeons and Dragons as well as by programming it to be a music visualizer using my prior experience of Arduinos.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The project itself was challenging both mechanically and programmatically and as a result went through an iterative design process along the way. The mechanical design and assembly of the project was definitely the area I was least familiar with and where I encountered the most setbacks and revisions. However in the end I was able to successfully complete my project at a state that I am very happy with while also learning Blender and gaining more experience in 3D printer, laser cutting, soldering, and Arduino programming. Images and references to the creation of this project can be found at the end of this blogpost.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"394\" height=\"896\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/rgb.png\" alt=\"\" class=\"wp-image-878\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/rgb.png 394w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/rgb-352x800.png 352w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/rgb-132x300.png 132w\" sizes=\"auto, (max-width: 394px) 100vw, 394px\" \/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>For my final documentation, I decided to present it in a video format as the project is meant to be viewed as a dynamic piece reacting to music. The video itself consists of a mash of 3 songs filmed at different angles. It was difficult to find the right balance between lowering the contrast to decrease the LED glare on the camera versus keeping the normal contrast to not lose the contrast between the different LED colors. So I ended up playing with different contrast levels for different shots. I found the close up shots on the second song looked really cool and definitely came out the best on the camera. You can see the final video bellow, which is a mix of Flight by Tristam &amp; Braken, Take Over by Jeremy McKinnon, and To The Stars by Braken.<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"jetpack-video-wrapper\"><iframe loading=\"lazy\" title=\"Light Art Infinity Icosahedron - Final\" width=\"1000\" height=\"563\" src=\"https:\/\/www.youtube.com\/embed\/cgdjvjnndvo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Other Images:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1008\" height=\"756\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_6772.jpg\" alt=\"\" class=\"wp-image-879\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_6772.jpg 1008w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_6772-800x600.jpg 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_6772-768x576.jpg 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_6772-400x300.jpg 400w\" sizes=\"auto, (max-width: 1008px) 100vw, 1008px\" \/><figcaption>Completed infinity icosahedron. Original inspiration from an infinity cube tutorial on Adafruit: https:\/\/learn.adafruit.com\/neopixel-infinity-cube<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"864\" height=\"540\" src=\"http:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/image.png\" alt=\"\" class=\"wp-image-657\" srcset=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/image.png 864w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/image-800x500.png 800w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/image-768x480.png 768w, https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/image-480x300.png 480w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><figcaption>3D CAD Model made in Blender<\/figcaption><\/figure>\n\n\n\n<p>My final Arduino code I used for this project. I made use of the Arduino.h, FastLED.h, and math.h libraries:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;Arduino.h&gt;\n#include &lt;FastLED.h&gt;\n#include &lt;math.h&gt;\n\n#define LED_PIN 7\n#define NUM_LEDS 117\n#define SPECTRUM_LENGTH 6\n\nint RED&#091;3] = {255, 0, 0};\nint GREEN&#091;3] = {0, 255, 0};\nint BLUE&#091;3] = {0, 0, 255};\nint ORANGE&#091;3] = {255, 100, 0};\nint PURPLE&#091;3] = {100, 0, 255};\nint YELLOW&#091;3] = {255, 255, 0};\n\nCRGB leds&#091;NUM_LEDS];\n\nbyte first = 1;\nint band&#091;18];\nint scale = 1;\nint color&#091;3] = {RED&#091;0], RED&#091;1], RED&#091;2]};\nint rnd&#091;18] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};\n\n\nvoid set_band (int b0, int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8, \n              int b9, int b10, int b11, int b12, int b13, int b14, int b15, int b16, int b17) {\n  band&#091;0] = b0;\n  band&#091;1] = b1;\n  band&#091;2] = b2;\n  band&#091;3] = b3;\n  band&#091;4] = b4;\n  band&#091;5] = b5;\n  band&#091;6] = b6;\n  band&#091;7] = b7;\n  band&#091;8] = b8;\n  band&#091;9] = b9;\n  band&#091;10] = b10;\n  band&#091;11] = b11;\n  band&#091;12] = b12;\n  band&#091;13] = b13;\n  band&#091;14] = b14;\n  band&#091;15] = b15;\n  band&#091;16] = b16;\n  band&#091;17] = b17;\n}\n\nvoid setupSpectrum() {\n  \/\/Setup pins to drive the spectrum analyzer. It needs RESET and STROBE pins.\n  pinMode(5, OUTPUT);\n  pinMode(4, OUTPUT);\n\n  \/\/Init spectrum analyzer\n  digitalWrite(4,LOW);  \/\/pin 4 is strobe on shield\n  digitalWrite(5,HIGH); \/\/pin 5 is RESET on the shield\n  digitalWrite(4,HIGH);\n  digitalWrite(4,LOW);\n  digitalWrite(5,LOW);\n}\n\nvoid setup() {\n  Serial.begin(9600);\n  Serial.println(\"Hello World!\");\n\n  setupSpectrum();\n\n  FastLED.addLeds&lt;WS2812, LED_PIN, GRB&gt;(leds, NUM_LEDS);\n}\n\nint getLoudest(int spectrum&#091;SPECTRUM_LENGTH]) {\n  byte loudestBand = 0;\n  int  loudestValue = -1;\n\n  for(byte band = 0; band &lt; SPECTRUM_LENGTH; band++) {\n    if (spectrum&#091;band] &gt; loudestValue) {\n      loudestBand = band;\n      loudestValue = spectrum&#091;band];\n    }\n  }\n  return loudestBand;\n}\n\nvoid assignColor(int c&#091;3]) {\n  color&#091;0] = c&#091;0];\n  color&#091;1] = c&#091;1];\n  color&#091;2] = c&#091;2];\n}\n\nvoid visualizeLoudest(int loudest) {\n  FastLED.clear();\n\n  switch (loudest)\n  {\n  case 0:\n    assignColor(ORANGE);\n    break;\n  case 1:\n    assignColor(BLUE);\n    break;\n  case 2:\n    assignColor(RED);\n    break;\n  case 3:\n    assignColor(GREEN);\n    break;\n  case 4:\n    assignColor(PURPLE);\n    break;\n  case 5:\n    assignColor(YELLOW);\n    break;\n  case 6:\n    assignColor(YELLOW);\n    break;\n  }\n}\n\nint r() {\n  return ((int)random(0, 2)) * 2;\n}\n\nvoid visualizeBand(float value, float max_val, float min_val) {\n\n  int diff = round((value - min_val) \/ (max_val - min_val) * 10);\n  if (diff &gt; 10) diff = 10;\n\n  scale = 13 - diff;\n\n  switch (diff)\n  {\n  case 0:\n    set_band(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n    break;\n  case 1:\n    set_band(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);\n    break;\n  case 2:\n    set_band(0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0);\n    break;\n  case 3:\n    set_band(0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0);\n    break;\n  case 4:\n    set_band(0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0);\n    break;\n  case 5:\n    set_band(0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0);\n    break;\n  case 6:\n    set_band(0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0);\n    break;\n  case 7:\n    set_band(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0);\n    break;\n  case 8:\n    set_band(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0);\n    break;\n  case 9:\n    set_band(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);\n    break;\n  case 10:\n    if(millis() % 3 == 0) {\n      rnd&#091;0] = r(); rnd&#091;1] = r(); rnd&#091;2] = r(); rnd&#091;3] = r(); rnd&#091;4] = r(); rnd&#091;5] = r(); rnd&#091;6] = r(); rnd&#091;7] = r(); rnd&#091;8] = r(); rnd&#091;9] = r(); rnd&#091;10] = r(); rnd&#091;11] = r(); rnd&#091;12] = r(); rnd&#091;13] = r(); rnd&#091;14] = r(); rnd&#091;15] = r(); rnd&#091;16] = r(); rnd&#091;17] = r();\n    }\n    set_band(rnd&#091;0], rnd&#091;1], rnd&#091;2], rnd&#091;3], rnd&#091;4], rnd&#091;5], rnd&#091;6], rnd&#091;7], rnd&#091;8], rnd&#091;9], rnd&#091;10], rnd&#091;11], rnd&#091;12], rnd&#091;13], rnd&#091;14], rnd&#091;15], rnd&#091;16], rnd&#091;17]);\n    break;\n  default:\n    set_band(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n    break;\n  }\n  \n}\n\nvoid lightLED(int pos, int mode) {\n  switch (mode)\n  {\n  case 0:\n    leds&#091;pos] = CRGB(0, 0, 0);\n    break;\n  case 1:\n    leds&#091;pos] = CRGB(color&#091;0] \/ scale, color&#091;1] \/ scale, color&#091;2] \/ scale);\n    break;\n  case 2:\n    leds&#091;pos] = CRGB(color&#091;0], color&#091;1], color&#091;2]);\n    break;\n  default:\n    leds&#091;pos] = CRGB(0, 0, 0);\n    break;\n  }\n}\n\nvoid visualizeSpectrum(int spectrum&#091;SPECTRUM_LENGTH], int start) {\n  for (int i = 0; i &lt; SPECTRUM_LENGTH; i++) {\n    visualizeBand((float)spectrum&#091;i], (float)1000, (float)50);\n    for (int pos = 0; pos &lt; 18; pos ++) {\n      lightLED(start + pos + i * 18, band&#091;pos]);\n    }\n  }\n}\n\nvoid printSpectrum(int spectrum&#091;SPECTRUM_LENGTH]) {\n  for (int i = 0; i &lt; SPECTRUM_LENGTH; i++) {\n    Serial.print(spectrum&#091;i]);\n    Serial.print(\"\\t\");\n  }\n  Serial.println(\"\");\n}\n\n\/\/ Function to read 7 band equalizers \nvoid dance() {\n  \/\/ Spectrum analyzer read values will be kept here.\n  int middle&#091;7]; \/\/ Band 0 = Lowest Frequencies. \n  int right&#091;7];\n  int left&#091;7];\n\n  \/\/ Get the reading from each of 7 channels each (left and right)\n  byte Band;\n  for (Band=0;Band &lt;7; Band++) {\n    \/\/ left\n    left&#091;Band] = analogRead(0);\n\n    \/\/ right\n    right&#091;Band] = analogRead(1);\n\n    \/\/ middle\n    middle&#091;Band] = (left&#091;Band] + right&#091;Band]) \/ 2;\n\n    digitalWrite(4,HIGH);  \/\/Strobe pin on the shield\n    delay(2);\n    digitalWrite(4,LOW);\n  }\n\n  visualizeLoudest(getLoudest(middle));\n\n  visualizeSpectrum(middle, 0);\n\n  \/\/ printSpectrum(middle);\n\n  FastLED.show();\n}\n\nvoid loop() {\n  dance();\n  delay(25);\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>My initial inspiration for this project idea came from a variety of sources. The idea started from being intrigued by the effects of light inside infinity mirrors and infinity cubes from our initial light artist and general research. I then wanted to personalize the project by both changing the shape to be the same as&#8230; <\/p>\n<div class=\"link-more\"><a href=\"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/cctulig\/infinity-icosahedron-final-documentation\/\">Read More<\/a><\/div>\n","protected":false},"author":165,"featured_media":882,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"cybocfi_hide_featured_image":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-857","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_featured_media_url":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-content\/uploads\/sites\/13\/2020\/10\/IMG_8463-scaled.jpg","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/posts\/857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/users\/165"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/comments?post=857"}],"version-history":[{"count":3,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/posts\/857\/revisions"}],"predecessor-version":[{"id":883,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/posts\/857\/revisions\/883"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/media\/882"}],"wp:attachment":[{"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/media?parent=857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/categories?post=857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshuarosenstock.com\/teaching\/lightart-a20\/wp-json\/wp\/v2\/tags?post=857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}