Csound Csound-dev Csound-tekno Search About

Where is kdump ?!

Date1998-11-08 16:08
FromYair Kass
SubjectWhere is kdump ?!
I can't seem to find the documentation on 'kdump' kdump2' etc...
opcodes.
They appears on the index of the HTML-help file but nothing is actually
there.
i hope i'm mistaking.
am i ?
where is it ?
anybody ?
;-}

yair

Date1998-11-09 13:04
Fromjpff@maths.bath.ac.uk
SubjectRe: Where is kdump ?!
First these names are not good ones, and in my next version they are
renamed dumpk etc.  
  They print vakues at k-rate.

==John


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18078;
          9 Nov 98 14:41 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa17876;
          9 Nov 98 14:41 GMT
Received: (qmail 25715 invoked from network); 9 Nov 1998 14:41:28 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 9 Nov 1998 14:41:28 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (OAA18386); Mon, 9 Nov 1998 14:28:13 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 14:27:57 GMT
Received: from server8.wans.net [216.75.0.36] by hermes via ESMTP (OAA23998); Mon, 9 Nov 1998 14:27:53 GMT
Received: (from uucp@localhost)
	by server8.wans.net (8.8.8/8.8.8) id IAA11805
	for ; Mon, 9 Nov 1998 08:27:47 -0600 (CST)
Received: from slip-32-100-252-247.ny.us.ibm.net(32.100.252.247), claiming to be "oemcomputer"
 via SMTP by server8.wans.net, id smtpdAAAa002sL; Mon Nov  9 08:27:42 1998
From: Bill DeWitt 
To: csound@maths.ex.ac.uk
MMDF-Warning:  Parse error in original version of preceding line at UK.AC.Bath.maths.stork
Subject: RE: silence is not golden!!!
Date: Mon, 9 Nov 1998 09:27:45 -0500
Message-ID: <000101be0bed$1e25c8e0$f7fc6420@oemcomputer>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
In-Reply-To: <36467666.88D4D63@freewwweb.com>
X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3
Importance: Normal
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk


> but all that I got in return was silence
> is this normal???

	I get this all the time. Sometimes it is from cut and paste letting
comments flow over to the next line, other times I never figure it out.
	I haven't gotten that Glissando to work yet. It tells me that there is an
error on line 27 but I don't see one.



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18101;
          9 Nov 98 14:59 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa19761;
          9 Nov 98 14:59 GMT
Received: (qmail 27770 invoked from network); 9 Nov 1998 14:59:35 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 9 Nov 1998 14:59:35 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (OAA16386); Mon, 9 Nov 1998 14:46:54 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 14:46:39 GMT
Received: from root@jason02.u.washington.edu [140.142.76.8] by hermes via ESMTP (OAA22254); Mon, 9 Nov 1998 14:46:33 GMT
Received: from homer34.u.washington.edu (karpen@homer34.u.washington.edu [140.142.77.15])
          by jason02.u.washington.edu (8.8.4+UW97.07/8.8.4+UW98.06) with ESMTP
	  id GAA22614; Mon, 9 Nov 1998 06:46:28 -0800
Received: from localhost (karpen@localhost)
          by homer34.u.washington.edu (8.8.4+UW97.07/8.8.4+UW98.06) with SMTP
	  id GAA222460; Mon, 9 Nov 1998 06:46:27 -0800
Date: Mon, 9 Nov 1998 06:46:27 -0800 (PST)
From: Richard Karpen 
To: Olivier Pasquet 
cc: csound@maths.ex.ac.uk
Subject: Re: GENDY orchestra?
In-Reply-To: 
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk



> I am still looking for a way to do time stretching in real-time from a mic
> source.

there are ugens in csound for writing into tables. I've never used them,
but I've been meaning to try to do time-stretching with an incoming
live signal using them. For example: try writing the signal into
a table (tablew is the Ugen I think) and then using that table in sndwarp.

Cheers,

Richard Karpen




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18135;
          9 Nov 98 15:19 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa21762;
          9 Nov 98 15:19 GMT
Received: (qmail 29761 invoked from network); 9 Nov 1998 15:19:24 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 9 Nov 1998 15:19:24 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA21491); Mon, 9 Nov 1998 15:01:17 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 15:00:55 GMT
Received: from jaguars-int.cableinet.net [193.38.113.9] by hermes via SMTP (PAA16411); Mon, 9 Nov 1998 15:00:54 GMT
Received: (qmail 23300 invoked from network); 9 Nov 1998 14:58:33 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.54)
  by jaguars with SMTP; 9 Nov 1998 14:58:33 -0000
Message-ID: <36470392.790B4935@cableinet.co.uk>
Date: Mon, 09 Nov 1998 15:00:34 +0000
From: Richard Dobson 
Organization: Composers Desktop Project
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: Re: GENDY orchestra?
References: 
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id PAA16411
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

I have a basic phase vocoder running in realtime on the ADI SHARC
EZ-KIT; it can also be done on any sufficiently fast PC (400Mhz?)
(though there is a little bug in the resynthesis, in all the public
distributions  (F.R. Moore, book, princeton, etc) that has to be fixed,
to get the audio clean over long time-periods).=20

However, I don't understand exactly what it is you want - surely you
don't mean 'real-time audio i/o time-stretching'? This would mean either
an enormous accumulating bottleneck inside the computer, as you play out
audio slower than it comes in, or something defying the laws of phsyics
it you want it emerging faster than it comes in!

If you just mean 'very fast processing on disk', well, any pvoc
implementation should be able to do it (~pace~ the bug aforementioned).


Richard Dobson

Olivier Pasquet wrote:
>=20
> Hello,
>=20
> I am still looking for a way to do time stretching in real-time from a =
mic
> source.
>=20
> I am also looking for a Dynamic Stochastic Synthesis orchestra or softw=
are for
> pc or mac.
> I do not have time to do one by myself. If I am able to do one...
>=20
> Yours,
>=20
>                                                               Olivier P=
asquet.
>=20
> --------------------
> News: Laborintus II, Luciano Berio. Concert the 15th of December 1998. =
Anglia
> Philharmonic Orchestra, Paul Jackson conducting, Olivier Pasquet
> spacialisation. East Road Cambridge - 8.30pm - =A38.
> ++++
> News: Cambridge Digital Art Festival begins the 21th of June 1999. Ask =
me for
> more information.
> --------------------
> Olivier PASQUET -- APU -- Music Faculty
> OP101@mercury.anglia.ac.uk
> www.sinclair.anglia.ac.uk/~op101.student.cambridge.anglia
> --------------------


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18217;
          9 Nov 98 15:51 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa25055;
          9 Nov 98 15:51 GMT
Received: (qmail 5942 invoked from network); 9 Nov 1998 15:51:36 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 9 Nov 1998 15:51:36 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA00356); Mon, 9 Nov 1998 15:36:27 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 15:36:10 GMT
Received: from neptune.lyrick.com [38.227.100.46] by hermes via ESMTP (PAA15057); Mon, 9 Nov 1998 15:36:08 GMT
Received: by NEPTUNE with Internet Mail Service (5.5.2232.9)
	id ; Mon, 9 Nov 1998 09:31:50 -0600
