Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Csound API to Web based frontend

Date2007-11-06 19:35
FromMichael Gogins
Subject[Csnd] Re: Re: Csound API to Web based frontend
There is a rudimentary web server that actually comes with Python, CGIHTTPServer. It could be used in conjunction with the cgi module which handles CGI requests in Python.

CGIHTTPServer/cgi could instantiate Csound and operate Csound inside a form request handler. In other words, write your Web server in CCGIHTTPServer, write a Web page in HTML with a form for running Csound, write a Python CGI handler for that page, install page and handler in your server. The handler could easily be coded to run Csound from the fields in the CGI request. The CGI handler could even return an MP3 to the user, and the browser should be able to figure out how to play it.

Real-time audio is problematic. You could certainly handle soundfiles or MP3s. You could shell out from Python to translate Csound output soundfiles to MP3s and programmatically build a Web page with a link to the file.

Probably there is a way to do real-time audio, but I can't think of it off the top of my head.

You could also use Plone (may be huge overkill, may be big win) to do this. Plone is an open source content management system written in Python. CMS include, of course, a Web server.

Intermediate between CGI stuff and Plone are a bunch of things... see: 

http://pypi.python.org/pypi?:action=browse&c=319&c=326&c=333

Some blog servers might allow you to set up CGI handlers. You could then use the Python cgi thing...

If I were doing this, I would probably use Plone, because it is absolutely the easiest way to set up a decent looking Web server. Basically, once you install Plone, you have a working Web server plus an intuitive, interactive way to add and edit Web pages. You get user forums, news, etc., etc., etc. But tying Csound into Plone might require some study.

Hope this helps,
Mike


-----Original Message-----
>From: Chuckk Hubbard 
>Sent: Nov 6, 2007 12:37 PM
>To: csound@lists.bath.ac.uk
>Subject: [Csnd] Re: Csound API to Web based frontend
>
>On 11/5/07, David Akbari  wrote:
>>
>> Hi List,
>>
>> It has been a while since I've posted anything. I hope you are all
>> well! I've been quite busy as I'm sure you have as well.
>>
>> My question is, would it currently be possible using the most recent
>> "official release" to deploy a system that:
>>
>> * Runs the Csound executables __on the server__
>>
>> * Can use the API or some other means to communicate data to a web based
>> GUI
>>
>> * Is either close to real-time or uses some abstracted form of fout to
>> buffer performance to an audio file to stream to the listener.
>
>
>I've never done anything like this, so I can't advise as to how to set it
>up, but I'm certain it's doable.  I know there are browser plugins for
>Tcl/Tk, but I don't know how hard it would be to make one from TclCsound.
>Or maybe a Java applet?
>
>-Chuckk
>
>-- 
>http://www.badmuthahubbard.com




Date2007-11-06 21:57
From2g
Subject[Csnd] Re: Re: Re: Csound API to Web based frontend
AttachmentsNone  

Date2007-11-07 23:42
From"David Akbari"
Subject[Csnd] Re: Re: Re: Re: Csound API to Web based frontend
AttachmentsNone  

Date2007-11-08 21:35
Fromjoachim heintz
Subject[Csnd] Re: Re: Re: Re: Re: Csound API to Web based frontend
I think this is an important point, David. There should be a balance  
between the "old" Csound, which has to be as simple as possible (easy  
to install, simple GUI, good examples), and the "renewing" Csound,  
which has to integrate recent developments in programming (e.g.  
Python in Csound or the Python API). Looking for this balance can  
just  be a never ending story. I am grateful to the developers,  
because in general I find Csound5 a good solution for this difficult  
job. But we should try to make some things easier. When I am working  
with students of composition, they should find Csound as easy to  
install and to use as PD or so. But usually they are saying the same  
words as Dr. B. reported: "We tried to install Csound but it's not  
working." They know a lot in composing and they want to learn Csound,  
but they don't know Python and .dll. I agree with David: no one  
should be forced to install Python for using Csound. Can't there be a  
"core version" which gives messages like: 'You have not installed  
Python and ... on your system. You can run Csound but not use the  
Python (Fluid ...) opcodes.'?

	joachim


Am 08.11.2007 um 00:42 schrieb David Akbari:

> Thank you for your suggestions,
>
> I'd prefer NOT to use Python. I really like the language but it is in
> my experience, a major barrier to getting people into the Csound
> language. Csound itself is daunting enough without bringing in the
> idea of using Python. It is a nice extra and it should remain exactly
> that, an *extra*.
>
> The dependency on Python for Windows based systems needs to be
> removed. Users should not be expected to install Python just to use
> the program; it's fine the build system is in Python but Python is
> more of a language for people really into programming and as such it
> shouldn't be necessary to get sound out of Csound.
>
> My goal in creating this thread is to make Csound more accessible to a
> wider range of people - specifically individuals in
> speech-language-hearing science who have not and will not ever be
> "programmers".
>
> Csound can be a powerful pedagogical tool but it's a shame that I will
> not be able to explain concepts using Csound's elegant encapsulation
> of many synthesis and acoustic phenomenon because we are unable to
> install Python in the labs.
>
>
>
> David Akbari
>


Date2007-11-08 21:58
From"Steven Yi"
Subject[Csnd] Re: Re: Re: Re: Re: Re: Csound API to Web based frontend
AttachmentsNone  

Date2007-11-08 22:30
From"David Akbari"
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Csound API to Web based frontend
AttachmentsNone