{"id":2152,"date":"2015-06-01T12:36:49","date_gmt":"2015-06-01T17:06:49","guid":{"rendered":"http:\/\/www.danielpradilla.info\/blog\/?p=2152"},"modified":"2015-05-30T13:45:06","modified_gmt":"2015-05-30T18:15:06","slug":"hello-p5js","status":"publish","type":"post","link":"https:\/\/www.danielpradilla.info\/blog\/hello-p5js\/","title":{"rendered":"Having fun coding with p5.js"},"content":{"rendered":"<p><a href=\"http:\/\/p5js.org\/\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2154\" data-permalink=\"https:\/\/www.danielpradilla.info\/blog\/hello-p5js\/p5js\/\" data-orig-file=\"https:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js.jpg\" data-orig-size=\"1000,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"p5js\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js-300x90.jpg\" data-large-file=\"https:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js.jpg\" src=\"http:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js.jpg\" alt=\"p5js\" width=\"1000\" height=\"300\" class=\"aligncenter size-full wp-image-2154\" srcset=\"https:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js.jpg 1000w, https:\/\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/p5js-300x90.jpg 300w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><br \/>\n<a href=\"http:\/\/p5js.org\/\" target=\"_blank\">p5.js<\/a> is an effort to port the ideas and concepts of the <a href=\"https:\/\/processing.org\/\" target=\"_blank\">Processing<\/a> programming language to JavaScript. <\/p>\n<p>Even though there&#8217;s already processing.js \u2013which transcodes Processing code into JavaScript\u2013, p5.js is built with extensibility in mind, trough plugins, and instead of writing Processing code to be transcoded, you write pure JavaScript.<\/p>\n<p>The other day I saw <a href=\"http:\/\/hello.p5js.org\/\" target=\"_blank\">the p5.js launch presentation<\/a>, and loved it. It made me do several double-takes as it shows wizardly things that you usually don&#8217;t see on video. <\/p>\n<p>So I gave it a whirl. Following the very detailed <a href=\"http:\/\/p5js.org\/examples\/\" target=\"_blank\">examples<\/a> on their site I was able to quickly put together a web toy that records audio through your microphone and then allows you to reproduce it, changing the volume and speed. Here it is:<br \/>\n(you have to accept the microphone prompt in your browser in order for this to work)<\/p>\n<div id=\"p5jscontainer\"><\/div>\n<p><a href=\"https:\/\/github.com\/danielpradilla\/p5js_speed_volume\" target=\"_blank\">Here&#8217;s the code in github<\/a><\/p>\n<p>It was quick, painless and <em>fun<\/em>. In fact, this was the most fun that I&#8217;ve had in a long while learning a new JavaScript library. The onboarding experience that these guys have in their website it&#8217;s absolutely great.<\/p>\n<p>I&#8217;ve never learned Processing, but have seen some <a href=\"https:\/\/www.youtube.com\/watch?v=O8tT0GXTOPo\" target=\"_blank\">wicked visualizations<\/a> done with it. Seems like the routines and the concepts in p5.js are very similar, and the first thing that came to mind when I dove into it was <a href=\"https:\/\/en.wikipedia.org\/wiki\/Logo_(programming_language)\" target=\"_blank\">Logo<\/a>, my first language. I think it&#8217;s the procedural, sequential nature of it. The rules are very clear, each instruction modifies the context, and there&#8217;s this pervasive idea that you&#8217;re drawing in a canvas object in a web page. <\/p>\n<p>I bet p5.js would make for a great introduction to programming for kids, with the added benefit that, along the way, any beginner that starts with p5.js would be learning one of the most popular languages today. And having fun at the same time.<\/p>\n<p><a href=\"http:\/\/p5js.org\/\" target=\"_blank\">p5.js website<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><script src=\"http:\/\/danielpradilla.info\/resources\/p5js\/bower_components\/p5js\/lib\/p5.min.js\"><\/script><br \/>\n<script src=\"http:\/\/danielpradilla.info\/resources\/p5js\/bower_components\/p5js\/lib\/addons\/p5.sound.min.js\"><\/script><br \/>\n<script src=\"http:\/\/danielpradilla.info\/resources\/p5js\/p5js_speed_volume\/js\/p5js_speed_volume.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>p5.js is an effort to port the ideas and concepts of the Processing programming language to JavaScript. Even though there&#8217;s already processing.js \u2013which transcodes Processing code into JavaScript\u2013, p5.js is built with extensibility in mind, trough plugins, and instead of writing Processing code to be transcoded, you write pure JavaScript. The other day I saw&hellip; <a class=\"more-link\" href=\"https:\/\/www.danielpradilla.info\/blog\/hello-p5js\/\">Continue reading <span class=\"screen-reader-text\">Having fun coding with p5.js<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[331],"tags":[197],"class_list":["post-2152","post","type-post","status-publish","format-standard","hentry","category-software-development-en-en","tag-visualization","entry"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1tlzy-yI","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2139,"url":"https:\/\/www.danielpradilla.info\/blog\/interactive-visualizations-javascript\/","url_meta":{"origin":2152,"position":0},"title":"Creating interactive visualizations of large datasets using JavaScript","author":"Daniel Pradilla","date":"09\/04\/2015","format":false,"excerpt":"Crossfilter is a JavaScript library initially designed by Square to explore large multivariate datasets in a web browser. It basically allows you to create sorted indexes and feed them to a charting library like D3, and enable the user to filter by clicking and dragging, even when sifting through 200.000\u2026","rel":"","context":"In &quot;Project Mgmt.&quot;","block_context":{"text":"Project Mgmt.","link":"https:\/\/www.danielpradilla.info\/blog\/category\/projectmanagement-en\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2157,"url":"https:\/\/www.danielpradilla.info\/blog\/a-swiss-railway-clock-in-d3\/","url_meta":{"origin":2152,"position":1},"title":"A swiss railway clock in D3.js","author":"Daniel Pradilla","date":"09\/06\/2015","format":false,"excerpt":"\u00a0 The other day I saw this cool JavaScript+CSS clock and I immediately thought that I wanted to create an analog clock in D3.js. First of all as an exercise, but also with the aim \u2013perhaps\u2013 of smuggling it in to a future dashboard ;) It seemed straightforward: just paint\u2026","rel":"","context":"In &quot;Best of&quot;","block_context":{"text":"Best of","link":"https:\/\/www.danielpradilla.info\/blog\/category\/bestof\/"},"img":{"alt_text":"Screen Shot 2015-06-05 at 5.26.54 PM","src":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2015\/06\/Screen-Shot-2015-06-05-at-5.26.54-PM.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2082,"url":"https:\/\/www.danielpradilla.info\/blog\/amcharts-a-charting-library-for-creating-interactive-web-charts\/","url_meta":{"origin":2152,"position":2},"title":"amCharts, a charting library for creating interactive web charts","author":"Daniel Pradilla","date":"19\/05\/2014","format":false,"excerpt":"amCharts is a new JavaScript library for creating charts on the web. It handles many types of charts and it's somewhat reminiscent of D3.js. Its most exciting feature is a live editor, which removes the grunt work related to your typical JavaScript charting library and enables you to design, change\u2026","rel":"","context":"In &quot;Project Mgmt.&quot;","block_context":{"text":"Project Mgmt.","link":"https:\/\/www.danielpradilla.info\/blog\/category\/projectmanagement-en\/"},"img":{"alt_text":"amcharts","src":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2014\/05\/amcharts.jpg?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2014\/05\/amcharts.jpg?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2014\/05\/amcharts.jpg?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2014\/05\/amcharts.jpg?resize=700%2C400 2x"},"classes":[]},{"id":2212,"url":"https:\/\/www.danielpradilla.info\/blog\/linear-optimization-with-or-tools-building-a-web-front-end-with-falcon-and-gunicorn\/","url_meta":{"origin":2152,"position":3},"title":"Linear Optimization with or-tools \u00e2\u20ac\u201d building a web front-end with falcon and gunicorn","author":"Daniel Pradilla","date":"14\/11\/2017","format":false,"excerpt":"In a previous post, I put together a script for solving a linear optimisation problem using Google's OR-tools. This python script is callable from the command line and you kinda need to know what you are doing and how to organize the parameters. So, in order to address this difficulty,\u2026","rel":"","context":"In &quot;Software Dev.&quot;","block_context":{"text":"Software Dev.","link":"https:\/\/www.danielpradilla.info\/blog\/category\/software-development-en-en\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2017\/11\/groceryshopping.gif?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2017\/11\/groceryshopping.gif?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2017\/11\/groceryshopping.gif?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2017\/11\/groceryshopping.gif?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":1893,"url":"https:\/\/www.danielpradilla.info\/blog\/nterface-design\/","url_meta":{"origin":2152,"position":4},"title":"Stop punishing your users and learn some design fundamentals","author":"Daniel Pradilla","date":"14\/01\/2013","format":false,"excerpt":"One thing that never ceases to amaze me is how bad in-house enterprise applications look and behave: clashing color combinations, buttons that don't respond to clicks, messy forms, elements that look like links but aren't, inconsistent non-standard controls, no user feedback whatsoever, ugly reports, you know the drill. It's even\u2026","rel":"","context":"In &quot;Best of&quot;","block_context":{"text":"Best of","link":"https:\/\/www.danielpradilla.info\/blog\/category\/bestof\/"},"img":{"alt_text":"usability_testing","src":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2013\/01\/usability_testing.jpeg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2245,"url":"https:\/\/www.danielpradilla.info\/blog\/recommender-system-for-finding-subject-matter-experts-using-the-enron-email-corpus\/","url_meta":{"origin":2152,"position":5},"title":"Recommender system for finding subject matter experts using the Enron email corpus","author":"Daniel Pradilla","date":"20\/11\/2018","format":false,"excerpt":"This is a little project to create a recommender system to find mentors inside an organization, using Natural Language Processing. It started as an excuse to build a data visualization I had in mind: an interactive word cloud that did something. When I started, I didn't know anything about Topic\u2026","rel":"","context":"In &quot;Best of&quot;","block_context":{"text":"Best of","link":"https:\/\/www.danielpradilla.info\/blog\/category\/bestof\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2018\/11\/bubbles2.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2018\/11\/bubbles2.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.danielpradilla.info\/blog\/wp-content\/uploads\/2018\/11\/bubbles2.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/posts\/2152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/comments?post=2152"}],"version-history":[{"count":0,"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/posts\/2152\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/media?parent=2152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/categories?post=2152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.danielpradilla.info\/blog\/wp-json\/wp\/v2\/tags?post=2152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}