Message-ID: <283AABB8FD0DD21187C200A0C995F5DE0ECD49@NEPTUNE>
From: David Boothe 
To: 'Yair Kass' , 
    Csound list 
Subject: RE: Where is kdump ?!
Date: Mon, 9 Nov 1998 09:31:45 -0600 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2232.9)
Content-Type: text/plain;
	charset="iso-8859-1"
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

You can find the docs in the pdf Version 3.49 of the manual at
http://web2.airmail.net/dboothe

Since John said the names will change in a later version, I will change the
docs then too. I assume they work with the name kdump, etc., in the current
version, but I've never used them myself.

-David.

> -----Original Message-----
> From: Yair Kass [mailto:ykass@netvision.net.il]
> Sent: Sunday, November 08, 1998 10:08 AM
> To: Csound list
> Subject: Where is kdump ?!
> 
> 
> I can't seem to find the documentation on 'kdump' kdump2' etc...
> opcodes.
> They appears on the index of the HTML-help file but nothing 
> is actually
> there.
> i hope i'm mistaking.
> am i ?
> where is it ?
> anybody ?
> ;-}
> 
> yair
> 


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18298;
          9 Nov 98 16:17 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa27671;
          9 Nov 98 16:17 GMT
Received: (qmail 27564 invoked from network); 9 Nov 1998 16:16:27 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 16:16:27 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA23271); Mon, 9 Nov 1998 16:05:05 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 16:04:24 GMT
Received: from falcon.glas.apc.org [193.124.5.54] by hermes via ESMTP (QAA25871); Mon, 9 Nov 1998 16:04:13 GMT
Received: from mail.glas.apc.org([193.124.5.37]) (1628 bytes) by falcon.glas.apc.org
	via sendmail with P:esmtp/R:inet_hosts/T:inet_zone_smtp
	(sender: ) 
	id 
	for ; Mon, 9 Nov 1998 19:03:50 +0300 (WSU)
	(Smail-3.2.0.103 1998-Oct-9 #3 built DST-Oct-20)
Received: from default(src addr [195.218.251.165]) (1236 bytes) by mail.glas.apc.org
	via sendmail with P\:esmtp/R:smart_host/T:smtp
	(sender: ) 
	id 
	for ; Mon, 9 Nov 1998 19:03:23 +0300 (WSU)
	(Smail-3.2.0.96 1997-Jun-2 #11 built DST-Aug-25)
Message-Id: 
From: Sergey 
To: atomicFLY 
Cc: csound@maths.ex.ac.uk
MMDF-Warning:  Parse error in original version of preceding line at UK.AC.Bath.maths.stork
Subject: Re: silence is not golden!!!
Date: Mon, 9 Nov 1998 16:53:52 +0300
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id QAA25871
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Luis Jure advised to use

f03	0	1025	19	1	.5	270	.5

instead of
=20
f03	0	2049	1	6	0

in endless.sco=20
It works very well.

Sergey Batov   batov@glasnet.ru

----------
> =CE=F2: atomicFLY 
> =CA=EE=EC=F3: csound@maths.ex.ac.uk
> =D2=E5=EC=E0: silence is not golden!!!
> =C4=E0=F2=E0: 9 =ED=EE=FF=E1=F0=FF 1998 =E3. 7:58
>=20
> I'm a new guy to csound.
> and have tried to use many of the examples provided
> I was interested in the endless glissando and
> used the .orc and .sco files from
>
ftp://ftp.musique.umontreal.ca/pub/mirrors/dream/platforms/pc/orchestras+=
sco



>=20
> but all that I got in return was silence
> is this normal??? didn't think so
> the .wav is there but contains silence!!!!
> please help
> thanks,
> steb.
>=20


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18314;
          9 Nov 98 16:22 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa28197;
          9 Nov 98 16:22 GMT
Received: (qmail 28543 invoked from network); 9 Nov 1998 16:21:27 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 16:21:27 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA23325); Mon, 9 Nov 1998 16:03:02 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 16:02:28 GMT
Received: from icarus.dur.ac.uk [129.234.1.2] by hermes via ESMTP (QAA13440); Mon, 9 Nov 1998 16:02:21 GMT
Received: from mercury (mercury.dur.ac.uk [129.234.4.40])
	by icarus.dur.ac.uk (8.9.1/8.9.1) with SMTP id QAA03046;
	Mon, 9 Nov 1998 16:01:59 GMT
Received: from altair by mercury id ; Mon, 9 Nov 1998 16:01:58 GMT
Date: Mon, 9 Nov 1998 16:01:58 +0000 (GMT)
From: Manning 
Reply-To: Manning 
To: Jeffrey John Hall 
cc: csound 
Subject: Re: gen01from M360
In-Reply-To: <3644C6DB.6E2A@erols.com>
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

In order to help this enquiry re substitutes for the old Gen01, Gen13, and
gen03 in MUSIC360 (see below) it might be helpful to quote from the 1973
MIT manual what these functions used to do, and then let the experts
have a go:-

"Gen01:  This routine simply stores 512 values along a monotonic curve.
the first value (before rescaling) is p(4) and the last p(6).  The shape
of the curve is determined by p(5) which is the middle value according  to
the following formula :  f(y)= x**(y[squared]) where f(0)=p(4),
f(.5)=p(5), and f(1)=p(6).  From this information the routine determines
the values of x and z.  the principle use of this routine is to control
produced amplitude as a function of intended loudness.  Neither a straight
line nor an exponential curve is a very good approximation to this
relation:  Gen01 can conveniently provide a plausible intermediate shape.  
(Note:  Gen01 also allows the alternative of specifying the exponent z in
the above formula directly.  If p(5) is zero, z=p(7) and f(.5) is
calculated accordingly.)"

"Gen13:  This routine simply stores 512 values along a monotonic curve
like Gen01; but in this case only the first and last values are specified
and interpolation is made according to the SONE scale of amplitude
relationship.  (This scale was devised by S.S. Stevens, and is described
in  The Journal of the Acoustical Society of America, Vol. 27, No. 5, Sept
1955)  Thus Gen13 may provide a better approximation to perceived loudness
than Gen01 or any other Gen-subroutine.  p(4) and p(5) specify the initial
and terminal values, and all other parameter fields are ignored"

[The information on the old Gen03 makes explicit reference to Gen05.
Fortunately Gen05 has survived intact from Music360, though Music11 to
Csound...!!]

"Gen03:  This routine is the same as Geno5 except that the number of
values on a given segment is not specified directly.  The function is
expected to be...treated as a formant function of the fixed frequencies
from 0 to (511/512ths of 1/2 of the sampling rate) Hertz.  In the
odd-numbered P-fields the user specifies in 8VE.PC form the pitch to be
associated with the value given in the next P-field

For the same reason as Gen05, zero values must not be used.  Also the
pitches must be given in rising order, and no two must be the same, foir
this would amount to an instruction to store a segment with no values.

Example:

p(4)    p(5)    p(6)    p(7)    p(8)    p(9)    p(10)    p(11)   p(12)
  1     8.09     20     9.09     5      10.09     20     11.00      1

This card[!!] calls for a formant-function with peaks at A (440 Hertz) and
at the A two octaves above, with a trough at the intervening octave and a
steep cutoof after the second peak.  Component partials close to the peaks
will be relatively amplified, but not as much as components coinciding
exactly with the peaks, etc.

Note that since harmonic particals of a given tone are equally spaced in
Hertz, the increase or decrease from one harmonic within a segment to the
next is by equal proportions."

It is interesting to note, incidentally, that MUSIC360 also offered a unit
generator known as FORMNT which did not survive to Music11 and Csound. 


Peter Manning
Music Dept, University of Durham, UK

**********************************************************


On Sat, 7 Nov 1998, Jeffrey John Hall wrote:

> Hello,
>                   I have a considerable background in the M360           
>         ancestor of Csound. While much is the same and accordingly
>         I've been able to translate and expand a fair amount of my old
>         stuff (dating back to 1982), there are a few things that don't
>         seem to have a ready equivalent, at least without a lot of grunt
>         work. Sooooo, it seems that a more efficient way is to ask    
>         whether any antediluvians recall the old Gen01, Gen13, & Gen03,
>         subroutines, and what might be their best substitutes in Csound.
>         I have been able to utilize the "new" Gen05, Gen06, Gen08, and 
>         Gen09, Gen10, but am most concerned with getting something to do 
>         the equivalent of the old Gen01, inter alia.
>                   So, if anyone recalls and can point me where to grub
>         I'll be very grateful.
>                             Thanks and good Luck to All,
>                                                     Jeff Hall
> 





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18418;
          9 Nov 98 17:10 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa03254;
          9 Nov 98 17:10 GMT
Received: (qmail 6184 invoked from network); 9 Nov 1998 17:10:27 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 17:10:27 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA02182); Mon, 9 Nov 1998 16:54:51 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 16:54:39 GMT
Received: from outbound.Princeton.EDU [128.112.129.74] by hermes via ESMTP (QAA24837); Mon, 9 Nov 1998 16:54:38 GMT
Received: from IDENT-NOT-QUERIED@outbound.Princeton.EDU (port 63355 [128.112.129.74]) by outbound.Princeton.EDU with ESMTP id <67506-3442>; Mon, 9 Nov 1998 11:54:31 -0500
Received: from silvertone.Princeton.EDU (silvertone.Princeton.EDU [128.112.142.58])
	by Princeton.EDU (8.9.1/8.9.1) with ESMTP id LAA16175;
	Mon, 9 Nov 1998 11:54:25 -0500 (EST)
