From chris.actondev at gmail.com Sun Aug 2 13:04:55 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Sun, 2 Aug 2020 22:04:55 +0200 Subject: [CM] S7 & graphics with ImGui Message-ID: Hi all, I'd like to share with you a video demonstration that I did for a project that I've been working on. https://youtu.be/MgHsl0u26MY And here is the repo of the project. https://github.com/actonDev/s7-imgui Another project (that depends on this one) is creating VST3 effects like this. Any input/ideas are much appreciated! Christos -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sun Aug 2 14:15:31 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 02 Aug 2020 14:15:31 -0700 Subject: [CM] S7 & graphics with ImGui In-Reply-To: References: Message-ID: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> Wow! I had trouble at first following what you were doing, but by the end everything was making sense. I had heard about ImGui, but had never looked at it closely -- it is very interesting. And the cmuscheme connection to s7 in emacs caught me by surprise -- is that what you were using? And org mode perhaps? So much to learn... A very impressive video! From bil at ccrma.Stanford.EDU Sun Aug 2 14:35:59 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 02 Aug 2020 14:35:59 -0700 Subject: [CM] =?utf-8?q?metaobject_protocol_for_S7=3F?= In-Reply-To: References: Message-ID: <2932b724888de8b0d0c5b5538fb28800@ccrma.stanford.edu> stuff.scm has define-class, define-method, etc. I just use openlets, where the outer let can be the "class" and each instance inherits from it. I find this much more flexible and easier to understand than CLOS-style machinery. I read somewhere that this is called a "prototype system". I used CLOS heavily in cmn (back in the 90's), and found that the hierarchy simply made the code rigid (hard to change) and opaque (hard to read/debug). A better debugger would have helped, but this was back in the dark ages. Nowadays everyone says you should keep your hierarchies as shallow as possible, which means (does it not?) that no hierarchy is best :) From chris.actondev at gmail.com Sun Aug 2 14:44:28 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Sun, 2 Aug 2020 23:44:28 +0200 Subject: [CM] S7 & graphics with ImGui In-Reply-To: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> References: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> Message-ID: Hi Bil, I really appreciate it. Allow me to say once more: thanks a lot for S7. It's a hidden gem :) Indeed I'm using cmuscheme, and the emacs-lisp need to switch namespaces etc is here https://github.com/actonDev/s7-imgui/issues/3#issuecomment-661295470 Some note here: geisser (emacs-lisp) is worth looking at (offers for example documentation/help messages in the mini buffer etc), but it's quite complicated. Cmuscheme offers just the barebones which is more than enough for now. In org-mode here's some interesting things to look at: - https://github.com/diadochos/org-babel-eval-in-repl to send one liners from a shell snippet to its shell session (this one has really boosted my productivity) - button-lock-mode, to make clickable buttons Now for the project itself: My vague/romantic idea is that this could potentially shape a mini-framework or something that makes it fun to create small GUIs. I come from clojure/clojurescript background and this is where I loved the interactive building of a UI. So I really missed something similar in C/C++. I remember an old mail here in the list where someone posted about clojure and Bill you said that you hadn't heard about it. I suggest, if you have the time, to take a look into it. Now a topic where I would appreciate any input from you especially Bil, but also from any schemer here. The "namespaces" thing that I'm using: https://github.com/actonDev/s7-imgui/issues/3 Again, something that I got from clojure. Christos On Sun, 2 Aug 2020 at 23:15, wrote: > Wow! I had trouble at first following what you were > doing, but by the end everything was making sense. > I had heard about ImGui, but had never looked at it > closely -- it is very interesting. And the cmuscheme > connection to s7 in emacs caught me by surprise -- > is that what you were using? And org mode perhaps? > So much to learn... > > A very impressive video! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Sun Aug 2 15:24:56 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 02 Aug 2020 15:24:56 -0700 Subject: [CM] S7 & graphics with ImGui In-Reply-To: References: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> Message-ID: <682c8aff5388e57a7511bcc3fdaaab33@ccrma.stanford.edu> I think s7's let is very similar to clojure's namespace. (inlet 'x 1) creates a namespace with 'x bound to 1, and (eval '(+ x 1) (inlet 'x 1)) is 2. Unless otherwise specified, the "outlet" is the rootlet, so to make an instance (so to speak) of the class (inlet 'x 1), you could: (let ((class (inlet 'x 1))) (let ((instance (inlet 'y 2))) (set! (outlet instance) class) (with-let instance (+ x y)))) (let ((instance (inlet 'floor (lambda (x) 3.14)))) (with-let instance (floor 1.5))) By using openlet, these lets can specialize built-in functions (see mockery.scm) without having to change to the instance namespace via with-let: (let ((instance (inlet 'object->string (lambda (obj . rest) "hi")))) (openlet instance) (object->string instance)) The hierarchy is the outlet chain. Locals can be added with varlet, removed with cutlet, mapped over etc. Another way to set up the chain is sublet: (let ((class (inlet 'x 1))) (with-let (sublet class 'y 2) ; class=outlet + y=2 locally (+ x y))) From bil at ccrma.Stanford.EDU Sun Aug 2 16:00:57 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Sun, 02 Aug 2020 16:00:57 -0700 Subject: [CM] Snd 20.6 Message-ID: Snd 20.6: added case.scm: case* a pattern-matching extension of case regex.h entries to libc.scm s7_c_pointer_with_type notcurses_s7.c, an FFI to the notcurses library nrepl.scm, an improvement of repl.scm that uses notcurses (work-in-progress) nrepl.c: call nrepl.scm without the need to load libc.scm or notcurses_s7.so *autoload-hook* open-input|output-function (scheme versions of the existing C functions) changed subvector parameters to (subvector vect start end new-dimensions) Here's a translator from the old to the new versions: (define (old-subvector vect len (offset 0)) (if (pair? len) (subvector vect offset (+ offset (apply * len)) len) (if (not len) (subvector vect offset (vector-length vect)) (subvector vect offset (+ offset len))))) checked: OSX 10.15.5, FreeBSD 12.1, sbcl 2.0.7 Thanks!: Daniel Hensel, Kjetil Matheussen, Christos Vagias From iainduncanlists at gmail.com Sun Aug 2 20:12:41 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Sun, 2 Aug 2020 20:12:41 -0700 Subject: [CM] S7 & graphics with ImGui In-Reply-To: <682c8aff5388e57a7511bcc3fdaaab33@ccrma.stanford.edu> References: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> <682c8aff5388e57a7511bcc3fdaaab33@ccrma.stanford.edu> Message-ID: Christos, I'm really looking forward to checking this out and using it. I'd love to get it working on Max too in their open GL context. I was out of town all day so have not had a chance to watch this, but I have checked out the repo and I'm really glad you're doing this work and sharing it. That would have been me talking about Clojure I expect, and I agree wholeheartedly that something similar to Clojure's name-spacing and module system would be a great addition. I think an easy to use module/package system makes a massive difference to newbie users and is a really big part of Chicken's success as an accessible but real world usable scheme. To be honest, I think from what I've seen that there isn't going to be much for me to contribute there but I'll happily test and document any ideas for such a thing, and contribute in whatever way I can! On the topic of Clojure, I wound up here on a circuitous route that started with me discovering Clojure as my lisp gateway drug, and then hunting for something similar for music. I did find things like Overtone (Clojure front end to Super Collider) and Pink (Steven Yi's Clojure music platform), and I got ClojureScript working in Max with the node.script object, but ultimately came to the conclusion that the JVM was just a deal breaker and that the node environment didn't give me enough. S7 has really been a fantastic fit for what I was looking for with pretty much everything I liked about Clojure but dead easy to use in a performance critical environment. I'm certain we will attract more people from the same place if we add documentation and examples like this that help raise awareness in the non-academic computer music world and make it easy to test the waters. So yeah, that's my long-winded Canadian way of saying awesome work, and great to have you here! :-) iain On Sun, Aug 2, 2020 at 3:25 PM wrote: > I think s7's let is very similar to clojure's namespace. > (inlet 'x 1) creates a namespace with 'x bound > to 1, and (eval '(+ x 1) (inlet 'x 1)) is 2. Unless > otherwise specified, the "outlet" is the rootlet, so > to make an instance (so to speak) of the class > (inlet 'x 1), you could: > > (let ((class (inlet 'x 1))) > (let ((instance (inlet 'y 2))) > (set! (outlet instance) class) > (with-let instance > (+ x y)))) > > (let ((instance (inlet 'floor (lambda (x) 3.14)))) > (with-let instance (floor 1.5))) > > By using openlet, these lets can specialize built-in > functions (see mockery.scm) without having to change > to the instance namespace via with-let: > > (let ((instance (inlet 'object->string (lambda (obj . rest) "hi")))) > (openlet instance) > (object->string instance)) > > The hierarchy is the outlet chain. Locals can be added > with varlet, removed with cutlet, mapped over etc. > Another way to set up the chain is sublet: > > (let ((class (inlet 'x 1))) > (with-let (sublet class 'y 2) ; class=outlet + y=2 locally > (+ x y))) > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.actondev at gmail.com Mon Aug 3 08:20:54 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Mon, 3 Aug 2020 17:20:54 +0200 Subject: [CM] S7 & graphics with ImGui In-Reply-To: References: <73f4a8ebc14977b455c5c6c9df32bdb7@ccrma.stanford.edu> <682c8aff5388e57a7511bcc3fdaaab33@ccrma.stanford.edu> Message-ID: @Bil Wow, thanks for these snippets. I'm not really familiar yet with s7 let, will have these in mind. (openlet is still something I haven't touched, many possibilities with it - though could be "dangerous" in the sense that things are happening without being able to tell just by the code) @Iaian Thanks :) It's funny reading your clojure stories, cause I went though the same route more or less. And looking forward to sharing ideas etc, glad that you got the masters and you will be working with S7! Loving the community so far, I see plenty of enthusiasm around S7, and the support from Bil is great. Christos On Mon, 3 Aug 2020 at 05:13, Iain Duncan wrote: > Christos, I'm really looking forward to checking this out and using it. > I'd love to get it working on Max too in their open GL context. I was out > of town all day so have not had a chance to watch this, but I have checked > out the repo and I'm really glad you're doing this work and sharing it. > > That would have been me talking about Clojure I expect, and I agree > wholeheartedly that something similar to Clojure's name-spacing and module > system would be a great addition. I think an easy to use module/package > system makes a massive difference to newbie users and is a really big part > of Chicken's success as an accessible but real world usable scheme. To be > honest, I think from what I've seen that there isn't going to be much for > me to contribute there but I'll happily test and document any ideas for > such a thing, and contribute in whatever way I can! > > On the topic of Clojure, I wound up here on a circuitous route that > started with me discovering Clojure as my lisp gateway drug, and then > hunting for something similar for music. I did find things like Overtone > (Clojure front end to Super Collider) and Pink (Steven Yi's Clojure music > platform), and I got ClojureScript working in Max with the node.script > object, but ultimately came to the conclusion that the JVM was just a deal > breaker and that the node environment didn't give me enough. S7 has really > been a fantastic fit for what I was looking for with pretty much everything > I liked about Clojure but dead easy to use in a performance critical > environment. I'm certain we will attract more people from the same place if > we add documentation and examples like this that help raise awareness in > the non-academic computer music world and make it easy to test the waters. > > So yeah, that's my long-winded Canadian way of saying awesome work, and > great to have you here! :-) > iain > > On Sun, Aug 2, 2020 at 3:25 PM wrote: > >> I think s7's let is very similar to clojure's namespace. >> (inlet 'x 1) creates a namespace with 'x bound >> to 1, and (eval '(+ x 1) (inlet 'x 1)) is 2. Unless >> otherwise specified, the "outlet" is the rootlet, so >> to make an instance (so to speak) of the class >> (inlet 'x 1), you could: >> >> (let ((class (inlet 'x 1))) >> (let ((instance (inlet 'y 2))) >> (set! (outlet instance) class) >> (with-let instance >> (+ x y)))) >> >> (let ((instance (inlet 'floor (lambda (x) 3.14)))) >> (with-let instance (floor 1.5))) >> >> By using openlet, these lets can specialize built-in >> functions (see mockery.scm) without having to change >> to the instance namespace via with-let: >> >> (let ((instance (inlet 'object->string (lambda (obj . rest) "hi")))) >> (openlet instance) >> (object->string instance)) >> >> The hierarchy is the outlet chain. Locals can be added >> with varlet, removed with cutlet, mapped over etc. >> Another way to set up the chain is sublet: >> >> (let ((class (inlet 'x 1))) >> (with-let (sublet class 'y 2) ; class=outlet + y=2 locally >> (+ x y))) >> >> _______________________________________________ >> Cmdist mailing list >> Cmdist at ccrma.stanford.edu >> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >> > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 5 07:42:42 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 07:42:42 -0700 Subject: [CM] metaobject protocol for S7? In-Reply-To: <2932b724888de8b0d0c5b5538fb28800@ccrma.stanford.edu> References: <2932b724888de8b0d0c5b5538fb28800@ccrma.stanford.edu> Message-ID: Oops, forgot to reply to this, apologies! Thanks for this Bill. More again for me to read up on. Generally I agree that in my experience, composition makes for better maintenance over inheritance. But was curious. Thanks for your thoughts. iain On Sun, Aug 2, 2020 at 2:36 PM wrote: > stuff.scm has define-class, define-method, etc. I just use > openlets, where the outer let can be the "class" and each > instance inherits from it. I find this much more flexible > and easier to understand than CLOS-style machinery. I read > somewhere that this is called a "prototype system". I used > CLOS heavily in cmn (back in the 90's), and found that > the hierarchy simply made the code rigid (hard to change) > and opaque (hard to read/debug). A better debugger would have > helped, but this was back in the dark ages. Nowadays > everyone says you should keep your hierarchies as shallow > as possible, which means (does it not?) that no hierarchy > is best :) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 5 07:47:36 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 07:47:36 -0700 Subject: [CM] Anyone working on S7 to web assembly? Message-ID: So web assembly is an actual usable thing now, and there was much rejoicing! It seems to me that S7's ANSI C implementation ought to make it a good candidate for implementing in web assembly, which would be all kinds of cool for any web related projects. I gave it a crack and got some errors (just wanted to see if it would "just work"!), but thought I'd check whether this is on anyone else's radar or if anyone has thought about it. I think it would be dead cool to get Common Music working in a browser myself and would love to make a browser based demo/learning tool for Scheme for Max, but I expect the C innards to be above my head for managing this on my own. Anyone interested? :-) iain -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.actondev at gmail.com Wed Aug 5 11:25:25 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Wed, 5 Aug 2020 20:25:25 +0200 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: Message-ID: Hi Iain, I have indeed thought about it, one use-case for me would be the s7 & imgui thing running on web assembly. That could be doable in theory since what I'm using is SDL, opengl, ImGui.. all of which can be compiled to web assembly. But it hasn't been in my priorities at all. One other really nice usecase, as you mentioned, would be the "try online" thing for S7. Might take a quick look into it one of these days. I'm going on vacation though next week, so don't expect much during this month. Let's keep in touch though, and would be nice to see if anyone else would be interested. Christos On Wed, 5 Aug 2020 at 16:48, Iain Duncan wrote: > So web assembly is an actual usable thing now, and there was much > rejoicing! It seems to me that S7's ANSI C implementation ought to make it > a good candidate for implementing in web assembly, which would be all kinds > of cool for any web related projects. I gave it a crack and got some errors > (just wanted to see if it would "just work"!), but thought I'd check > whether this is on anyone else's radar or if anyone has thought about it. I > think it would be dead cool to get Common Music working in a browser myself > and would love to make a browser based demo/learning tool for Scheme for > Max, but I expect the C innards to be above my head for managing this on my > own. > > Anyone interested? :-) > iain > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Wed Aug 5 13:44:55 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 05 Aug 2020 13:44:55 -0700 Subject: [CM] =?utf-8?q?Anyone_working_on_S7_to_web_assembly=3F?= In-Reply-To: References: Message-ID: What problems did you hit? I just glanced at the web assembly docs and don't see anything impossible. Unaligned accesses and SIMD stuff (by which I assume they mean gcc/clang's vectorization) can be turned off via compiler switches. I do use longjmps to unwind the C stack -- is that what they mean by "up the unwound stack"? They are used for error handling, so if they're commented out, I think s7 will still run, but the C stack will grow. I haven't tried this, so I'm just guessing. The other limitation that might be tricky has to do with function type casts, but I don't remember playing games with those in s7. From iainduncanlists at gmail.com Wed Aug 5 14:08:35 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 14:08:35 -0700 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: Message-ID: Hi Bill, it was a month or so ago that I tried, so I can't recall OTO. But if you are interested in helping me troubleshoot (or perhaps more accurately, having me test..) I would be happy to give it a go again. I'm full up with a brief crunch of pay-the-bills work at the moment, but when I get a chance I'll give it a whirl again and post back my results. I'm very interested in this as one of my S7 related projects is music pedagogy app and it would be great to be able do web browser versions with the same engine that I am building up for use on Max and Juce. thanks! iain On Wed, Aug 5, 2020 at 1:44 PM wrote: > What problems did you hit? I just glanced at the > web assembly docs and don't see anything impossible. > Unaligned accesses and SIMD stuff (by which I assume > they mean gcc/clang's vectorization) can be > turned off via compiler switches. I do use longjmps > to unwind the C stack -- is that what they mean by > "up the unwound stack"? They are used for error > handling, so if they're commented out, I think > s7 will still run, but the C stack will grow. > I haven't tried this, so I'm just guessing. > The other limitation that might be tricky > has to do with function type casts, but I don't > remember playing games with those in s7. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Wed Aug 5 14:26:53 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 05 Aug 2020 14:26:53 -0700 Subject: [CM] =?utf-8?q?Anyone_working_on_S7_to_web_assembly=3F?= In-Reply-To: References: Message-ID: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> That would be great. To turn off unaligned accesses, set S7_ALIGNED to 1; to turn off vectorization, set WITH_VECTORIZE to 0. From iainduncanlists at gmail.com Wed Aug 5 14:33:54 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 14:33:54 -0700 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Cool, I'll let you know when I get a chance again. Might be able to later this week or on the weekend. :-) iain On Wed, Aug 5, 2020 at 2:26 PM wrote: > That would be great. To turn off unaligned accesses, > set S7_ALIGNED to 1; to turn off vectorization, set > WITH_VECTORIZE to 0. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.actondev at gmail.com Wed Aug 5 16:42:39 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Thu, 6 Aug 2020 01:42:39 +0200 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Good news. It works out of the box actually :) https://gist.github.com/actonDev/41067d7028051b7795b7f05c2d0f033b On Wed, 5 Aug 2020 at 23:34, Iain Duncan wrote: > Cool, I'll let you know when I get a chance again. Might be able to later > this week or on the weekend. :-) > > iain > > On Wed, Aug 5, 2020 at 2:26 PM wrote: > >> That would be great. To turn off unaligned accesses, >> set S7_ALIGNED to 1; to turn off vectorization, set >> WITH_VECTORIZE to 0. >> >> _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 5 17:27:22 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 17:27:22 -0700 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Awesome, thanks Christos! I must have just mucked it up somehow, being a pretty rusty C programmer, haha. Thanks for giving it a whirl, can't wait to try it out! iain On Wed, Aug 5, 2020 at 4:43 PM Christos Vagias wrote: > Good news. It works out of the box actually :) > > https://gist.github.com/actonDev/41067d7028051b7795b7f05c2d0f033b > > On Wed, 5 Aug 2020 at 23:34, Iain Duncan > wrote: > >> Cool, I'll let you know when I get a chance again. Might be able to later >> this week or on the weekend. :-) >> >> iain >> >> On Wed, Aug 5, 2020 at 2:26 PM wrote: >> >>> That would be great. To turn off unaligned accesses, >>> set S7_ALIGNED to 1; to turn off vectorization, set >>> WITH_VECTORIZE to 0. >>> >>> _______________________________________________ >> Cmdist mailing list >> Cmdist at ccrma.stanford.edu >> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 5 17:31:47 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 5 Aug 2020 17:31:47 -0700 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Aha, I see you are compiling it differently than what ever example I followed, and thus have posix working. I'm pretty sure it was popen that wouldn't work when I tried it now that I look at your example. sweeeeet.... Christos, maybe we can hack up a clojurescript page that runs an s7 interpreter in a fake terminal, that would be a nice little demo! I will definitely spend some time on this to see if I make some of my Max patches run with the webaudio API. iain On Wed, Aug 5, 2020 at 5:27 PM Iain Duncan wrote: > Awesome, thanks Christos! I must have just mucked it up somehow, being a > pretty rusty C programmer, haha. Thanks for giving it a whirl, can't wait > to try it out! > > iain > > On Wed, Aug 5, 2020 at 4:43 PM Christos Vagias > wrote: > >> Good news. It works out of the box actually :) >> >> https://gist.github.com/actonDev/41067d7028051b7795b7f05c2d0f033b >> >> On Wed, 5 Aug 2020 at 23:34, Iain Duncan >> wrote: >> >>> Cool, I'll let you know when I get a chance again. Might be able to >>> later this week or on the weekend. :-) >>> >>> iain >>> >>> On Wed, Aug 5, 2020 at 2:26 PM wrote: >>> >>>> That would be great. To turn off unaligned accesses, >>>> set S7_ALIGNED to 1; to turn off vectorization, set >>>> WITH_VECTORIZE to 0. >>>> >>>> _______________________________________________ >>> Cmdist mailing list >>> Cmdist at ccrma.stanford.edu >>> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.actondev at gmail.com Wed Aug 5 18:39:20 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Thu, 6 Aug 2020 03:39:20 +0200 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: @Iain Sounds like a plan! Let's continue discussing this in private. @Bil would you consider adding this patch https://gist.github.com/actonDev/41067d7028051b7795b7f05c2d0f033b#gistcomment-3406235 to S7? (or throwing an error like "process creation not supported in EMSCRIPTEN environment") With that the "ERROR_ON_UNDEFINED_SYMBOLS=0" is not even needed, so S7 seems to be wasm compatible. And to think that some months ago I was checking https://github.com/google/schism when I was pondering on a truly cross platform scheme (windows, linux, mac, mobile, web) We have to actually test it to see that everything works as expected, but it looks really good :) On Thu, 6 Aug 2020 at 02:31, Iain Duncan wrote: > Aha, I see you are compiling it differently than what ever example I > followed, and thus have posix working. I'm pretty sure it was popen that > wouldn't work when I tried it now that I look at your example. > > sweeeeet.... Christos, maybe we can hack up a clojurescript page that > runs an s7 interpreter in a fake terminal, that would be a nice little > demo! I will definitely spend some time on this to see if I make some of my > Max patches run with the webaudio API. > > iain > > > > On Wed, Aug 5, 2020 at 5:27 PM Iain Duncan > wrote: > >> Awesome, thanks Christos! I must have just mucked it up somehow, being a >> pretty rusty C programmer, haha. Thanks for giving it a whirl, can't wait >> to try it out! >> >> iain >> >> On Wed, Aug 5, 2020 at 4:43 PM Christos Vagias >> wrote: >> >>> Good news. It works out of the box actually :) >>> >>> https://gist.github.com/actonDev/41067d7028051b7795b7f05c2d0f033b >>> >>> On Wed, 5 Aug 2020 at 23:34, Iain Duncan >>> wrote: >>> >>>> Cool, I'll let you know when I get a chance again. Might be able to >>>> later this week or on the weekend. :-) >>>> >>>> iain >>>> >>>> On Wed, Aug 5, 2020 at 2:26 PM wrote: >>>> >>>>> That would be great. To turn off unaligned accesses, >>>>> set S7_ALIGNED to 1; to turn off vectorization, set >>>>> WITH_VECTORIZE to 0. >>>>> >>>>> _______________________________________________ >>>> Cmdist mailing list >>>> Cmdist at ccrma.stanford.edu >>>> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu Aug 6 02:57:00 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 06 Aug 2020 02:57:00 -0700 Subject: [CM] =?utf-8?q?Anyone_working_on_S7_to_web_assembly=3F?= In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Yes, I'll make that change later today -- thanks! From iainduncanlists at gmail.com Thu Aug 6 07:31:30 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Thu, 6 Aug 2020 07:31:30 -0700 Subject: [CM] questions about adding functionality on top of S7 Message-ID: Hi Bill (and anyone interested), I've been developing a personal convenience layer over top of S7 to add out of the box beginner and high level functionality to S7 for users of Scheme for Max, with the goal of ensuring that the experience for brand new users is as good as possible, but also so that the s4m object can be used purely as a message handler without having to add any code as well (i.e. for running one liners as max messages, essentially). These are mostly functions lifted from bigger schemes, and a few that are unique helpers but I find myself using all the time in Max so have them in my personal library. I feel like some are things a user should need to opt in to, but it would be nice if others were "just there" for my (future..) users. What I'm curious about is how you (Bill) decide what goes into the core S7 file and what should be loaded as extra files, For example, I want to add "first" and "rest" as aliases for car and cdr, as these are common in CL, Clojure, and Elixir, and make code much more readable for brand new lispers (IMHO). I could do this in C in my Max module, but then they are not available to people who want to use the same extension to S7 outside of Max (ie say in webassembly, woot!). I could make aliases at the Scheme level in an opt-in module, but then that adds an extra function call.... but maybe the engine is smart enough that this doesn't matter? Or would you entertain having the first and rest aliases in core S7? I totally understand if you want to keep core as small as possible and additions should always be opt-in if that's your philosophy. Similarly, I am wondering about square brackets. I couldn't figure out from the docs and repl what the S7 philosophy is on these. Racket makes them interchangeable with parens so they can be used for extra readability (i.e. enclosing cond clauses). Clojure makes them mean vectors. Curious whether they have a role in S7. I tried scanning through s7.html but there were 140 square parens from the C code.. haha I'd welcome your thoughts on this sort of thing so that I can so that I can do this in the way most helpful to users, but also least disruptive/irritating to you and core S7. thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Thu Aug 6 10:35:01 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Thu, 06 Aug 2020 10:35:01 -0700 Subject: [CM] questions about adding functionality on top of S7 In-Reply-To: References: Message-ID: <3f9a8267105f79d9d3b93af25a6947ed@ccrma.stanford.edu> I'd rather not add anything to s7, but there's no thought-out policy about this -- if something seems natural and useful, like macro (analogous to lambda), it might quietly sneak in. On square brackets, I think they make code harder to read. Using them as parentheses makes it impossible to use them in variable names. I'd like to avoid simple aliases like (define first car), although standard scheme forces (define call/cc call-with-current-continuation) on me. Could you use autoload? From iainduncanlists at gmail.com Thu Aug 6 10:44:41 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Thu, 6 Aug 2020 10:44:41 -0700 Subject: [CM] questions about adding functionality on top of S7 In-Reply-To: <3f9a8267105f79d9d3b93af25a6947ed@ccrma.stanford.edu> References: <3f9a8267105f79d9d3b93af25a6947ed@ccrma.stanford.edu> Message-ID: Hi Bill, I can absolutely contain it all in external Scheme files and use autoload. I just wanted to check first to make sure that was the right approach. Thanks for clarifying. And I will nix any square bracket ideas then, I'd like whatever I cook up to make sense as something that plugs into core S7 as sensibly and cleanly as possible. thanks iain On Thu, Aug 6, 2020 at 10:35 AM wrote: > I'd rather not add anything to s7, but there's no thought-out policy > about this -- if something seems natural and useful, like macro > (analogous to lambda), it might quietly sneak in. > On square brackets, I think they make code harder to read. > Using them as parentheses makes it impossible to use them > in variable names. I'd like to avoid simple aliases > like (define first car), although standard scheme forces > (define call/cc call-with-current-continuation) on me. > Could you use autoload? > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris.actondev at gmail.com Fri Aug 7 11:23:03 2020 From: chris.actondev at gmail.com (Christos Vagias) Date: Fri, 7 Aug 2020 20:23:03 +0200 Subject: [CM] Anyone working on S7 to web assembly? In-Reply-To: References: <89806197408dc8537db1c4dfe95f2a39@ccrma.stanford.edu> Message-ID: Hi all, Got a proof of concept & basic skeleton up in case anyone is interested. https://github.com/actonDev/s7-playground/ On Thu, 6 Aug 2020 at 11:57, wrote: > Yes, I'll make that change later today -- thanks! > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 12 10:36:27 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 12 Aug 2020 10:36:27 -0700 Subject: [CM] Saving entire state of the intrepreter? Message-ID: Hi folks, I've read about common lisp systems being able to save a snapshot of the entire state of the interpreter. I'm wondering if there is a way to do something similar with S7? For my apps t would be great to be able to reload a session with anon function defs reloaded. Apologies if this should be obvious from the docs, I'm not quite clear if serializing the environment would be the equivalent. thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Wed Aug 12 11:48:37 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Wed, 12 Aug 2020 11:48:37 -0700 Subject: [CM] =?utf-8?q?Saving_entire_state_of_the_intrepreter=3F?= In-Reply-To: References: Message-ID: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> There isn't a built-in way to save s7's state. I don't know how CL does it (unexec?), but I read recently (emacs 27 NEWS, I think) that emacs has abandoned unexec (does it use pdumper?). To write out everything in s7 as a scheme file -- I need to think about it -- it doesn't immediately strike me as impossible... From iainduncanlists at gmail.com Wed Aug 12 11:50:06 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 12 Aug 2020 11:50:06 -0700 Subject: [CM] Saving entire state of the intrepreter? In-Reply-To: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> References: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> Message-ID: Thanks Bill, I'd certainly be interested in hearing your thoughts on it. iain On Wed, Aug 12, 2020 at 11:48 AM wrote: > There isn't a built-in way to save s7's state. I don't know > how CL does it (unexec?), but I read recently (emacs 27 NEWS, > I think) that emacs has abandoned unexec (does it use pdumper?). > > To write out everything in s7 as a scheme file -- I need to > think about it -- it doesn't immediately strike me as impossible... > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From iainduncanlists at gmail.com Wed Aug 12 15:05:11 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Wed, 12 Aug 2020 15:05:11 -0700 Subject: [CM] Saving entire state of the intrepreter? In-Reply-To: References: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> Message-ID: I figured it might be potentially useful to describe what I'm hoping to do. I want to make a sequencing engine capable of sequencing deferred function calls, which is not hard to do when the interpreter is loaded as I can store lists in some structure that the clock part traverses. But I'd like it to be possible for a user at a repl to do something like insert an anonymous function on the timeline in order to make closures around other bits of state and have them captured for execution in a loop or whatever. So the tricky bit is how to store this such that one could close the session and reopen it, restoring those anon functions in their lists. So I guess this would mean being able to restore the environment and any function defs in that env. I think in common lisp this is called saving lisp images? One possibility I thought of in case storing state like that just not practical would be to have some mechanism where the repl events could be replayed from a log, but I would think the ability to save the interpreter would be better. thanks iain On Wed, Aug 12, 2020 at 11:50 AM Iain Duncan wrote: > Thanks Bill, I'd certainly be interested in hearing your thoughts on it. > > iain > > On Wed, Aug 12, 2020 at 11:48 AM wrote: > >> There isn't a built-in way to save s7's state. I don't know >> how CL does it (unexec?), but I read recently (emacs 27 NEWS, >> I think) that emacs has abandoned unexec (does it use pdumper?). >> >> To write out everything in s7 as a scheme file -- I need to >> think about it -- it doesn't immediately strike me as impossible... >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From orm.finnendahl at selma.hfmdk-frankfurt.de Fri Aug 14 09:19:06 2020 From: orm.finnendahl at selma.hfmdk-frankfurt.de (Orm Finnendahl) Date: Fri, 14 Aug 2020 18:19:06 +0200 Subject: [CM] Saving entire state of the intrepreter? In-Reply-To: References: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> Message-ID: <20200814161906.GB22850@t480s-orm.localdomain> Hi Iain, Am Mittwoch, den 12. August 2020 um 15:05:11 Uhr (-0700) schrieb Iain Duncan: > So I > guess this would mean being able to restore the environment and any > function defs in that env. I think in common lisp this is called saving > lisp images? in common lisp images are ok as long as you don't use external libs, (like qt, openGL or things in a multithreaded environment), therefore it's often useless in realtime work. I realize such things by storing functions not only as a compiled binary, but also its form (using macros for evaluation). To save it hasslefree I use cl-store. cl-store is a very neat common lisp package, which stores structs, classes and such to disk in a way that it can later be retrieved by simply loading it. cl-store doesn't save compiled functions, therefore I store the definitions (and not the binaries) in addition to all structs and instances and when pulling those structs back in from disk, the forms get automatically recompiled after loading and put at the appropriate places. I prefer this way of handling state, as you can store different instances of the state explicitely and macros make it easy to automate it in a way that you don't have to think about it anymore. -- Orm From bil at ccrma.Stanford.EDU Fri Aug 14 13:34:54 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Fri, 14 Aug 2020 13:34:54 -0700 Subject: [CM] =?utf-8?q?Saving_entire_state_of_the_intrepreter=3F?= In-Reply-To: <20200814161906.GB22850@t480s-orm.localdomain> References: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> <20200814161906.GB22850@t480s-orm.localdomain> Message-ID: I think you can mimic cl-store in s7; for example it's possible to call for-each on the repl's top let, omit functions that aren't interesting, and write the others using format with ~W or object->string with :readable. In repl.scm the top let is (*repl* 'top-level-let), so say we started that repl and typed: <1> (define (f1 x) (+ x 1)) f1 <2> (define f2 (let ((y 3)) (lambda (z) (+ y z)))) f2 Now we can save this to a file via: (call-with-output-file "saved-repl.scm" (lambda (p) (for-each (lambda (var&val) (unless (eq? (car var&val) 'exit) (format p "(define ~S ~W)~%" (car var&val) (cdr var&val)))) (*repl* 'top-level-let)))) The file has: (define f2 (let ((y 3)) (lambda (z) (+ y z)))) (define f1 (lambda (x) (+ x 1))) This can be used for (almost) anything (I used the top-level-let above for simplicity). You can use (*s7* 'file-names) to find what files need to be loaded. From iainduncanlists at gmail.com Fri Aug 14 14:50:26 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Fri, 14 Aug 2020 14:50:26 -0700 Subject: [CM] Saving entire state of the intrepreter? In-Reply-To: References: <96573c3d17caa38b00f8ccfef10d7127@ccrma.stanford.edu> <20200814161906.GB22850@t480s-orm.localdomain> Message-ID: Great, thanks for the tips guys. I will work on that and no doubt have questions later! iain On Fri, Aug 14, 2020 at 1:34 PM wrote: > I think you can mimic cl-store in s7; for example > it's possible to call for-each on the repl's top let, omit functions > that > aren't interesting, and write the others using format with ~W or > object->string > with :readable. In repl.scm the top let is (*repl* 'top-level-let), so > say > we started that repl and typed: > > <1> (define (f1 x) (+ x 1)) > f1 > <2> (define f2 (let ((y 3)) > (lambda (z) > (+ y z)))) > f2 > > Now we can save this to a file via: > > (call-with-output-file "saved-repl.scm" > (lambda (p) > (for-each > (lambda (var&val) > (unless (eq? (car var&val) 'exit) > (format p "(define ~S ~W)~%" (car var&val) (cdr var&val)))) > (*repl* 'top-level-let)))) > > The file has: > > (define f2 (let ((y 3)) (lambda (z) (+ y z)))) > (define f1 (lambda (x) (+ x 1))) > > This can be used for (almost) anything (I used the top-level-let > above for simplicity). You can use (*s7* 'file-names) to > find what files need to be loaded. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From j_hearon at hotmail.com Mon Aug 31 10:57:59 2020 From: j_hearon at hotmail.com (James Hearon) Date: Mon, 31 Aug 2020 17:57:59 +0000 Subject: [CM] O.T. compositions Message-ID: Hi, I'm wondering if there are any Schottstaedt compositions available someplace on the net for listening? Regards, Jim -------------- next part -------------- An HTML attachment was scrubbed... URL: From deeteeoh1138 at gmail.com Mon Aug 31 12:35:09 2020 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Mon, 31 Aug 2020 15:35:09 -0400 Subject: [CM] O.T. compositions In-Reply-To: References: Message-ID: There are several on Youtube. You can start here: https://www.youtube.com/watch?v=xgcOG5wxGZo :) hope you enjoy On Mon, Aug 31, 2020 at 1:58 PM James Hearon wrote: > Hi, > > I'm wondering if there are any Schottstaedt compositions available > someplace on the net for listening? > > Regards, > Jim > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bil at ccrma.Stanford.EDU Mon Aug 31 12:39:43 2020 From: bil at ccrma.Stanford.EDU (bil at ccrma.Stanford.EDU) Date: Mon, 31 Aug 2020 12:39:43 -0700 Subject: [CM] O.T. compositions In-Reply-To: References: Message-ID: <58336858f29b35271ca12b171177d53d@ccrma.stanford.edu> Geez, I had not searched for myself online for years -- they have pictures of me from the 70's and as a kid, of my father and sisters, and a half-dozen tunes, and then I listened to water music, and I still like it years later. The Samson box was a wonderful musical instrument. From deeteeoh1138 at gmail.com Mon Aug 31 12:49:23 2020 From: deeteeoh1138 at gmail.com (David O'Toole) Date: Mon, 31 Aug 2020 15:49:23 -0400 Subject: [CM] O.T. compositions In-Reply-To: <58336858f29b35271ca12b171177d53d@ccrma.stanford.edu> References: <58336858f29b35271ca12b171177d53d@ccrma.stanford.edu> Message-ID: ???? On Mon, Aug 31, 2020 at 3:39 PM wrote: > Geez, I had not searched for myself online for years -- > they have pictures of me from the 70's and as a kid, of > my father and sisters, and a half-dozen tunes, and then > I listened to water music, and I still like it years later. > The Samson box was a wonderful musical instrument. > > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: From juanig at ccrma.Stanford.EDU Mon Aug 31 16:22:05 2020 From: juanig at ccrma.Stanford.EDU (Juan I Reyes) Date: Mon, 31 Aug 2020 16:22:05 -0700 Subject: [CM] O.T. compositions Message-ID: Hey, Water Music sounds great!. One more kudos for ("v.ins") Even in <> Stereo <> seems ]]-3D-[[ Thanks for the YT links. -- Juan From iainduncanlists at gmail.com Mon Aug 31 14:31:41 2020 From: iainduncanlists at gmail.com (Iain Duncan) Date: Mon, 31 Aug 2020 14:31:41 -0700 Subject: [CM] O.T. compositions In-Reply-To: References: <58336858f29b35271ca12b171177d53d@ccrma.stanford.edu> Message-ID: Well this seems like a perfect time to post this gem from 1982 that I found in Andrew Schloss's office! :-) iain On Mon, Aug 31, 2020 at 12:49 PM David O'Toole wrote: > ???? > > On Mon, Aug 31, 2020 at 3:39 PM wrote: > >> Geez, I had not searched for myself online for years -- >> they have pictures of me from the 70's and as a kid, of >> my father and sisters, and a half-dozen tunes, and then >> I listened to water music, and I still like it years later. >> The Samson box was a wonderful musical instrument. >> >> _______________________________________________ >> Cmdist mailing list >> Cmdist at ccrma.stanford.edu >> https://cm-mail.stanford.edu/mailman/listinfo/cmdist >> > _______________________________________________ > Cmdist mailing list > Cmdist at ccrma.stanford.edu > https://cm-mail.stanford.edu/mailman/listinfo/cmdist > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Bill_Andy_poster.jpg Type: image/jpeg Size: 3076063 bytes Desc: not available URL: