[music-dsp] Open source Scripting engine or simiar

Ross Bencina rbencina at iprimus.com.au
Mon Sep 29 04:08:01 EDT 2003


After re-reading the original post I don't think there is enough information
to suggest that threads are needed, or that threads are not needed.

I saw "real-time" and assumed that there would be at a minimum 2 threads - a
real-time synthesis thread, and some kind of control thread which deals with
non-real-time interaction (GUI or networking for example). It is true that
you could run you scripts just in the audio synthesis thread, but even then,
any kind of locking in the interpreter is a bad thing imho.

But you are right... there may be no need for interaction between threads
and script interpreter.

I've been looking at the SC3 source code recently, and it seems to place
control script and DSP in separate _processes_. presumably with no real-time
constraints on scripts, and no audio-synchronous scripting capabilities.

Ross.



Jens Blomquist:
>
> Just out of curiosity...
>
> Why do you need threads at all for such an application. As I understand,
> from the original post, the modules will be processed in sequence.
>
> /Jens
>
> ----- Original Message -----
> From: "Ross Bencina" <rbencina at iprimus.com.au>
> To: <music-dsp at aulos.calarts.edu>
> Sent: Monday, September 29, 2003 11:11 AM
> Subject: Re: [music-dsp] Open source Scripting engine or simiar
>
>
> > Hi David
> >
> > This has come up before on the list, you may want to search the archive,
> > some options which I have considered include:
> >
> > Python (www.python.org)
> > Lua (www.lua.org)
> > SuperCollider (www.audiosynth.com)
> > JavaScript/ECMAScript (www.mozilla.org)
> >
> > Then there's the gazillion scheme variants, any number of FORTH
> > implementations, etc. You could also consider a lightweight Java
> > implementation.
> >
> > The general opinion around here seems to be that making existing
scripting
> > languages work for real-time environments generally boils down to two
> > things: (a) their ability to run in multiple threads concurrently, and
(b)
> > their ability to do real-time memory management.
> >
> > (a) depends on not having a global interpreter lock - which at least
> Python
> > has.
> >
> > (b) depends on using a real-time garbage collector, since reference
> counting
> > is not considered to be a viable way to manage memory for real-time
apps.
> >
> > I think the SuperCollider Lang already fulfills the requirements, and
Lua
> > would if you plugged in your own real-time GC (search archives for
details
> > of this). Assuming you can live with FORTH's low level nature it might
do
> > the job too.
> >
> > Hope that gives you some ideas. Let us know if you discover anything
else.
> >
> > Best wishes
> >
> > Ross.
> >
> >
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "David Brännvall" <davidbrannvall at home.se>
> > To: <music-dsp at aulos.calarts.edu>
> > Sent: Monday, September 29, 2003 6:31 PM
> > Subject: [music-dsp] Open source Scripting engine or simiar
> >
> >
> > > Hi, I am looking for a free efficient scripting engine! What I want to
> > > do is to be able to build custom modules for my modular framework
> > > (written in c++)! It is going to be a realtime application, but the
> > > scripted modules will only handle logics, and will only be processed
> > > once between each audioblock. A module can register inputs, outputs
and
> > > parameters. All parameters and samples are floats (between 0 and 1). I
> > > want the language to be as easy as possible to understand for the
users!
> > >
> > > Example, a module could be defined something like this:
> > >
> > > ModuleAddScale {
> > >   Sample scale; // define a varible
> > >
> > >   /* init function */
> > >   void OnInit()
> > >   {
> > >     // register inputs
> > >     SetInputCount(2);
> > >     SetInputName(0, "in1");
> > >     SetInputName(1, "in2");
> > >
> > >     // register outputs
> > >     SetOutputCount(2);
> > >     SetOutputName(0, "out");
> > >
> > >     // register parameters
> > >     SetParameterCount(1);
> > >     SetParameterName(0, "scale");
> > >
> > >     // initlialize variables
> > >     scale = GetParameter(0);
> > >   }
> > >
> > >   /* main function */
> > >   void OnProcessFrame()
> > >   {
> > >     SetOutput(0, (GetInput(0) + GetInput(1)) * scale);
> > >   }
> > >
> > >   /* parameter changed function */
> > >   void OnParamChange(uint32 index)
> > >   {
> > >     // update variables
> > >     scale = GetParameter(0);
> > >   }
> > > };
> > >
> > > Hope you understand what I mean. My question is ofcourse, if you
> > > know/recommend a good scripting engine/language to use?
> > >
> > > best regards,
> > > David
> > >
> > > dupswapdrop -- the music-dsp mailing list and website:
> > > subscription info, FAQ, source code archive, list archive, book
reviews,
> > dsp links
> > > http://shoko.calarts.edu/musicdsp
> > > http://ceait.calarts.edu/mailman/listinfo/music-dsp
> >
> > dupswapdrop -- the music-dsp mailing list and website:
> > subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> > http://shoko.calarts.edu/musicdsp
> > http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp




More information about the music-dsp mailing list