[Csnd-dev] S7 scheme and Csound 7
Date | 2024-09-25 22:02 |
From | Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> |
Subject | [Csnd-dev] S7 scheme and Csound 7 |
Maybe Iain Duncan can comment on this. I’ve recently contributed bindings for SBCL and was interested in investigating bindings for Scheme. Looking around for a suitable version, I seemed to recall a mention of S7 scheme, but that wasn’t on the list of the “most popular” scheme implementations. Then I googled it and saw Iain’s name alongside so then I remembered he had added it to Max. So the idea of S7 seems to be that it’s just a Scheme interpreter you can add as an extension to your system. It comes as a single source file and a header. I thought maybe it would be straightforward to offer an S7 with built-in Csound 7 host API bindings. Then we could run Csound from S7 scheme (as we can from SBCL etc). Maybe it would be a neat application for live coding. Perhaps that would allow easy Common Music integration since CM also runs from S7? Thoughts? ======================== Prof. Victor Lazzarini Maynooth University Ireland |
Date | 2024-09-26 08:16 |
From | Michael Gogins |
Subject | Re: [Csnd-dev] S7 scheme and Csound 7 |
This is an excellent idea. Does S7 Scheme have the ability to declare and call foreign functions? On Wed, Sep 25, 2024, 23:02 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote: Maybe Iain Duncan can comment on this. |
Date | 2024-09-26 08:39 |
From | Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
Attachments | favicon.ico |
Looks like it's a core feature
Prof. Victor Lazzarini
Maynooth University
Ireland
On 26 Sep 2024, at 08:17, Michael Gogins <michael.gogins@gmail.com> wrote:
|
Date | 2024-09-26 09:30 |
From | Michael Gogins |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
Attachments | favicon.ico |
Would it make more sense to have the FFI in the Csound 7 repository, or in the S7 Scheme distribution? ----------------------------------------------------- Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Thu, Sep 26, 2024 at 9:40 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
|
Date | 2024-09-26 09:40 |
From | vlz |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
I don't know actually. It's an unusual case, where the bindings are actually C code. Prof. Victor Lazzarini Maynooth University Ireland On 26 Sep 2024, at 09:31, Michael Gogins <michael.gogins@gmail.com> wrote:
|
Date | 2024-10-17 14:43 |
From | Iain Duncan |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
hi guys, I could definitely help on this. As I have my hand in many pies right now, I don't read this list all the time, so please feel free to directly add me to any emails to get my attention! iainctduncan@gmail.com (I will see if I can set up an automated Bat-Light filter on my name or something too) The "normal" way to do this, as far as how s7 is designed, would be to put the bindings in the C or C++ host. One of the major points in s7's favour is that bindings are dead easy (MUCH easier than with Racket or ECL for example.) You can very easily manipulate the Scheme environment from C calls. So for live coding one would likely work in an s7 session that calls into Csound. This is roughly what I do in Scheme for Max. I have created code to allow s7 to manipulate various Max globals, including buffer, and one can schedule s7 functions of the Max clock (the killer feature for my priorities). I could see that being pretty cool. I was also thinking of possibly building such a thing for Max, in a combined Csound/s4m object so that s7 code could tap directly into csound space rather than having to go through Max space. I was separately also thinking of doing something like this in a JUCE host, which would give us a more modern and capable version of Heinrich Taube's "Grace" - Grace will output to Csound but as far as I know does not give one Csound API access. One could also host s7 *in* Csound I suppose, but I'm less clear how that would work or what one would gain. Do people still use Python *from* csound for example or is it mostly the other way around? s7 has no GIL, and the GC is fast, but it's not incremental tricolor GC the way Roger Dannenberg's Serpent is. (I would like to build such a thing for s7 but that is probably years out). You can turn it off or run it on a timer mind you. The main thing I wonder about is syntax - embedding in Max and PD works really well because going from Max/PD message format to Scheme is very simple - space separated tokens, nothing special in Scheme about commas, etc). I can essentially build and send tiny Scheme programs in Max. Maybe in modern Csound this is possible too? As for where, it would make sense to be in the Csound repo as it needs to be in a *separate host*. Bill S. likes to keep s7 very lean, but is very helpful when it comes to getting it working in other things. If there is one of these that someone wants to hack on, please let me know and I would help out. I would also be happy to do a group zoom and discuss! iain On Thu, Sep 26, 2024 at 1:40 AM vlz <viclazzarini@gmail.com> wrote:
|
Date | 2024-10-17 14:51 |
From | Iain Duncan |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
I should have also mentioned that Grace & Common Music are no longer really under active development as Heinrich teaches with Python now (school's decision), so there is potential value in a Grace replacement with better Csound integration built on JUCE 8. For those who don't know, JUCE is double licensed, so it can be used under GPL free. This would likely be of interest in the wider audio world too as JUCE is still for sure the most used plugin framework, and the JUCE 8 license is much improved (quite a high revenue threshold now before even commercial users need to buy licenses). Also worth mentioning, I *just* started discussions with Roger Dannenberg about getting O2 (newer, more capable version of OSC) working in Max and that could be something that would be cool to add to the mix. I know very little about it yet except that what he can do with HTH On Thu, Oct 17, 2024 at 6:43 AM Iain Duncan <iainduncanlists@gmail.com> wrote:
|
Date | 2024-10-17 15:19 |
From | Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
It all makes sense. I think a good test would be to write a CLI repl for S7 with Csound bindings to start with. Then this can be further embedded in other applications. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 17 Oct 2024, at 14:51, Iain Duncan |
Date | 2024-10-17 15:25 |
From | Iain Duncan |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
Actually that would be a very nice addition wouldn't it? One thing I do in Max is send code directly to the interpreter from Vim over osc, which is a really nice way to work. (I know, it should be emacs... one day.. lol) I do this by having a script catch the vim buffer output and piping over STDOUT to osc, and that could just as easily be piped into a CLI repl host. The thing that makes it fun for me is the scheduler integration. What I do in Max is have a registry in C and in s7 for scheduled calls registered by Scheme gensym handles. The engine uses the Max clocks to fire those which get the gensym handle in C, and then call whatever Scheme function is registered in s7. This lets me run arbitrary Scheme closures at whatever time resolution I want and is a wonderfully easy way to make sequencers. I'm not sure how that should be done off Csound's clocking but I would imagine it would be simple. If anyone is interested in hacking on this with me, please let me know. iain On Thu, Oct 17, 2024 at 7:19 AM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote: It all makes sense. I think a good test would be to write a CLI repl for S7 with Csound bindings to start with. |
Date | 2024-10-17 15:30 |
From | vlz |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
Well, with Csound bindings the control over processing is yours so you can do pretty much anything you’d like. > On 17 Oct 2024, at 15:25, Iain Duncan |
Date | 2024-10-17 15:43 |
From | Iain Duncan |
Subject | Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7 |
So were you imagining a plain portaudio C or C++ host then? On Thu, Oct 17, 2024 at 7:30 AM vlz <viclazzarini@gmail.com> wrote: Well, with Csound bindings the control over processing is yours so you can do pretty much anything you’d like. |