GMU:Max and I, Max and Me/Johannes Schneemann: Difference between revisions

From Medien Wiki
 
(76 intermediate revisions by the same user not shown)
Line 1: Line 1:
This page documents my work and experiments done during the "Max and I, Max and Me" course. Feel free to copy, but give attribution where appropriate.
This page documents my work and experiments done during the "Max and I, Max and Me" course. Feel free to copy, but give attribution where appropriate.


= other peoples work to investigate =
= ISS overhead =
* [https://www.uni-weimar.de/kunst-und-gestaltung/wiki/GMU:Max_and_the_World/F.Z._Ayg%C3%BCler F.Z._Aygüler AN EYE TRACKING EXPERIMENT]
* [https://www.uni-weimar.de/kunst-und-gestaltung/wiki/GMU:Max_and_the_World/WeiRu_Tai Does social distancing change the image of connections between friends, family and strangers? (includes patch walkthrough)]
* [https://www.uni-weimar.de/kunst-und-gestaltung/wiki/GMU:Max_and_the_World/Paulina_Magdalena_Chwala Paulina Magdalena Chwala (VR, OSC, Unity)]


[[File:ISS_overhead.png|400px]]


= homework 1: theremin =
[[File:people_in_space.mp3]]


I did build a simple [https://en.wikipedia.org/wiki/Theremin Theremin] to get to know the workflow with Max. Move your mouse cursor around to control the pitch and volume.
The International Space Station is currently the only extraterrestrial habitat for humans. It circles the earth approximately every 90 minutes and thus can look down on a vast planet. Humans on the other hand rarely look up and grasp what we accomplished and what we can reach for. This small installation tracks the International Space Station and emits a notification if it is above the place of exhibition. A handbell is rung and the names of the people currently in outer space are read out loud.


[[File:simple_mouse_theremin_screenshot.png|400px]]
The technical setup consists of a computer running Max and some means of notification like a bell or a speaker. The current position of the International Space Station is calculated from its orbital data and set into relation to the place of exhibition (e.g. Weimar). If the ISS is at a place which can be considered overhead the notification is triggered.  


[[:File:simple_mouse_theremin.maxpat]]
= implementation notes =
The underlying Max patch for tracking the ISS and playing audio looks like this:
[[File:ISS_overhead_patch.png|400px]]


Objects used:
[[File:ISS_overhead_2021-06-14.maxpat|Max patch]]
* [https://docs.cycling74.com/max8/refpages/loadbang loadbang]
* [https://docs.cycling74.com/max8/refpages/mousestate mousestate]
* [https://docs.cycling74.com/max8/refpages/cycle~ cycle~]
* [https://docs.cycling74.com/max8/refpages/slider slider]
* [https://docs.cycling74.com/max8/refpages/ezdac~ ezdac~]


= retrieve images from a camera =
This simple patch allows you to grab (still) images from the camera.


[[File:retrieve_images_from_camera.png|400px]]
Processing TLE files and orbital data was sidestepped by relying on [http://open-notify.org/Open-Notify-API/ISS-Location-Now/ open-notify.org] and processing [https://json.org/ JSON] data. The distance (on earth) to the city center of Weimar (at 50.979444, 11.329722) calculated using the euclidian distance as a metric. To simplify the math it is assumed that the world is flat and the [https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84 WGS 84] reference system is ignored. This is ok for small distances where the curvature of the earth does not result in too much of an error.
[[:File:2021-04-23_retrieve_images_from_camera_JS.maxpat]]


Objects used:
The Max patch was [https://docs.cycling74.com/max8/vignettes/standalone_building exported to a standalone application]. It is now run on a small computer board to reduce the complexity of the setup. The data about the ISS crew is scraped from the internet using custom written software.
* [https://docs.cycling74.com/max8/refpages/jit.grab jit.grab]


= color based movement tracker =
Lessons learned:
This movement tracker uses color as a marker for an object to follow. Hold the object in front of the camera an click on it to select an RGB value to track. The object color needs to be distinctly
* sometimes you can find an API for exactly the data you need
different from the background in order for this simple approach to work. This patch yields both a bounding box and its center point to process further.
* occasionally ignoring the material reality is feasible on very narrow bounds
* school math turned out to be useful


The main trick is to overlay the video display area (jit.pwindow) with a color picker (suckah) to get the color. A drop-down menu is added as a convenience function to select the input camera (e.g. an external one vs. the build-in device).
= references =
The rest is math.
* [https://en.wikipedia.org/wiki/International_Space_Station wikipedia: International Space Station]
 
* [https://en.wikipedia.org/wiki/Two-line_element_set wikipedia: two-line element set (TLE)]
[[File:color_based_movement_tracker.png|400px]]
* [https://nssdc.gsfc.nasa.gov/nmc/SpacecraftQuery.jsp NASA Space Science Data Coordinated Archive Master Catalog Search]
 
* [https://www.howmanypeopleareinspacerightnow.com/ how many people are in space right now?]
[[:File:2021-04-23_color_based_movement_tracker_JS.maxpat]]
* [[Max and I, Max and Me class notebook]]
 
The following objects are used
* [https://docs.cycling74.com/max8/refpages/metro metro] - steady pulse to grab images from camera
* [https://docs.cycling74.com/max8/refpages/jit.grab jit.grab] - actually grab an image from the camera upon a bang
* [https://docs.cycling74.com/max8/refpages/prepend prepend] - put a stored message in front of any input message
* [https://docs.cycling74.com/max8/refpages/umenu umenu] - a drop-down menu with selection
* [https://docs.cycling74.com/max8/refpages/jit.pwindow jit.pwindow] - a canvas to display the image from the camera
* [https://docs.cycling74.com/max8/refpages/suckah suckah] - pick a colour from the underlying part of the screen (yields RGBA as 4-tuple of floats (0.0 .. 1.0))
* [https://docs.cycling74.com/max8/refpages/swatch swatch] - display a colour (picked)
* [https://docs.cycling74.com/max8/refpages/vexpr vexpr] - for (C-style) math operations with elements in lists
* [https://docs.cycling74.com/max8/refpages/jit.findbounds findbounds] - search values in a given range in the video matrix
* [https://docs.cycling74.com/max8/refpages/jit.lcd jit.lcd] - a canvas to draw on
* [https://docs.cycling74.com/max8/refpages/send send] & [https://docs.cycling74.com/max8/refpages/receive receive] - avoid cable mess
 
= homework 2: video theremin =
Assignment: Combine your first patch with sound/video conversion/analysis tools
 
This patch combines the previously developed color-based movement tracker with the first theremin.
 
[[File:video_theremin.png|400px]]
[[:File:2021-04-23_video_theremin_JS.maxpat]]

Latest revision as of 13:11, 17 June 2021

This page documents my work and experiments done during the "Max and I, Max and Me" course. Feel free to copy, but give attribution where appropriate.

ISS overhead

ISS overhead.png

The International Space Station is currently the only extraterrestrial habitat for humans. It circles the earth approximately every 90 minutes and thus can look down on a vast planet. Humans on the other hand rarely look up and grasp what we accomplished and what we can reach for. This small installation tracks the International Space Station and emits a notification if it is above the place of exhibition. A handbell is rung and the names of the people currently in outer space are read out loud.

The technical setup consists of a computer running Max and some means of notification like a bell or a speaker. The current position of the International Space Station is calculated from its orbital data and set into relation to the place of exhibition (e.g. Weimar). If the ISS is at a place which can be considered overhead the notification is triggered.

implementation notes

The underlying Max patch for tracking the ISS and playing audio looks like this: ISS overhead patch.png

File:ISS overhead 2021-06-14.maxpat


Processing TLE files and orbital data was sidestepped by relying on open-notify.org and processing JSON data. The distance (on earth) to the city center of Weimar (at 50.979444, 11.329722) calculated using the euclidian distance as a metric. To simplify the math it is assumed that the world is flat and the WGS 84 reference system is ignored. This is ok for small distances where the curvature of the earth does not result in too much of an error.

The Max patch was exported to a standalone application. It is now run on a small computer board to reduce the complexity of the setup. The data about the ISS crew is scraped from the internet using custom written software.

Lessons learned:

  • sometimes you can find an API for exactly the data you need
  • occasionally ignoring the material reality is feasible on very narrow bounds
  • school math turned out to be useful

references