{"id":5477,"date":"2013-02-12T23:53:09","date_gmt":"2013-02-12T23:53:09","guid":{"rendered":"http:\/\/zerokidz.com\/ideas\/?p=5477"},"modified":"2021-02-11T17:35:59","modified_gmt":"2021-02-11T22:35:59","slug":"real-time-irish-train-map-in-max","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=5477","title":{"rendered":"Real time Irish train map in Max"},"content":{"rendered":"<p class=\"lead\">Using node.js<\/p>\n<p>Time compressed video of Irish railway data from November 30th 2012.<\/p>\n<p><iframe loading=\"lazy\" title=\"Irish Train Map in Max\/MSP and node.js\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/qjNSxrUojpw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h3>update notes 2\/11\/2021<\/h3>\n<p>After many years&#8230;. I was able to get this running<\/p>\n<ul>\n<li>in the project folder (ie., \/trains)\n<ul>\n<li>npm init<\/li>\n<li>then do: npm install &lt;package&gt; for these packages:\n<ul>\n<li>request<\/li>\n<li>xml2js<\/li>\n<li>util<\/li>\n<li>http<\/li>\n<li>ws<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>then just ran: node max-train1.js and started polling in train-drawing4.maxpat and the data started rolling in<\/li>\n<li>webSockets code was replace using ws library<\/li>\n<\/ul>\n<p>Also using sample webSockets code from here to handle the map points: <a href=\"https:\/\/masteringjs.io\/tutorials\/node\/websockets\">https:\/\/masteringjs.io\/tutorials\/node\/websockets<\/a><\/p>\n<h4>Next steps:<\/h4>\n<p>I would like to update all of this in node for max &#8211; but its also nice to have an example of doing OSC communication with Max the old way.<\/p>\n<h3>Original documentation follows<\/h3>\n<hr \/>\n<p>This map is centered on Dublin. Each train is a different color and the train number gets printed next to the current position. So for example you can see P607 coming into Dublin from the South.<\/p>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5424\" title=\"irish train map\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png\" alt=\"\" width=\"300\" height=\"295\" srcset=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png 300w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-304x300.png 304w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map.png 617w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>It gets updates every 10 seconds or so \u2013 but sometimes the trains seem to \u2018jump\u2019 so I don\u2019t think the actual \u00a0data itself gets updated that fast.<\/p>\n<h3>download<\/h3>\n<p><a href=\"https:\/\/github.com\/tkzic\/internet-sensors\">https:\/\/github.com\/tkzic\/internet-sensors<\/a><\/p>\n<p>folder: trains<\/p>\n<h3><span style=\"line-height: 1.1;\">files:<\/span><\/h3>\n<h5><strong>main<\/strong> Max<strong> patches<\/strong><\/h5>\n<ul>\n<li>max-train3.maxpat<\/li>\n<li>train-drawing4.maxpat<\/li>\n<\/ul>\n<h5>abstractions and other files<\/h5>\n<ul>\n<li>data_recorder_list-tz.maxpat<\/li>\n<\/ul>\n<h5>node.js<\/h5>\n<ul>\n<li>max-train1.js: (main server)<\/li>\n<li>bigInt.js: (Osc support)<\/li>\n<li>byteConverter.js: (Osc support)<\/li>\n<li>libOsc.js: (Osc library)<\/li>\n<li>max.html: (the web client file &#8211; runs in browser)<\/li>\n<\/ul>\n<h4><span style=\"line-height: 22px;\">node.js installation<\/span><\/h4>\n<p>Install node.js on your computer (or a separate server). Instructions here:\u00a0<a href=\"http:\/\/nodejs.org\">http:\/\/nodejs.org<\/a><\/p>\n<p>In a terminal window go to the project folder ie., \/internetsensors\/trains<\/p>\n<p>type: npm init<\/p>\n<p>(just accept all the default values)<\/p>\n<p>The following node packages are required. Install using npm. For example:<\/p>\n<p class=\"panel\">type: npm install request<\/p>\n<p>Do the same with all these packages<\/p>\n<div>\n<ul>\n<li>request<\/li>\n<li>xml2js<\/li>\n<li>util<\/li>\n<li>http<\/li>\n<li>ws<\/li>\n<\/ul>\n<\/div>\n<h3><span style=\"font-size: 44px; font-weight: bold; line-height: 1.1;\">instructions<\/span><\/h3>\n<div>\n<p>These instructions are a bit confusing. A simpler UI is in the works. (that&#8217;s funny &#8211; I said it 8 years ago)<\/p>\n<div>\n<ul>\n<li>Open both Max patches: max-train3 and train-drawing4<\/li>\n<li>To run the server, open a terminal window, go to trains folder, and type:<\/li>\n<\/ul>\n<pre>node .\/max-train1.js<\/pre>\n<ul>\n<li>Back in Max, in train-drawing4, you can start and stop polling with the toggle button in the upper left corner. If you want to toggle playback from the data recorder, you&#8217;ll need to have some data recorded &#8211; or load a file (this is done from max-train3)<\/li>\n<li>\u00a0In max-train3, select a preset in the preset object. Try the top left one, The presets go from low res to high res on Dublin (left to right).<\/li>\n<li>\u00a0You can load\u00a0<strong>train-data1.txt<\/strong>\u00a0by clicking read message on the data recorder. Then press play, or use metro (set to low number) for high speed.<\/li>\n<li>In train-drawing4 you&#8217;ll need to manually clear the lcd and lcdsprites in the drawing section.<\/li>\n<li>In max-train3 you can\u00a0clear the color database using labeled button (if the train names don&#8217;t print on the map)<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<h3>Running the chat thing<\/h3>\n<p>When you connect to the node server in a web browser, for example using the following url:<\/p>\n<pre>http:\/\/localhost:8124<\/pre>\n<p>You will get a message welcoming you and asking you to enter your name. After you enter your name, Max will send you a response. Then you can enter map points using the following format:<\/p>\n<pre>Dublin 53.15 -6.90<\/pre>\n<p>The map point will be drawn on the map in the Max patch.<\/p>\n<h3>how does it work?<\/h3>\n<p>Data communication is done with OSC messages. Here&#8217;s how<\/p>\n<ul>\n<li>Max sends a \/getTrains message to a node.js server<\/li>\n<li>The server runs an http: request to the Irish rail API<\/li>\n<li>The server parses the response data and sends back a bunch of \/train name x y messages. to Max<\/li>\n<li>You can also connect to the node server from web browsers in kind of a \u2018chat\u2019 thing (using Web sockets) and enter geographical place names with lat\/lon &#8211; which get pinned to the map \u2013 and Max sends back personalized thank-you notes.<\/li>\n<\/ul>\n<p>Here\u2019s what the raw data looks like:<\/p>\n<div><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-20115\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM-300x160.png\" alt=\"\" width=\"300\" height=\"160\" srcset=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM-300x160.png 300w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM-1024x546.png 1024w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM-768x409.png 768w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM-1536x818.png 1536w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2021-02-11-at-5.29.52-PM.png 1742w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<div><\/div>\n<div><a href=\"http:\/\/api.irishrail.ie\/realtime\/realtime.asmx\/getCurrentTrainsXML\">http:\/\/api.irishrail.ie\/realtime\/realtime.asmx\/getCurrentTrainsXML<\/a><\/div>\n<div><\/div>\n<div>\n<p>Note: if there\u2019s no data at this link, check the time of day. Trains stop running around midnight UTC.<\/p>\n<h3>Programming:<\/h3>\n<p>Essentially what this program does is collect current train position data from Ireland and display it as points on an XY grid.<\/p>\n<p>components:<\/p>\n<ul>\n<li>Max\/MSP<\/li>\n<li>node.js<\/li>\n<li>Web browser<\/li>\n<li>Irish train API<\/li>\n<\/ul>\n<h3>Server<\/h3>\n<p>The server is written in node.js. This was my first real project using node. So I tried to make it do a bunch of things, just to test them out.The necessary features are<\/p>\n<ul>\n<li>web server to make http: requests to get the train data<\/li>\n<li>UDP server to pass data and messages back and forth from Max to node.js using Osc<\/li>\n<li>convert XML train data to JSON,<\/li>\n<li>convert point data from lat\/lon to XY format<\/li>\n<\/ul>\n<div>Additional features of the server include:<\/div>\n<div><\/div>\n<div>\n<ul>\n<li>chat server using socket.io which allows several web browser sessions to connect to the server, talk with each other, send point data to Max, and receive acknowledgement from Max<\/li>\n<\/ul>\n<\/div>\n<div><strong>Localhost vs. separate server<\/strong><\/div>\n<div><\/div>\n<p>This is probably the most confusing part about this program. You can run it on the Mac in localhost mode, or you can run the node.js program on a separate server, as long as there is a direct ip path back to the computer where Max is running. \u00a0Running a separate server makes more sense if you are using the chat or a remote web control aspect of this. I have run the node program on a Ubuntu server on my local network without making any changes other than to the IP addresses as explained next.<\/p>\n<p>You need to make 2 changes to go from localhost mode, to separate server mode:<\/p>\n<p>In the client program, max.html &#8211; near the top, change the ip address from localhost to the specific ip like this:<\/p>\n<div><\/div>\n<div>\n<pre>\/\/ note: if you want to run this program on something other than localhost, then put in the ip\r\n\/\/ address of the server here, instead of local host...\r\n\r\n\/\/     var socket = io.connect('http:\/\/localhost:8124');\r\n\/\/\r\n       var socket = io.connect(192.168.1.10:8124');<\/pre>\n<pre><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>In the server program, max-train1.js &#8211; change the destination address for UDP to the address of the computer where max is running:<\/p>\n<div><\/div>\n<div>\n<pre><\/pre>\n<pre>var dSendAddress = '127.0.0.1';\t\/\/ send response messages to max at this address\r\n\/\/ do this if max is running somewhere other than the same computer as the node server\r\n\/\/ var dSendAddress = '192.168.1.104';\t\/\/ send response messages to max at this address<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Also in the Max patch max-train3.maxpat you will need to change the [udpsend] object to give it the host address of the node server.<\/p>\n<h1>screenshots:<\/h1>\n<div><\/div>\n<div>max-train3.maxpat<\/div>\n<div><\/div>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.21.58-PM.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Screen Shot 2013-02-12 at 10.21.58 PM\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.21.58-PM-300x169.png\" alt=\"\" width=\"300\" height=\"169\" \/><\/a><\/p>\n<p>train-drawing4.maxpat<\/p>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.21.35-PM.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Screen Shot 2013-02-12 at 10.21.35 PM\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.21.35-PM-300x169.png\" alt=\"\" width=\"300\" height=\"169\" \/><\/a><\/p>\n<p>Data recorder:<\/p>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.25.49-PM.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Screen Shot 2013-02-12 at 10.25.49 PM\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/Screen-Shot-2013-02-12-at-10.25.49-PM-300x165.png\" alt=\"\" width=\"300\" height=\"165\" \/><\/a><\/p>\n<p>To be able to save and replay data I included a data recorder in the patch. Its a revision of the data recorder from CNMAT by Michael Z. This version<\/p>\n<ul>\n<li>works with lists that start with a symbol (not just ones that start with numbers)<\/li>\n<li>handles the time delta correctly on the first record<\/li>\n<li>adds additional transport controls, for example playback using a [metro] at any speed \u2013 and ability to goto a particular position in the data file<\/li>\n<\/ul>\n<p>The actual code for the patch is horrendous. Its filled with debugging objects and is a maze of patch cords lacking explanation. But it works&#8230;<\/p>\n<\/div>\n<h4>what&#8217;s next<\/h4>\n<ul>\n<li>Make sure that the Max Patch loads a preset map setting by default<\/li>\n<li>put a timestamp message in the node console and Max console so we know at the end of a train list what the current time is.<\/li>\n<li>clean up \u00a0instructions<span style=\"line-height: 1;\">\u00a0<\/span><\/li>\n<li><span style=\"line-height: 1;\">make a screencast do demonstrate how to use this needlessly complicated patch.<\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Using node.js Time compressed video of Irish railway data from November 30th 2012. update notes 2\/11\/2021 After many years&#8230;. I was able to get this running in the project folder (ie., \/trains) npm init then do: npm install &lt;package&gt; for these packages: request xml2js util http ws then just ran: node max-train1.js and started polling &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=5477\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Real time Irish train map in Max&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[143],"tags":[161,6,345,155,105,190],"class_list":["post-5477","post","type-post","status-publish","format-standard","hentry","category-interactive-media-art","tag-api","tag-interactive-media","tag-maxmsp","tag-node-js","tag-osc","tag-portfolio"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Real time Irish train map in Max - reactive music<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/reactivemusic.net\/?p=5477\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Real time Irish train map in Max - reactive music\" \/>\n<meta property=\"og:description\" content=\"Using node.js Time compressed video of Irish railway data from November 30th 2012. update notes 2\/11\/2021 After many years&#8230;. I was able to get this running in the project folder (ie., \/trains) npm init then do: npm install &lt;package&gt; for these packages: request xml2js util http ws then just ran: node max-train1.js and started polling &hellip; Continue reading &quot;Real time Irish train map in Max&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=5477\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-12T23:53:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-11T22:35:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"Real time Irish train map in Max\",\"datePublished\":\"2013-02-12T23:53:09+00:00\",\"dateModified\":\"2021-02-11T22:35:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477\"},\"wordCount\":1206,\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/02\\\/irish-train-map-300x295.png\",\"keywords\":[\"API\",\"interactive media\",\"Max\\\/MSP\",\"node.js\",\"OSC\",\"portfolio\"],\"articleSection\":[\"interactive media art\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477\",\"name\":\"Real time Irish train map in Max - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/02\\\/irish-train-map-300x295.png\",\"datePublished\":\"2013-02-12T23:53:09+00:00\",\"dateModified\":\"2021-02-11T22:35:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=5477\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#primaryimage\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/02\\\/irish-train-map.png\",\"contentUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/02\\\/irish-train-map.png\",\"width\":\"617\",\"height\":\"608\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=5477#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Real time Irish train map in Max\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Real time Irish train map in Max - reactive music","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/reactivemusic.net\/?p=5477","og_locale":"en_US","og_type":"article","og_title":"Real time Irish train map in Max - reactive music","og_description":"Using node.js Time compressed video of Irish railway data from November 30th 2012. update notes 2\/11\/2021 After many years&#8230;. I was able to get this running in the project folder (ie., \/trains) npm init then do: npm install &lt;package&gt; for these packages: request xml2js util http ws then just ran: node max-train1.js and started polling &hellip; Continue reading \"Real time Irish train map in Max\"","og_url":"https:\/\/reactivemusic.net\/?p=5477","og_site_name":"reactive music","article_published_time":"2013-02-12T23:53:09+00:00","article_modified_time":"2021-02-11T22:35:59+00:00","og_image":[{"url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png","type":"","width":"","height":""}],"author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=5477#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=5477"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"Real time Irish train map in Max","datePublished":"2013-02-12T23:53:09+00:00","dateModified":"2021-02-11T22:35:59+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=5477"},"wordCount":1206,"image":{"@id":"https:\/\/reactivemusic.net\/?p=5477#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png","keywords":["API","interactive media","Max\/MSP","node.js","OSC","portfolio"],"articleSection":["interactive media art"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=5477","url":"https:\/\/reactivemusic.net\/?p=5477","name":"Real time Irish train map in Max - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=5477#primaryimage"},"image":{"@id":"https:\/\/reactivemusic.net\/?p=5477#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map-300x295.png","datePublished":"2013-02-12T23:53:09+00:00","dateModified":"2021-02-11T22:35:59+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=5477#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=5477"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/reactivemusic.net\/?p=5477#primaryimage","url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map.png","contentUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/02\/irish-train-map.png","width":"617","height":"608"},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=5477#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"Real time Irish train map in Max"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/5477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5477"}],"version-history":[{"count":37,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/5477\/revisions"}],"predecessor-version":[{"id":20116,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/5477\/revisions\/20116"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}