{"id":222,"date":"2024-08-06T00:10:26","date_gmt":"2024-08-06T07:10:26","guid":{"rendered":"http:\/\/elliottjohnson.net\/blog\/?p=222"},"modified":"2024-08-12T01:01:58","modified_gmt":"2024-08-12T08:01:58","slug":"useq","status":"publish","type":"post","link":"http:\/\/elliottjohnson.net\/blog\/useq\/","title":{"rendered":"uSeq"},"content":{"rendered":"\n<p>It&#8217;s been a loong while since I last posted and I&#8217;ve been getting back into coding and music, the intersection of which got me into EE and CompSci way back in the early 2000s.<\/p>\n\n\n\n<p>Common Lisp was the language of <a href=\"https:\/\/ccrma.stanford.edu\/software\/clm\/\">CLM<\/a> and other software synthesis that attracted me at the time with fantasies of studying at Stanford&#8217;s <a href=\"https:\/\/ccrma.stanford.edu\/\">CCRMA<\/a> lab and the <a href=\"https:\/\/www.labri.fr\/en\/theme\/sound-and-interactions\">LaBRI<\/a> Institute.<\/p>\n\n\n\n<p>Nowadays there are new options like <a href=\"https:\/\/incudine.sourceforge.net\/\">Incudine<\/a> and <a href=\"https:\/\/opusmodus.com\/\">OpusModus<\/a>, which continue that direction and give me hope that I can continue to experiment with software based composition.<\/p>\n\n\n\n<p>Lately I&#8217;ve been spending my days studying and practicing on an old studio piano as well as building a modest <a href=\"https:\/\/en.wikipedia.org\/wiki\/Eurorack\">Eurorack<\/a> DIY modular synth setup.<\/p>\n\n\n\n<p>A kit popped up over at <a href=\"https:\/\/www.thonk.co.uk\/\">Thonk<\/a> for a &#8220;livecoding&#8221; module called &#8220;<a href=\"https:\/\/www.emutelabinstruments.co.uk\/useq\/\">uSeq<\/a>&#8221; by <a href=\"https:\/\/www.emutelab.org\/\">Emute Labs<\/a>, which is connected to the University of Sussex Experimental Music Lab.\u00a0 It uses a Lisp dialect (<a href=\"http:\/\/www.ulisp.com\/\">uLisp<\/a>) as a means to program the module using their own <a href=\"https:\/\/en.wikipedia.org\/wiki\/Domain-specific_language\">DSL<\/a> called <a href=\"https:\/\/www.emutelabinstruments.co.uk\/modulisp-about\/\">ModuLisp<\/a>. There is even a published <a href=\"https:\/\/doi.org\/10.5281\/zenodo.7843874\" data-type=\"link\" data-id=\"https:\/\/doi.org\/10.5281\/zenodo.7843874\">paper <\/a>written that discusses livecoding with this tool.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"177\" src=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-300x177.jpg\" alt=\"\" class=\"wp-image-225\" srcset=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-300x177.jpg 300w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-1024x605.jpg 1024w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-768x454.jpg 768w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-1536x908.jpg 1536w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1-500x296.jpg 500w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240804_194719-1.jpg 1837w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption class=\"wp-element-caption\">The kit as sold by Thonk<\/figcaption><\/figure><\/div>\n\n\n<p>The kit comes with everything you need to assemble the module minus a soldering iron, solder, and about 1\/2 an hour of time.&nbsp; There are two SMD switches, but other than it&#8217;s all through hole components.&nbsp; They have a great build guide <a href=\"https:\/\/www.emutelabinstruments.co.uk\/useq-build\/\">here<\/a> and there is also a prebuilt version if you&#8217;d prefer to rack it up and go.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-2 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-1 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-461x1024.jpg\" alt=\"\" class=\"wp-image-226\" srcset=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-461x1024.jpg 461w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-135x300.jpg 135w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-768x1706.jpg 768w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-691x1536.jpg 691w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628-922x2048.jpg 922w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/20240805_225628.jpg 1089w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><figcaption class=\"wp-element-caption\">Soldered with Kestler no clean 60\/40 solder<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-large\"><a href=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-scaled.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"1024\" src=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-461x1024.jpg\" alt=\"\" class=\"wp-image-238\" srcset=\"http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-461x1024.jpg 461w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-135x300.jpg 135w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-768x1705.jpg 768w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-692x1536.jpg 692w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-922x2048.jpg 922w, http:\/\/elliottjohnson.net\/blog\/wp-content\/uploads\/2024\/08\/1000011208-edited-1-scaled.jpg 1153w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/a><figcaption class=\"wp-element-caption\">Installed and testing the blinkenlights.<\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n\n\n<p>The soldering went well and everything fired up on first go.&nbsp; The 10 LEDs lit up in circling sequence and it showed up as a USB device on my Gentoo Linux host running realtime Linux Kernel 6.6.36. Here is the output of <code>dmesg<\/code>:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<pre class=\"wp-block-preformatted\"><code>[646594.147296] usb 1-3: new full-speed USB device number 6 using xhci_hcd<br>[646594.295794] usb 1-3: New USB device found, idVendor=2e8a, idProduct=f00a, bcdDevice= 1.00<br>[646594.295812] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3<br>[646594.295820] usb 1-3: Product: RP2040<br>[646594.295825] usb 1-3: Manufacturer: Generic<br>[646594.295830] usb 1-3: SerialNumber: E463B013DB56402B<br>[646594.332211] cdc_acm 1-3:1.0: <strong>ttyACM0<\/strong>: USB ACM device<br>[646594.332284] usbcore: registered new interface driver cdc_acm<br>[646594.332291] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters<\/code><\/pre>\n<\/blockquote>\n\n\n\n<p>The bolded text &#8220;ttyACM0&#8221; is the device name for connecting to this new USB connection via the device file \/dev\/ttyACM0. The issue is that the permissions on that file did not allow my user to open the device:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">elliott@deph ~ $ ls -al \/dev\/ttyACM0<br>crw-rw---- 1 root dialout 166, 0 Aug 4 04:22 \/dev\/ttyACM0<\/pre>\n\n\n\n<p>The OS is assigning the Rasberry Pi 2040 chip on uSeq as a communications device (like modems) rather than a USB serial device and so it assigns the &#8220;dialout&#8221; group and root user. If I&#8217;d like to connect to the device, I&#8217;ll need to either join that group or change permissions. I decided to change the permissions and the best way to do that is by setting up a udev rule. Here is what I added:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">elliott@deph ~ $ cat \/etc\/udev\/rules.d\/50-useq.rules<br>SUBSYSTEMS==\"usb\"<br>ATTRS{idVendor}==\"2e8a\"<br>ATTRS{idProduct}==\"f00a\"<br>GROUP=\"audio\"<br>MODE=\"0660\"<\/pre>\n\n\n\n<p>The idVendor and idProduct were from <code>dmesg<\/code> output above, but also can be found by doing a <code>lsusb -vvv<\/code> to see all the details of the device. I have the &#8220;audio&#8221; group setup, my user configured to use it, and I changed the permissions to &#8220;0660&#8221; to ensure read\/write access to that group as well as the root user. The udev rules were reloaded and the cable replugged back in to complete the permissions adjustment.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">elliott@deph ~ $ ls -al \/dev\/ttyACM0<br>crw-rw---- 1 root audio 166, 0 Aug 4 04:22 \/dev\/ttyACM0<\/pre>\n\n\n\n<p>Now that we have a device and it&#8217;s attached, we can connect to it via a serial console emulator app. Luckily Emacs has built in methods and it was quick to load <code>serial-term<\/code> mode and connect to the device with an &#8220;9600 baud 8N1&#8221; connection rate using <code>line-mode<\/code>.<\/p>\n\n\n\n<p>All this went flawlessly and I was soon issuing ModuLisp commands to the uSeq module to get reoccurring patterns on the analog outputs. Looking at the <a href=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\" data-type=\"link\" data-id=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\">code<\/a> it&#8217;s apparent that there is a python interface (<a href=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\/tree\/main\/interfaces\/useqedit\" data-type=\"link\" data-id=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\/tree\/main\/interfaces\/useqedit\">useqedit)<\/a> and I believe a <a href=\"https:\/\/supercollider.github.io\/\" data-type=\"link\" data-id=\"https:\/\/supercollider.github.io\/\">SuperCollider<\/a> interface <a href=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\/tree\/main\/interfaces\/SC\" data-type=\"link\" data-id=\"https:\/\/github.com\/Emute-Lab-Instruments\/uSEQ\/tree\/main\/interfaces\/SC\">here<\/a>. The easiest method of connecting with uSeq is the <a href=\"https:\/\/useq.emutelabinstruments.co.uk\/\" data-type=\"link\" data-id=\"https:\/\/useq.emutelabinstruments.co.uk\/\">webbased interface<\/a> and it works well.<\/p>\n\n\n\n<p>Over the next few weeks I&#8217;d like to go over the current state of the development environment, commands, and other aspects about using this module towards doing some livecoded audio.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s been a loong while since I last posted and I&#8217;ve been getting back into coding and music, the intersection of which got me into EE and CompSci way back in the early 2000s. Common Lisp was the language of &hellip; <a href=\"http:\/\/elliottjohnson.net\/blog\/useq\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"footnotes":""},"categories":[9,8],"tags":[14],"class_list":["post-222","post","type-post","status-publish","format-standard","hentry","category-music","category-tech","tag-useq"],"_links":{"self":[{"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/posts\/222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/comments?post=222"}],"version-history":[{"count":11,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions"}],"predecessor-version":[{"id":243,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/posts\/222\/revisions\/243"}],"wp:attachment":[{"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/media?parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/categories?post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/elliottjohnson.net\/blog\/wp-json\/wp\/v2\/tags?post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}