From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 38FD2BC51 for ; Mon, 29 Nov 2004 04:21:19 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAT3LIWA018713 for ; Mon, 29 Nov 2004 04:21:18 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA07827 for ; Mon, 29 Nov 2004 04:21:18 +0100 (MET) Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAT3LHiO018708 for ; Mon, 29 Nov 2004 04:21:17 +0100 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CYc6H-0005wD-00 for ; Mon, 29 Nov 2004 04:21:17 +0100 Received: from panic.cs.bris.ac.uk ([137.222.103.158]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Nov 2004 04:21:16 +0100 Received: from brown by panic.cs.bris.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 29 Nov 2004 04:21:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Julian Brown Subject: Re: Could be Caml a good language for sound manipulation ? Date: Mon, 29 Nov 2004 03:21:09 +0000 (UTC) Organization: University of Bristol Message-ID: References: <41AA5C8C.2010503@free.fr> Reply-To: brown@cs.bris.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: panic.cs.bris.ac.uk User-Agent: slrn/0.9.8.1 (Debian) Sender: news X-Miltered: at concorde with ID 41AA95AE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41AA95AD.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; bris:01 wrote:01 ocaml:01 ocaml:01 recursive:01 low-level:01 ioctl:01 interfacing:01 bris:01 lablgtk:01 cheers:01 tar:01 short:01 functions:01 functions:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On 2004-11-28, Elthariel wrote: > Hello "les Cémaliens", > I'm quite new in oCaml world, I partially learnt it in my school (EPITA > / Paris) and I'm going to finish this next year. I'm not really ease in > english so my question will be short : do you think Caml coul be a nice > langage for sound manipulation implementation, as Synthetizers, effects > plugins ? I doesn't ask for answer in term of performance which should > be I guess quite good :p, but more in term of software design and > language facility. I can't really answer this very sensibly with my extremely limited experience in the area, but I will try anyway! I think that performance problems may hit you sooner than you might hope for real-time stuff. I was slightly surprised that my naive first attempt at audio-type programming with Ocaml failed to fill buffers fast enough with a bytecode-compiled executable, though native code is fine (this was on a 1GHz Athlon, YMMV). The trancendental functions and non-tail recursive functions I used might have something to do with it though. As for the manipulation of sound itself, yes, Ocaml is a lovely language! It may be better to stick with an imperative rather than functional programming style though, for reasons of performance. Also, under Linux, the low-level ioctl calls are a total pain, and require interfacing to C. You can have a look at this as an example if you like, though I don't expect it will be very useful to you: http://panic.cs.bris.ac.uk/~jules/beepy.tar.bz2 It needs lablgtk2, and probably won't work on anything but Linux. It's only been tested on x86. The sound.ml/sountctl.c files might be a useful starting point for some sort of sound output library, if you can't find anything else more suitable. Cheers, Julian