Received: (from koonce@localhost)
	by silvertone.Princeton.EDU (8.9.1/8.9.1) id LAA25887;
	Mon, 9 Nov 1998 11:54:24 -0500 (EST)
Date: 	Mon, 9 Nov 1998 11:54:24 -0500 (EST)
From: Paul Koonce 
To: Richard Dobson 
cc: csound@maths.ex.ac.uk
Subject: Re: GENDY orchestra?
In-Reply-To: <36470392.790B4935@cableinet.co.uk>
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk



On Mon, 9 Nov 1998, Richard Dobson wrote:

> (though there is a little bug in the resynthesis, in all the public
> distributions  (F.R. Moore, book, princeton, etc) that has to be fixed,
> to get the audio clean over long time-periods). 

I am very interested to know what the bug is that you have found.

Paul Koonce



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18459;
          9 Nov 98 17:24 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa04702;
          9 Nov 98 17:24 GMT
Received: (qmail 8010 invoked from network); 9 Nov 1998 17:24:34 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 17:24:34 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (RAA12101); Mon, 9 Nov 1998 17:10:59 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 17:10:46 GMT
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (RAA17223); Mon, 9 Nov 1998 17:10:45 GMT
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 1.92 #2)
	id 0zcupz-0007H2-00; Mon, 9 Nov 1998 17:10:47 +0000
Date:     Mon, 9 Nov 98 17:10:46 GMT
From: J P Fitch 
To: David Boothe 
cc: 'Yair Kass' , 
    Csound list 
Subject:  Re:  Where is kdump ?!
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

My current test version accepts kdump and dumpk, but outputs a message in the
case of kdump asking one to change.
  Similarly for kon and a few others.
==John


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19070;
          9 Nov 98 20:41 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa23673;
          9 Nov 98 20:41 GMT
Received: (qmail 27285 invoked from network); 9 Nov 1998 20:41:47 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 20:41:47 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (UAA09215); Mon, 9 Nov 1998 20:37:30 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 20:37:18 GMT
Received: from smtp1.erols.com [207.172.3.234] by hermes via ESMTP (UAA19367); Mon, 9 Nov 1998 20:37:17 GMT
Received: from oemcomputer (207-172-125-10.s10.as10.nyb.erols.com [207.172.125.10])
	by smtp1.erols.com (8.8.8/8.8.5) with SMTP id PAA21118
	for ; Mon, 9 Nov 1998 15:37:18 -0500 (EST)
Message-ID: <364752B7.7844@erols.com>
Date: Mon, 09 Nov 1998 15:38:15 -0500
From: Paul Winkler 
Reply-To: zarmzarm@erols.com
X-Mailer: Mozilla 3.03 (Win95; I)
MIME-Version: 1.0
To: Csound mailing list 
Subject: OOP or not? (perl Csound module)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Greetings, Csound users and Perl hackers. This message is being posted
to the Csound mailing list, and to comp.lang.perl.misc.

(I already sent this to the Csound list, but I think it bounced-- I sent
it from a non-subscribed account.)

The purpose of this letter is to announce a project I'm working on,
which I'm calling Pscore (short for Perl-score). It aims to be a Perl
library (probably to be called Csound::Pscore) intended to allow Csound
composers to write their score files directly in Perl. It will be
released under the GNU Public License.

I'm inviting suggestions, input, commentary, offers of collaboration,
etc., from any interested parties... hence this announcement. The main
question I have right now is whether or not to take an object-oriented
approach. Below, I'll explain why I can't decide...

To those unfamiliar with either language:

------- begin boring intro blah-blah ------------

