| 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
|