Re: [Csnd-dev] [EXTERNAL] Re: [Csnd-dev] S7 scheme and Csound 7

Iain Duncan <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <CAN9NcLyiQdnmsht2qo1x9qjN+22Xwbxo7sVpqkn-38v=iv6zhw@mail.gmail.com>
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! [email protected]
(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 <[email protected]> wrote:

> 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 <[email protected]> wrote:
>
> 
> Would it make more sense to have the FFI in the Csound 7 repository, or in
> the S7 Scheme distribution?
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Thu, Sep 26, 2024 at 9:40 AM Victor Lazzarini <
> [email protected]> wrote:
>
>> Looks like it's a core feature
>>
>> s7 <https://ccrma.stanford.edu/software/snd/snd/s7.html>
>> ccrma.stanford.edu <https://ccrma.stanford.edu/software/snd/snd/s7.html>
>> <favicon.ico>
>> <https://ccrma.stanford.edu/software/snd/snd/s7.html>
>> <https://ccrma.stanford.edu/software/snd/snd/s7.html>
>>
>>
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>>
>> On 26 Sep 2024, at 08:17, Michael Gogins <[email protected]>
>> wrote:
>>
>> 
>> *Warning*
>>
>> This email originated from outside of Maynooth University's Mail System.
>> Do not reply, click links or open attachments unless you recognise the
>> sender and know the content is safe.
>> 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 <
>> [email protected]> wrote:
>>
>>> 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
>>>
>>>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.