{"id":169,"date":"2016-03-04T12:13:38","date_gmt":"2016-03-04T12:13:38","guid":{"rendered":"http:\/\/www.rangakrish.com\/?p=169"},"modified":"2016-03-04T12:23:46","modified_gmt":"2016-03-04T12:23:46","slug":"a-gui-front-end-for-cellular-automata-generator","status":"publish","type":"post","link":"https:\/\/www.rangakrish.com\/index.php\/2016\/03\/04\/a-gui-front-end-for-cellular-automata-generator\/","title":{"rendered":"A GUI Front-end for Cellular Automata Generator"},"content":{"rendered":"<p>In my <a href=\"http:\/\/www.rangakrish.com\/index.php\/2016\/02\/28\/using-cellular-automata-to-generate-music\/\" target=\"_blank\">last post<\/a>, I explained how we can use Cellular Automata (CA) in <a href=\"http:\/\/opusmodus.com\" target=\"_blank\">Opusmodus<\/a>\u00a0to create music.<\/p>\n<p>For today\u2019s post, I wanted to build a simple UI to control the parameters used in the CA example. This posed a practical difficulty. Opusmodus does not yet provide a GUI library. Even Clozure CL, on which Opusmodus is based, does not seem to have an official and fully supported GUI library. I could, of course, build a separate GUI app in Swift using XCode, or implement one using <a href=\"http:\/\/franz.com\/products\/allegrocl\/\" target=\"_blank\">Allegro CL<\/a> on Mac and have the app talk to Opusmodus using TCP\/IP.<\/p>\n<p>I then remembered my <a href=\"http:\/\/www.embarcadero.com\/products\/rad-studio\" target=\"_blank\">RAD Studio 10 Seattle<\/a>, and decided to use its multi-platform application capability to build the GUI driver app for OS X. It took me a few hours to build the GUI app in C++ and to refactor the Lisp code to accept parameters from the GUI app and then generate the music score.<\/p>\n<p>Note that both the apps are running on my iMac, talking to each other via TCP\/IP.<\/p>\n<p>The following figure shows the GUI app with its various controls.<\/p>\n<figure id=\"attachment_170\" aria-describedby=\"caption-attachment-170\" style=\"width: 595px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png\" rel=\"attachment wp-att-170\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" data-attachment-id=\"170\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2016\/03\/04\/a-gui-front-end-for-cellular-automata-generator\/opusmodus-driver\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png\" data-orig-size=\"595,435\" 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=\"Opusmodus GUI Driver\" data-image-description=\"&lt;p&gt;Opusmodus GUI Driver&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;Opusmodus GUI Driver&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png\" class=\"wp-image-170 size-full\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png?resize=595%2C435\" alt=\"Opusmodus GUI Driver\" width=\"595\" height=\"435\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png?w=595&amp;ssl=1 595w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/Opusmodus-Driver.png?resize=300%2C219&amp;ssl=1 300w\" sizes=\"(max-width: 595px) 100vw, 595px\" \/><\/a><figcaption id=\"caption-attachment-170\" class=\"wp-caption-text\">Opusmodus GUI Driver<\/figcaption><\/figure>\n<p>Clicking the <em><strong>Play<\/strong><\/em>\u00a0button after setting the required parameters causes Opusmodus to create and play the score. Clicking <em><strong>Quit<\/strong><\/em>\u00a0terminates the interaction and closes the GUI application.<\/p>\n<p>Here is the screen image of the Opusmodus program.<\/p>\n<figure id=\"attachment_171\" aria-describedby=\"caption-attachment-171\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png\" rel=\"attachment wp-att-171\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"171\" data-permalink=\"https:\/\/www.rangakrish.com\/index.php\/2016\/03\/04\/a-gui-front-end-for-cellular-automata-generator\/ca-music-generator\/\" data-orig-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png\" data-orig-size=\"860,866\" 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=\"CA Music Generator\" data-image-description=\"&lt;p&gt;CA Music Generator&lt;\/p&gt;\n\" data-image-caption=\"&lt;p&gt;CA Music Generator&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png\" class=\"wp-image-171 size-full\" src=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png?resize=780%2C785\" alt=\"CA Music Generator\" width=\"780\" height=\"785\" srcset=\"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png?w=860&amp;ssl=1 860w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png?resize=298%2C300&amp;ssl=1 298w, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/03\/CA-Music-Generator.png?resize=768%2C773&amp;ssl=1 768w\" sizes=\"(max-width: 780px) 100vw, 780px\" \/><\/a><figcaption id=\"caption-attachment-171\" class=\"wp-caption-text\">CA Music Generator<\/figcaption><\/figure>\n<p>You can download the program from <a href=\"http:\/\/www.rangakrish.com\/downloads\/GUI Example.opmo\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post, I explained how we can use Cellular Automata (CA) in Opusmodus\u00a0to create music. For today\u2019s post, I wanted to build a simple UI to control the parameters used in the CA example. This posed a practical difficulty. Opusmodus does not yet provide a GUI library. Even Clozure CL, on which Opusmodus [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"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":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18,5,17],"tags":[42,37,44],"class_list":["post-169","post","type-post","status-publish","format-standard","hentry","category-lisp","category-music","category-programming","tag-cellular-automata","tag-opusmodus","tag-rad-studio-seattle"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9OLnF-2J","jetpack-related-posts":[{"id":159,"url":"https:\/\/www.rangakrish.com\/index.php\/2016\/02\/28\/using-cellular-automata-to-generate-music\/","url_meta":{"origin":169,"position":0},"title":"Using Cellular Automata to Generate Music","author":"admin","date":"February 28, 2016","format":false,"excerpt":"Cellular automata are a powerful computational formalism. Stephen Wolfram\u2019s book A New Kind of Science\u00a0provides a thorough study of these devices. Not surprisingly,\u00a0Wolfram Mathematica has great support for working with them. For example, the following figure shows the evolution of Rule 30 over 50 steps, plotted using ArrayPlot function (in\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Cellular Automata","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/02\/Cellular-Automata.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2206,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/11\/22\/a-library-for-algorithmic-music-composition\/","url_meta":{"origin":169,"position":1},"title":"A Library for Algorithmic Music Composition","author":"admin","date":"November 22, 2020","format":false,"excerpt":"I have recently started implementing a library for algorithmic music composition. It provides higher-level algorithms and abstractions for composing multi-track music, and works with Opusmodus\u00a0software. Opusmodus is a great platform for music composition and has excellent support for MIDI-based music. My library is an attempt to enrich the Opusmodus platform\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"App for Controlling Opusmodus","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/11\/Screen1-300x139.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":245,"url":"https:\/\/www.rangakrish.com\/index.php\/2016\/05\/26\/constraint-propagation-in-picat\/","url_meta":{"origin":169,"position":2},"title":"Constraint Programming in Picat","author":"admin","date":"May 26, 2016","format":false,"excerpt":"In my last post\u00a0I briefly described how we can use the Screamer Lisp library for constraint programming in music. Another language I have been hearing a lot about, in the context of constraint programming, is Picat, a Prolog-derived language. Although I am familiar with Prolog and have been a user\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Picat Program","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/05\/Picat-Program.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2242,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/12\/20\/jfugue-a-java-library-for-music-synthesis\/","url_meta":{"origin":169,"position":3},"title":"JFugue: A Java Library for Music Synthesis","author":"admin","date":"December 20, 2020","format":false,"excerpt":"JFugue\u00a0is an open-source Java library that can be used for algorithmic music composition. Developed by David Koelle, currently it is in its fifth major version. You can get the library from here. I had downloaded the library some time ago, but could not spend much time since my primary focus\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Simple Java Program","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/12\/java-2-300x142.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/12\/java-2-300x142.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/12\/java-2-300x142.jpg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":268,"url":"https:\/\/www.rangakrish.com\/index.php\/2016\/06\/29\/pattern-matching-with-optima-lisp-library-part-3\/","url_meta":{"origin":169,"position":4},"title":"Pattern Matching with Optima Lisp Library &#8211; Part 3","author":"admin","date":"June 29, 2016","format":false,"excerpt":"In the previous two posts on this topic, I explained some of the basic pattern matching facilities of Optima\u00a0library. There are many\u00a0more advanced features in the library and I will try to discuss them in future posts. In today\u2019s post, I will outline a straightforward application of the library for\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Optima Example","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/06\/Optima-Example-1024x622.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/06\/Optima-Example-1024x622.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/06\/Optima-Example-1024x622.png?resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2016\/06\/Optima-Example-1024x622.png?resize=700%2C400 2x"},"classes":[]},{"id":2174,"url":"https:\/\/www.rangakrish.com\/index.php\/2020\/10\/24\/using-random-walk-principle-to-generate-music\/","url_meta":{"origin":169,"position":5},"title":"Using Random Walk Principle to Generate Music","author":"admin","date":"October 24, 2020","format":false,"excerpt":"In mathematics, the simplest example of Random Walk\u00a0is a random process along a one-dimensional plane of integers, starting at 0 and moving in the positive or negative direction in steps of +1 or -1, with equal probability. The Random Walk\u00a0theory has been applied in many domains including Physics and even\u2026","rel":"","context":"In &quot;LISP&quot;","block_context":{"text":"LISP","link":"https:\/\/www.rangakrish.com\/index.php\/category\/lisp\/"},"img":{"alt_text":"Random Walk Example in Mathematica","src":"https:\/\/i0.wp.com\/www.rangakrish.com\/wp-content\/uploads\/2020\/10\/Mathematica-RandomWalk-300x135.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":0,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/posts\/169\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/categories?post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rangakrish.com\/index.php\/wp-json\/wp\/v2\/tags?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}