Perl (http://www.perl.org) is ... oh, c'mon, you know what Perl is. It's
a fairly easy-to-learn language that excels at (among other things)
processing text, and it's been ported to all the platforms Csound runs
on (I think).

Briefly, Csound is a language for generating digital sound by creating
an "orchestra" file (basically a collection of virtual synthesizers) and
a "score" file (a collection of events in time which are passed to the
orchestra for rendering into digital audio). It is notoriously flexible
and notoriously difficult. It's been ported to a wide variety of
platforms including many flavors of Unix, Mac, and Wintel.

Csound score files are made entirely of... guess what... text. Each line
is an event, split into "p-fields": p1 gives the instrument number from
the score to use; p2 gives the time the event starts; p3 gives the
duration of the event; and an arbitrary number of following pfields do
any damn thing you want them to.

Csound has a new home page in progress at:
http://www.ping.be/calliope/Csound/
And an outdated front page at:
http://www.leeds.ac.uk/music/Man/c_front.html

------ end boring intro blah-blah. -----------

Now, why would I want a perl Csound::Pscore library?

What started the idea was being frustrated with the Csound standard
numeric score. The S.N.S. does (recently) allow for repeated sections
and macros, but in limited ways. For instance, there's no way to write
two different repeating sections that overlap in time, except to put
them in separate .sco files, invoke csound to do all the soring etc.,
and then find and combine the relevant parts of the output score.srt
files by hand. YUCK.

I posted a question about this to the Csound mailing list months ago,
and Eric Lyon wrote me to suggest using a scripting language to do it,
in particular Perl. I'd been interested in Perl, but Eric's mail was the
straw that, er, broke the camel's back, so I got "Learning Perl" and
have gone through the whole book and many of the Perl man pages.
 
While thinking about the original problem, I thought of all sorts of
other fun things you could implement while you were solving it!

For instance:
--Create a named sequence of events (let's call it a "pattern").
--Play arbitrarily selected sections of named patterns.
--Extensively modify arbitrarily selected sections of patterns.
--More easily & flexibly specify the timing of patterns relative to
other events... I've put a lot of thought into how to handle keeping
track of & using timing...
--Score-level global variables could be useful for lots of things and
could be generated in all kinds of interesting ways.

These ideas have obvious implications for composers. It should be a lot
easier to write any kind of repetitious music, and it could be a very
useful environment for playing with algorithmic composition.

When I started working on the project a month or so ago, I was basically
inventing a new score language, a "meta-score" if you will, that would
be interpreted by a Perl script which would output a score useable by
Csound. This approach quickly seemed short-sighted: Why invent a new
language that's not useful for any other purpose? Why not re-implement
my functions as a Perl library, allowing one to basically compose music
directly in Perl? That way, anyone who knows Perl and Csound would
already know the syntax, and would just have to learn some new
functions. And if something was lacking from the capabilities I'd
already provided for, you could quickly roll your own in plain old Perl,
and add code to the module if it's something that would be useful in the
future.

Some knowledgeable Csounders might be saying, "Why don't you just learn
Common Music?" (CM has a page at
http://ccrma-www.stanford.edu/CCRMA/Software/cm/cm.html ... which begins
like this:

"Common Music (CM) is an object-oriented music composition environment.
It produces sound by transforming a high-level representation of musical
structure into a variety of contol protocols for sound synthesis and
display: MIDI, Csound, Common Lisp Music, Music Kit, C Mix, C Music,
M4C, RT, Mix, VRML and Common  Music Notation. Common Music defines an
extensive library of compositional tools and provides a public interface
through which the composer may easily modify and extend the system."
It's implemented in Lisp and has a Lisp-like syntax.

Well, the answer is: Eventually, I might. It looks like pretty much
everything I want to do with composition is do-able in CM.

But for now:
--I don't know Lisp at all.
--I like Perl.
--Lots of other people like Perl and don't know Lisp.
--Some of those people might be fellow Csounders.
--There is room for many ways to generate Csound scores... and this
might be a very useful addition to the existing tools (CM, Cscore, SCOT,
cecilia & cybil, SILENCE, HPKComposer, Midi2CS, ermmm... what else?)
--Just for the heck of it, it would probably be pretty easy to add a
graphical front-end in Perl/TK.

Commentary is welcome. Probably the best forum for discussion of these
ideas is the Csound mailing list, except for technical questions about
Perl which belong in comp.lang.perl.misc.

As I said, the big question is whether to take an OOP approach or not.

Reasons Why OOP:
--might make usage syntax easier? We're dealing with a pretty unwieldy
data structure (see below).
--might make extension of the module easier?

Reasons Why NOT OOP:
--I don't really understand OOP.
--I think I know how to do what I want in traditional programming.
--Don't have to worry about mucking around outside of established class
methods.

The main issue is whether or not an OOP approach would make the system
easier to use? Remember, the scripts we're writing with this Perl module
are compositions, not applications!  So it's important that they be
quick & easy to write, and easy to read.

Probably at this point it would be helpful if I gave an example of what
I want to be able to do.

OK... here's a sample composition (or "script" if you prefer), though
all these functions are purely hypothetical and might end up with
different names and arguments... sorry for any blatantly bad code:

#!/usr/bin/perl -w
use Csound::Pscore;

pattern_from_file(Verse1, "some-score-file.sco", [ 4 .. 10 ]);
# We keep stuff in a big data 
# structure: a hash of list refs. of list refs. The hash keys
# are pattern names; the first-level list is of line numbers; the
# second-level list contains each line's pfields.
# pattern_from_file() would take three args: a name to give this
# pattern, a file to read score events from, and a reference to an
# array tells which lines we want. In this case it's an anonymous
# array which says use lines 4 to 10. The array could as easily be
# generated by a function...   Anyway, moving on:

play(Verse1, 2); # Plays Verse1 twice.
rewind(); # Set time to whatever it was when the last function was
          # called.
play(Verse2);    # Plays Verse2 at same start time as the first
                 # Verse1. If rewind() hadn't been there, it would
                 # come after the Verse1's...
                 # and there's lots of ways to do things like that.

select_pat(Verse2); # load it but don't do anything yet.
shuffle_pfield (pfield(5, beats(4 to 9),  *= 2));
play();

# set Verse2 as the "current pattern", do some interesting things
# to it (but don't save the changes!), and play the modified version.
# Here's what the shuffle_pfield(... line does:
# Read the fifth "p-field", a.k.a. p5,
# from any events occurring between
# beats 4 and 9 in the current pattern, and then multiply those p5's
# by 2, and then shuffle them randomly back into the lines they came
# from. Fun stuff! We can do this because shuffle_pfield expects
# an int (the pfield) followed by an array ref. (which line numbers?)
# as its arguments, and that's exactly what
# pfield() returns...




So, there's a taste of the ideas I have... there's lots more but this
message is already too long.

Am I nuts for doing things this way? Would OOP make life easier or
harder? If I followed an OOP strategy, what might the above code look
like? Are there some existing Perl modules that might be useful? (I
haven't found any yet...)

Please comment!

Thanks,

Paul Winkler
http://members.tripod.com/~slinkP/index.html


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19117;
          9 Nov 98 21:06 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa25847;
          9 Nov 98 21:06 GMT
Received: (qmail 29016 invoked from network); 9 Nov 1998 21:06:10 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 21:06:10 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (VAA07430); Mon, 9 Nov 1998 21:01:09 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 21:00:58 GMT
Received: from graphics.lcs.mit.edu [18.24.2.30] by hermes via ESMTP (VAA02537); Mon, 9 Nov 1998 21:00:57 GMT
Received: from guache.lcs.mit.edu (guache.lcs.mit.edu [18.24.2.78])
	by graphics.lcs.mit.edu (8.9.0/8.9.0) with ESMTP id QAA17372;
	Mon, 9 Nov 1998 16:01:01 -0500 (EST)
Received: from localhost (aisaksen@localhost)
	by guache.lcs.mit.edu (8.9.0/8.9.0) with SMTP id QAA20973;
	Mon, 9 Nov 1998 16:01:01 -0500 (EST)
X-Authentication-Warning: guache.lcs.mit.edu: aisaksen owned process doing -bs
Date: Mon, 9 Nov 1998 16:01:01 -0500 (EST)
From: Aaron Isaksen 
To: Paul Winkler 
cc: Csound mailing list 
Subject: Re: OOP or not? (perl Csound module)
In-Reply-To: <364752B7.7844@erols.com>
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

> For instance:
> --Create a named sequence of events (let's call it a "pattern").
> --Play arbitrarily selected sections of named patterns.
> --Extensively modify arbitrarily selected sections of patterns.
> --More easily & flexibly specify the timing of patterns relative to
> other events... I've put a lot of thought into how to handle keeping
> track of & using timing...
> --Score-level global variables could be useful for lots of things and
> could be generated in all kinds of interesting ways.

This PERL module would be useful, but not just to CSound users.  If you
are mostly concerned with the score file part of CSound, then I wouldn't
make it only for CSound.  Why not output MIDI score, or some other kind?

So, if you think that you'd want your functions to sometimes output MIDI,
and sometimes output CSound .sco, then you probably want an object
oriented programming approach.


-Aaron




Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19178;
          9 Nov 98 21:41 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa29000;
          9 Nov 98 21:41 GMT
Received: (qmail 1433 invoked from network); 9 Nov 1998 21:41:52 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 21:41:52 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (VAA06962); Mon, 9 Nov 1998 21:39:04 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 21:38:53 GMT
Received: from alpha.netvision.net.il [194.90.1.13] by hermes via ESMTP (VAA25076); Mon, 9 Nov 1998 21:38:51 GMT
Received: from netvision.net.il (RAS2-p10.hrz.netvision.net.il [62.0.153.138])
	by alpha.netvision.net.il (8.8.6/8.8.6) with ESMTP id XAA11566
	for ; Mon, 9 Nov 1998 23:34:55 +0200 (IST)
Message-ID: <364760ED.2242ED0E@netvision.net.il>
Date: Mon, 09 Nov 1998 23:38:53 +0200
From: Yair Kass 
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: Csound list 
Subject: Here is kdump !
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Thank you  all for answering my 'kdump' question.
This list is a treasure.

yair



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19188;
          9 Nov 98 21:45 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa29395;
          9 Nov 98 21:45 GMT
Received: (qmail 1648 invoked from network); 9 Nov 1998 21:45:56 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 21:45:56 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (VAA04132); Mon, 9 Nov 1998 21:42:09 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 21:41:56 GMT
Received: from jaguars-int.cableinet.net [193.38.113.9] by hermes via SMTP (VAA17534); Mon, 9 Nov 1998 21:41:55 GMT
Received: (qmail 16570 invoked from network); 9 Nov 1998 21:39:33 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.147)
  by jaguars with SMTP; 9 Nov 1998 21:39:33 -0000
Message-ID: <3647618F.CFCC979@cableinet.co.uk>
Date: Mon, 09 Nov 1998 21:41:35 +0000
From: Richard Dobson 
Organization: Composers Desktop Project
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: Paul Koonce 
CC: csound@maths.ex.ac.uk
Subject: Re: GENDY orchestra?
References: 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

It's very simple really: in teh pvoc resynthesis code, this line is used
to track output phase:

	lastphase[i] += C[freq] - i* fundamental;
(quoting from  the F.R  Moore book - the princeton sources are
essentially the same)
The problem is that what is being stored (in a float) is not phase +-
PI, but actual frequencies, and after a  more-or-less long while, the
float value overflows. The result is progressive distortion of the
sound, over 15 - 30 mins.

My fix is to store a real wraparound phase instead, exactly as is done
already in the synthesis part:

	float angledif;
	
	angledif = (TWOPI / srate) * (C[freq] - i * fundamental);
	lastphase[i] = fmod(lastphase[i] * angfledif, TWOPI);

The fmod is expensive, of course, but concise here.

And, of course, for the short pvoc runs which most people do, this
problem doesn't arise.


Richard Dobson


Paul Koonce wrote:
> 
> On Mon, 9 Nov 1998, Richard Dobson wrote:
> 
> > (though there is a little bug in the resynthesis, in all the public
> > distributions  (F.R. Moore, book, princeton, etc) that has to be fixed,
> > to get the audio clean over long time-periods).
> 
> I am very interested to know what the bug is that you have found.
> 
> Paul Koonce


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19333;
          9 Nov 98 22:22 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa02685;
          9 Nov 98 22:22 GMT
Received: (qmail 4163 invoked from network); 9 Nov 1998 22:22:11 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 9 Nov 1998 22:22:11 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (WAA03432); Mon, 9 Nov 1998 22:19:06 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 9 Nov 1998 22:18:55 GMT
Received: from mx2.freewwweb.com [205.181.80.249] by hermes via ESMTP (WAA05003); Mon, 9 Nov 1998 22:18:53 GMT
Received: from freewwweb.com (ppp-212.tnt-1.atl.smartworld.net [209.64.214.212])
	by mx2.freewwweb.com (8.9.1/8.9.1) with ESMTP id RAA21666251;
	Mon, 9 Nov 1998 17:20:33 -0500 (EST)
Message-ID: <364794BB.5DAF2872@freewwweb.com>
Date: Mon, 09 Nov 1998 17:19:55 -0800
From: atomicFLY 
X-Mailer: Mozilla 4.5b2 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Sergey 
CC: csound@maths.ex.ac.uk
Subject: Re: silence is not golden!!!
References: 
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by exeter.ac.uk id WAA05003
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Thanks this worked very nice
I also changed the header
peace,
steb.


Sergey wrote:

> Luis Jure advised to use
>
> f03     0       1025    19      1       .5      270     .5
>
> instead of
>
> f03     0       2049    1       6       0
>
> in endless.sco
> It works very well.
>
> Sergey Batov   batov@glasnet.ru
>
> ----------
> > =CE=F2: atomicFLY 
> > =CA=EE=EC=F3: csound@maths.ex.ac.uk
> > =D2=E5=EC=E0: silence is not golden!!!
> > =C4=E0=F2=E0: 9 =ED=EE=FF=E1=F0=FF 1998 =E3. 7:58
> >
> > I'm a new guy to csound.
> > and have tried to use many of the examples provided
> > I was interested in the endless glissando and
> > used the .orc and .sco files from
> >
> ftp://ftp.musique.umontreal.ca/pub/mirrors/dream/platforms/pc/orchestra=
s+sco
>
> >
> > but all that I got in return was silence
> > is this normal??? didn't think so
> > the .wav is there but contains silence!!!!
> > please help
> > thanks,
> > steb.
> >



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19629;
          10 Nov 98 1:53 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa22212;
          10 Nov 98 1:53 GMT
Received: (qmail 27390 invoked from network); 10 Nov 1998 01:53:33 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 10 Nov 1998 01:53:33 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (BAA14891); Tue, 10 Nov 1998 01:50:49 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 01:50:39 GMT
Received: from howl.werewolf.net [206.103.224.20] by hermes via ESMTP (BAA04085); Tue, 10 Nov 1998 01:50:37 GMT
Received: from default (dial38.werewolf.net [206.103.225.48])
	by howl.werewolf.net (8.9.0/8.9.0) with SMTP id TAA18259
	for ; Mon, 9 Nov 1998 19:45:31 -0600 (CST)
Message-ID: <001801be0c4d$046e38a0$30e167ce@default>
From: Hans Mikelson 
To: Csound mailing list 
Subject: Re: OOP or not? (perl Csound module)
Date: Mon, 9 Nov 1998 19:54:12 -0600
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

PW wrote:

>select_pat(Verse2); # load it but don't do anything yet.
>shuffle_pfield (pfield(5, beats(4 to 9),  *= 2));
>play();

I have not done too much OOP lately and not in Perl but I think it might
look something like if it were in C++ style:

Verse Verse1(pattern_from_file("some-score-file1.sco",[4 .. 10]));
Verse Verse2(pattern_from_file("some-score-file2.sco",[4 .. 10]));
Timer Time(0)

Verse1.Play(Time, 2);
Time.Set(0);
Verse2.Play(Time, 1);
Verse2.Shuffle(5, Beats(4, 9), 2); ???
Verse2.Play(Time, 1);

Something like that.  I'm sure the C++ guru's can give better examples.
Some of the advantages lie in functions name clutter.  You could have
Verse.Play() do one thing and Pattern.Play() and Song.Play(), do something
else.  The three main ideas behind object oriented programming are
encapsulation, inheritance and polymorphism.  Encapsulation as far as I
understand means that the variables and the functions are contained in the
class so that other classes can have the same local variables and local
functions without bugging neighboring classes.

I think Polymorphism means that a function can do different things depending
on the data you give it.  A good example would be overloading + to do
something like:

int a=3, b=7;
c=a + b;
print(c);

10

string c="three", d="seven", e;
e=c + d;
print(e);

threeseven

Finally inheritance means that one class can inherit properties from a base
class.

I usually find that OOP makes things easier to use once you learn it.
Another advantage of OOP would be if you are writing large complex
applications with many different people.  OOP generally makes for slower
bigger code.  In this case the application is probably not time critical so
that won't matter.  Some applications seem to be naturally object oriented
like windows systems with buttons, menus, scroll bars, etc.  I can't tell if
this one is or not.  If you have lots of different objects with lots of
similar operations performed on them like init, play, etc. then OO would be
useful.

One of the applications for a scoring language for me would be to call lots
of different fractals so it might be good to grab some equations from
fracint.

http://spanky.triumf.ca/www/fractint/fractint.html

These can probably be implemented as subroutines pretty easily though.  I
started writing a Perl program which used fractals to generate score events
in a granular synthesis fashion.

Regards,
Hans Mikelson





Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20151;
          10 Nov 98 8:07 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa26696;
          10 Nov 98 8:07 GMT
Received: (qmail 18876 invoked from network); 10 Nov 1998 08:07:41 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 10 Nov 1998 08:07:41 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (IAA01307); Tue, 10 Nov 1998 08:03:14 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 08:03:03 GMT
Received: from mailb.telia.com [194.22.194.6] by hermes via ESMTP (IAA18179); Tue, 10 Nov 1998 08:03:02 GMT
Received: from d1o211.telia.com (root@d1o211.telia.com [195.204.228.241])
	by mailb.telia.com (8.8.8/8.8.8) with ESMTP id JAA09561
	for ; Tue, 10 Nov 1998 09:01:49 +0100 (CET)
Received: from rogernt (t1o211p45.telia.com [195.204.228.45]) by d1o211.telia.com (8.8.8/8.6.12) with SMTP id JAA15602 for ; Tue, 10 Nov 1998 09:01:50 +0100 (MET)
Message-ID: <002701be0c80$840e27e0$0300a8c0@apas.no>
From: roger klaveness 
To: csound 
Subject: Re: OOP or not? (perl Csound module)
Date: Tue, 10 Nov 1998 09:02:20 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.00.0518.4
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0518.4
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

>I think Polymorphism means that a function can do different things
depending
>on the data you give it.  A good example would be overloading + to do

Not exactly, that is operator overloading
Here is a definition
http://webopedia.internet.com/TERM/p/polymorphism.html

---------------------------snip---------------------------------------
---------

polymorphism

Generally, the ability to appear in many forms. In object-oriented
programming, polymorphism refers to a programming language's ability
to process objects differently depending on their data type or class.
More specifically, it is the ability to redefine methods for derived
classes. For example, given a base class shape, polymorphism enables
the programmer to define different circumference methods for any
number of derived classes, such as circles, rectangles and triangles.
No matter what shape an object is, applying the circumference method
to it will return the correct results. Polymorphism is considered to
be a requirement of any true object-oriented programming language
(OOPL).

---------------------------snip---------------------------------------
---------



/*
   f(roger klaveness) = ( roger@apas.no || roklaven@c2i.net ) +
http://home.c2i.net/roklaven/
*/



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20198;
          10 Nov 98 8:27 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa28502;
          10 Nov 98 8:27 GMT
Received: (qmail 29853 invoked from network); 10 Nov 1998 08:27:22 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 10 Nov 1998 08:27:22 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (IAA12001); Tue, 10 Nov 1998 08:24:28 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 08:24:16 GMT
Received: from smtp1.erols.com [207.172.3.234] by hermes via ESMTP (IAA19880); Tue, 10 Nov 1998 08:24:15 GMT
Received: from oemcomputer (207-172-91-86.s23.as2.nyb.erols.com [207.172.91.86])
	by smtp1.erols.com (8.8.8/8.8.5) with SMTP id DAA02510
	for ; Tue, 10 Nov 1998 03:24:14 -0500 (EST)
Message-ID: <3647F867.35BF@erols.com>
Date: Tue, 10 Nov 1998 03:25:11 -0500
From: Paul Winkler 
Reply-To: zarmzarm@erols.com
X-Mailer: Mozilla 3.03 (Win95; I)
MIME-Version: 1.0
To: Csound mailing list 
Subject: Re: OOP or not? (perl Csound module)
References: <002701be0c80$840e27e0$0300a8c0@apas.no>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

roger klaveness wrote, or rather quoted:

(snip)
> For example, given a base class shape, polymorphism enables
> the programmer to define different circumference methods for any
> number of derived classes, such as circles, rectangles and triangles.
> No matter what shape an object is, applying the circumference method
> to it will return the correct results. (snip)...

I think I'm getting the hang of this object-oriented stuff. I can see
the utility of polymorphism: for example, let's define a method
"transpose" which pitch-shifts a note or group of notes by a number of
semitones. This could be made to behave differently depending on which
instrument was called by the score event in question: e.g. one
instrument might expect p4 in oct.pch notation, whereas another might
use p6 in cps. You should only have to specify behavior for each
instrument once, and then our "transpose" method will always take care
of the rest for you...

I'm also liking the idea of being able to give named aliases to pfields. 

OK, it's time for me to go bone up on object-oriented concepts and Perl
OOP in particular.

--PW


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20277;
          10 Nov 98 9:09 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa03015;
          10 Nov 98 9:09 GMT
Received: (qmail 3419 invoked from network); 10 Nov 1998 09:09:23 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 10 Nov 1998 09:09:23 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (JAA19347); Tue, 10 Nov 1998 09:04:17 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 09:04:02 GMT
Received: from smtp1.erols.com [207.172.3.234] by hermes via ESMTP (JAA09971); Tue, 10 Nov 1998 09:04:01 GMT
Received: from oemcomputer (207-172-91-86.s23.as2.nyb.erols.com [207.172.91.86])
	by smtp1.erols.com (8.8.8/8.8.5) with SMTP id EAA07340
	for ; Tue, 10 Nov 1998 04:04:00 -0500 (EST)
Message-ID: <364801B9.57CD@erols.com>
Date: Tue, 10 Nov 1998 04:04:57 -0500
From: Paul Winkler 
Reply-To: zarmzarm@erols.com
X-Mailer: Mozilla 3.03 (Win95; I)
MIME-Version: 1.0
To: Csound mailing list 
Subject: Re: OOP or not? (perl Csound module)
References: <364752B7.7844@erols.com> <36475496.A8D86E09@media.mit.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Well, not bad for one evening's response!

Let's see what's in the bag...

Eric Scheirer wrote:
> One of the nice things is that it will be really easy to use
> it to generate scores in other formats, too; for example,
> to write a back-end so that it can produce SASL scores for
> use with SAOL instead.
> 
> I'll do this as soon as you have the basics written, and
> you can quote me on that.

Cool!
This provides yet another incentive to concentrate on a really good
basic structure; if the foundation's no good, I'll be fixing the house
forever.

On the same note--
Aaron Isaksen  wrote:
> This PERL module would be useful, but not just to CSound users.  If you
> are mostly concerned with the score file part of CSound, then I wouldn't
> make it only for CSound.  Why not output MIDI score, or some other kind?
> So, if you think that you'd want your functions to sometimes output MIDI,
> and sometimes output CSound .sco, then you probably want an object
> oriented programming approach.

Point taken. So far, no one has said "don't do object-oriented." I guess
OOP is the way to go. So now I have to really start learning it! Hope I
can avoid buying another $40 book, my computer-book budget is long
exhausted... thank god for the Perl manpages...

re. midi: someone in comp.lang.perl.misc pointed out that there is a
MIDI module on CPAN. I'll have to take a look and see what it does.

Personally, I'd like to concentrate on csound scores. But really all
that means is having ways to conveniently lump groups of events
together, process pfields, and keep track of time, and that ought to be
fairly portable to other score formats. I will probably leave that to
other people to implement, though.

Hans Mikelson weighed in as well:
> I have not done too much OOP lately and not in Perl but I think it might
> look something like if it were in C++ style:
> 
> Verse Verse1(pattern_from_file("some-score-file1.sco",[4 .. 10]));
> Verse Verse2(pattern_from_file("some-score-file2.sco",[4 .. 10]));
> Timer Time(0)
> 
> Verse1.Play(Time, 2);
> Time.Set(0);
> Verse2.Play(Time, 1);
> Verse2.Shuffle(5, Beats(4, 9), 2); ???
> Verse2.Play(Time, 1);

Hmmm, looks like Perl, only different. :)

A nice fellow (lady?) in comp.lang.perl.misc rewrote my example as:

my $verse1 = CMusic->new ("some-score-file.sco", [ 4 .. 10 ]);
my $verse2 = CMusic->new ("some-other-score-file.sco", [ 0 .. 20 ]);

$verse1->play (2);
$verse1->rewind();
$verse2->play (2);

$verse2->shuffle_pfield ($verse2->pfield(5, beats(4 to 9),  *= 2));
$verse2->play();

I notice that both of you supplied definitions for verse2, even though I
didn't bother. Aww, ain't that sweet?

> Some of the advantages lie in functions name clutter.  You could have
> Verse.Play() do one thing and Pattern.Play() and Song.Play(), do something
> else.

I wasn't sure what the benefit of this was, until it dawned on me that
it might help with something I'd been struggling with-- how to handle
nested patterns. That is, I think one should be able to build large
chunks of events out of small chunks of events, and manipulate the whole
at either the macro- or micro- level. Not that I have the foggiest idea
how that would be implemented. OK, I guess now I need to spend some more
time pondering my needs and then go back to comp.lang.perl.misc...

Hey Hans, thanks for the summary of O.O.P.  I'd read similar things in
"Learning Perl" and skimming through a C book I have, but it takes
hearing these things several times in several different ways before I
get it. I think I'm almost there...

>Encapsulation as far as I
> understand means that the variables and the functions are contained in the
> class so that other classes can have the same local variables and local
> functions without bugging neighboring classes.

Sounds good.
 
> I think Polymorphism means that a function can do different things depending
> on the data you give it.  A good example would be overloading + to do
> something like: (snip)

This also could be quite handy.

> Finally inheritance means that one class can inherit properties from a base
> class.

For some reason I don't quite "grok" inheritance. I'll look for an
example and see if that helps.

> One of the applications for a scoring language for me would be to call lots
> of different fractals so it might be good to grab some equations from
> fracint.
(snip)
> These can probably be implemented as subroutines pretty easily though. 

I'll probably leave that to you. I'd like to focus on getting the
structure solid and well-designed.

Darn it, this was supposed to be a quick, easy project! Oh well, that
always happens. I wonder when I'll actually write some music?

> I
> started writing a Perl program which used fractals to generate score events
> in a granular synthesis fashion.

Well, if this library becomes a reality, I hope it could help you!

But getting ahead of myself for a moment:

Csound score ramping and carrying are very handy features that should be
supported by the perl module. There will probably need to be a way to
cause them to be calculated whenever you need to... for instance,
shuffling the order of a sequence of notes might break the intended
ramping effect, since it would move the anchoring values. There should
be ways to either interpolate the pfields in question before doing the
shuffle, or preserving the original ramp (i.e. keeping the anchor values
in the same place while everything else moves around).

For example,

i1 0 2 10  4 ;   let's label this A
i1 1 3 20  < ;   B
i1 2 1 100 < ;   C
i1 3 8 80  10 ;  D

If we simply shuffle those notes in time and then sort them, we could
end up with:

i1 0 1 100 < ;   C
i1 1 2 10  4 ;   A
i1 2 8 80  10 ;  D
i1 3 3 20  < ;   B

This is obviously a very strange result. Both of the unknown p5's now
depend on values not contained in this example, and could cause invalid
csound scores if there's no i1's before or after this in the final
score. 

Alternatively, you might want to end up with this, so the original ramp
is preserved while the other pfields are moved:

i1 0 1 100 4 ;   C
i1 1 2 10  < ;   A
i1 2 8 80  < ;  D
i1 3 3 20  10 ;   B

Or you might want to interpolate the ramps before the shuffle, so you
end up with:

i1 0 1 100 4 ;   C
i1 1 2 10  < ;   A
i1 2 8 80  < ;   D
i1 3 3 20  10 ;  B

So there need to be methods to do all these things. Tricky stuff...

For that matter, I think that pretty much every existing feature of the
csound score should be well-supported by the module. i, f, s, r, a, and
e statements all need to be considered, as well as "." and "<". A
possible exception is the macro system, since the perl module is
intended to be a more powerful way to achieve some of the same things. I
don't really want to worry about how csound score macros might interact
with my pattern idea. But hey, if you're interested in scores with
unpredictable behavior, that might be a feature.

Regards,

PW

p.s. I forgot one item from my list of reasons to write this module:

--would be really useful for impersonating =cwt4ab7s or whatever the
hell its name is. And this is, of course, something I really need to do.


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20538;
          10 Nov 98 12:11 GMT
Received: from mercury.bath.ac.uk by stork.maths.Bath.AC.UK id aa22179;
          10 Nov 98 12:11 GMT
Received: (qmail 15961 invoked from network); 10 Nov 1998 12:11:13 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by mercury.bath.ac.uk with SMTP; 10 Nov 1998 12:11:13 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (LAA16631); Tue, 10 Nov 1998 11:46:00 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 11:45:46 GMT
Received: from josef.ifi.unizh.ch [130.60.48.10] by hermes via SMTP (LAA03065); Tue, 10 Nov 1998 11:45:45 GMT
Received: from ifi.unizh.ch by josef.ifi.unizh.ch with SMTP (PP) 
          id <20462-0@josef.ifi.unizh.ch>; Tue, 10 Nov 1998 12:45:23 +0100
Date: Tue, 10 Nov 1998 12:45:43 +0100 (MET)
From: Bernhard Wagner 
X-Sender: bwagner@theseus
To: Paul Winkler 
cc: Csound mailing list 
Subject: Re: OOP or not? (perl Csound module)
In-Reply-To: <364801B9.57CD@erols.com>
Message-ID: 
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

[snip]
> 
> my $verse1 = CMusic->new ("some-score-file.sco", [ 4 .. 10 ]);
> my $verse2 = CMusic->new ("some-other-score-file.sco", [ 0 .. 20 ]);
> 
> $verse1->play (2);
> $verse1->rewind();
> $verse2->play (2);
> 
[snip]

Rather than using the function "rewind" to start something simultaneously with
something that has been told to play before I would use another approach:
There should be groups with semantics:
  - Synchro
  - Sequence
  - Timeline
  - Loop
The semantics of the group type Synchro assures that all events contained are
started simultaneously.
Group type Sequence assures that all events contained are played in sequence
without gaps. Whenever an event is deleted the following remaining events are
shifted to fill the gap automatically.
The events themselves can be any of the aforementioned groups or explicit note
events.
This concept has been modeled within MET++, an object oriented
multimedia application framework.
(ftp://ftp.ifi.unizh.ch/pub/projects/met++/papers/)

The  framework is also described in the book
"Developing Object-Oriented Multimedia Software" by Philipp Ackermann
http://www.dpunkt.de/produkte/prodind3.html

The framework also includes concepts for abstract instruments.
Concrete subclasses of instrument are MIDI-Instrument, Csound-Instrument,
Software-Oscillator, etc. Thus it is fairly easy to add a new kind of 
instrument that immediately profits from the structures available in the
framework, e.g. the possibility to change the instrument at runtime.
This feature would be a solution to the point that the generated scores should
not only be csound scores but possibly midi.

This might be an answer to the question how OO might come into play here.

The class Event is an abstract class that defines basically the methods play,
stop, duration. The Group classes as well as the explicit note events are 
subclasses of the class Event. The method duration, as an example is 
implemented as a sum of the durations of its children for the Group type 
Sequence while the Group type Synchro returns the duration of it's "longest"
child.

Bernard



Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20681;
          10 Nov 98 12:39 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa25437;
          10 Nov 98 12:39 GMT
Received: (qmail 4063 invoked from network); 10 Nov 1998 12:39:26 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 10 Nov 1998 12:39:26 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (MAA18602); Tue, 10 Nov 1998 12:30:22 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 12:30:05 GMT
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (MAA16550); Tue, 10 Nov 1998 12:30:04 GMT
Received: from [138.38.99.25] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 1.92 #2)
	for csound@maths.ex.ac.uk
	id 0zdCvs-0000WE-00; Tue, 10 Nov 1998 12:30:04 +0000
Date:     Tue, 10 Nov 98 12:30:03 GMT
From: jpff@maths.bath.ac.uk
Subject:  csound-src.zip
To: csound@maths.ex.ac.uk
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Message written at 10 Nov 1998 11:13:36 +0000

I have replaced it with one with more of the sources in it(!) 
In particular lowpassr.c
==John ffitch


Received: from stork.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa20692;
          10 Nov 98 12:43 GMT
Received: from pat.bath.ac.uk by stork.maths.Bath.AC.UK id aa25723;
          10 Nov 98 12:43 GMT
Received: (qmail 4522 invoked from network); 10 Nov 1998 12:42:31 -0000
Received: from hermes.ex.ac.uk (HELO exeter.ac.uk) (144.173.6.14)
  by pat.bath.ac.uk with SMTP; 10 Nov 1998 12:42:31 -0000
Received: from noether [144.173.8.10] by hermes via SMTP (MAA11111); Tue, 10 Nov 1998 12:29:52 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 10 Nov 1998 12:29:38 GMT
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (MAA02308); Tue, 10 Nov 1998 12:29:37 GMT
Received: from [138.38.99.25] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 1.92 #2)
	for csound@maths.ex.ac.uk
	id 0zdCvR-0000W7-00; Tue, 10 Nov 1998 12:29:37 +0000
Date:     Tue, 10 Nov 98 12:29:37 GMT
From: jpff@maths.bath.ac.uk
Subject:  Randon numbers again
To: csound@maths.ex.ac.uk
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Message written at 9 Nov 1998 23:23:49 +0000

There has in the past been concern about the quality of the random
number generator used in the opcodes rand, randh and randi (which is
totally different from the one used in the other noise opcodes by the
way).  Clearly to change it would or could break old orchestras which
is something I am trying to avoid.  I have implemented a rand2, rand2h
and rand2i set of opcodes which use a full 31 bit generator.

But... is that what is needed or would you prefer to see this as an
optional argument to the opcode rather than a new opcode?  Or not at
all?  I would like to see this in the next release, or the idea
squashed as it has been hanging around for a long time.

==John