Csound Csound-dev Csound-tekno Search About

Re: Localization of Csound

Date1999-05-10 13:34
FromThomas Hudson
SubjectRe: Localization of Csound
jpff@maths.bath.ac.uk wrote:
> 
> Message written at 10 May 1999 07:23:11 +0100
> 
> Just a progress report.  I have a set of csoudn sources in which all
> relevant strings are surrounded by a macro.  At present this is a two
> argument macro, a unique number and a string.  I have not decided
> whether to use gettext or to roll my own (we had such a system in
> Cambrisge Lisp for years, from about 1976 onwards).

I originally suggested gettext, but upon further investigation, I have
found that it is not LGPL'ed but GPL'ed. So it can only be used with
GPL'ed code. 

The system used by Tcl/Tk 8.1 is called msgcat, and is apparently an
X/Open standard. Since Tcl/Tk runs on Windows and MacOS as well as
Unix systems, it is quite portable. Unfortunately, I have been 
unable to find any source or references on the Net. 

Thomas


Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa13970;
          10 May 99 13:40 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gpMG-0002W5-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 13:40:32 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (NAA18055); Mon, 10 May 1999 13:35:49 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 13:35:35 +0100
Received: from root@www.tomy.net [209.186.149.104] by hermes via ESMTP (NAA13092); Mon, 10 May 1999 13:35:29 +0100 (BST)
Received: from cygnus.com (thudson@jimi.tomy.net [192.168.1.2])
	by www.tomy.net (8.8.7/8.8.7) with ESMTP id IAA06830;
	Mon, 10 May 1999 08:53:58 -0400
Message-ID: <3736D26F.2C0B0196@cygnus.com>
Date: Mon, 10 May 1999 12:34:55 +0000
From: Thomas Hudson 
X-Mailer: Mozilla 4.5 [en] (X11; U; Linux 2.2.2 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: jpff@maths.bath.ac.uk
CC: csound@maths.ex.ac.uk
Subject: Re: Localization of Csound
References: 
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

jpff@maths.bath.ac.uk wrote:
> 
> Message written at 10 May 1999 07:23:11 +0100
> 
> Just a progress report.  I have a set of csoudn sources in which all
> relevant strings are surrounded by a macro.  At present this is a two
> argument macro, a unique number and a string.  I have not decided
> whether to use gettext or to roll my own (we had such a system in
> Cambrisge Lisp for years, from about 1976 onwards).

I originally suggested gettext, but upon further investigation, I have
found that it is not LGPL'ed but GPL'ed. So it can only be used with
GPL'ed code. 

The system used by Tcl/Tk 8.1 is called msgcat, and is apparently an
X/Open standard. Since Tcl/Tk runs on Windows and MacOS as well as
Unix systems, it is quite portable. Unfortunately, I have been 
unable to find any source or references on the Net. 

Thomas


Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa14360;
          10 May 99 14:54 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gqWB-0002b8-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 14:54:51 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (OAA12176); Mon, 10 May 1999 14:48:26 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 14:48:01 +0100
Received: from ccrma.Stanford.EDU [36.49.0.84] by hermes via ESMTP (OAA13877); Mon, 10 May 1999 14:47:51 +0100 (BST)
Received: from ccrma.stanford.edu ([207.97.74.53])
	by ccrma.stanford.edu (8.8.8/8.8.8) with ESMTP id GAA16995;
	Mon, 10 May 1999 06:47:18 -0700 (PDT)
Message-ID: <3736E3C1.E85F18CD@ccrma.stanford.edu>
Date: Mon, 10 May 1999 09:48:49 -0400
From: Tobias Kunze 
X-Mailer: Mozilla 4.05C-SGI [en] (X11; I; IRIX 6.5 IP22)
MIME-Version: 1.0
To: roger@apas.no
CC: csound-list 
Subject: Re: Csound & SGI
References: <37369326.BF7EE9D1@apas.no>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

> Have someone experienced troble with Csound on SGI machines producing
> gaps in the output file?

no.  can you post a stripped-down orc/sco, maybe alongside with a
more specific analysis of these silences?  I.e.,

  - is the problem pertinent to certain opcodes?
  - are you using the same binary on all machines?
    - if not, are some compiled with aggressive optimization?
  - are the silences "K-rate"-aligned?  Buffer-aligned?

etc.


Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15137;
          10 May 99 19:09 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10guUs-0002B9-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 19:09:46 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (TAA09955); Mon, 10 May 1999 19:06:44 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 19:06:32 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (TAA00730); Mon, 10 May 1999 19:06:31 +0100 (BST)
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
	id 10guRh-0002pe-00
	for csound@maths.ex.ac.uk; Mon, 10 May 1999 19:06:29 +0100
Date:     Mon, 10 May 99 19:06:26 BST
From: J P Fitch 
To: csound@maths.ex.ac.uk
Subject:  From Dr. Richard Boulanger: Csound Book
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

From: "Dr. Richard Boulanger" 

Dear Friend,

My spring semester at Berklee has just finished and I thought I would
update you on the progress of The Csound Book and The Csound FrontPage
at MIT.

I am currently waiting for my page proofs from MIT Press and expect
them any day now. I have had a number of preliminary meetings
reviewing samples from them and made the necessary preliminary
corrections.

Once the page proofs arrive and are reviewd and corrected by me, the
book will be weeks away.  I will let you all know when I return the
corrections to the press, so that you can have a more accurate idea on
when you can order copies.

In the meantime, we have been making major progress on the CD-ROMs and
the Csound FrontPage. My assistant, Jacob Joaquin, has completely
redesigned and streamlined the Csound FrontPage. There are many new
links and a more professional look and feel.  Check it out...

The Csound FrontPage -  http://mitpress.mit.edu/e-books/csound/frontpage.html

Also...  Jake has created a cool Csound button which you can paste
into your pages.  We hope you will copy and use it - it will take you
"home."

Further...

We have added and revised all the original tutorials from the Public
Csound Manual. In the case of my original 13 TOOTorials you will find
new block diagrams and all the orchestra, score and aif files you need
to run them.  (I did a little be of revising too.)

The Original Boulanger Csound Tutorial -
http://mitpress.mit.edu/e-books/csound/fpage/tut/tut.html

And Also...

We have added 20 complete Csound Compositions composed by my students
at Berklee.
 These appear in a new "Universities" section in which we plan to
feature student compositions from Colleges around the world.  We will
be adding three other universities in the next weeks.  But until then,
I hope you enjoy the diverse styles of my student works.  I am very
proud of them.

Berklee Student Compositions -
http://mitpress.mit.edu/e-books/csound/fpage/univ/Berklee/berklee.html

Finally...

We have added the CD-ROM chapter by Kim Cascone to the Csound Book
section of the site.  His piece is there for you to download, study
and enjoy.  Plus he offers some wonderful insights on moving from a
sound design perspective to a compositional one.

The Csound Book -
http://mitpress.mit.edu/e-books/csound/fpage/pub/csbook/csbook.html

Oh, I almost forgot....

As you might have noticed.  You can directly link to sections of the
Csound Front Page that interest you such as I have done above.


Take Care.  Have a great and productive spring and summer.
And please keep me posted on your Csound Instruments and Music.


Yours Sincerely,

Dr. Richard Boulanger

_____________________________________________________________
Dr. Richard Boulanger
Professor - Music Synthesis Department
Berklee College of Music
1140 Boylston Street  - Boston, MA  02215-3693
Office Phone: (617) 747-2485   Office Fax: (617) 536-2257
Email: radiobaton@earthlink.net  OR  rboulanger@berklee.edu
_____________________________________________________________
Personal Webpage: http://home.earthlink.net/~radiobaton/
Csound Frontpage: http://mitpress.mit.edu/e-books/csound/frontpage.html
HTML Tools & Tips: http://members.tripod.com/~richardboulanger/btot99.html
_____________________________________________________________



Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15386;
          10 May 99 21:02 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gwG8-0002D6-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 21:02:40 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (UAA08590); Mon, 10 May 1999 20:59:51 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 20:59:38 +0100
Received: from dns2.seanet.com [199.181.164.2] by hermes via ESMTP (UAA14766); Mon, 10 May 1999 20:59:37 +0100 (BST)
Received: from seanet.com (costello.seanet.com [204.182.65.218]) by mx.seanet.com (8.9.3/Seanet-8.7.3) with ESMTP id MAA09269; Mon, 10 May 1999 12:59:26 -0700 (PDT)
Message-ID: <373739D5.FCC617BE@seanet.com>
Date: Mon, 10 May 1999 12:56:05 -0700
From: Sean Costello 
X-Mailer: Mozilla 4.04 [en] (Win95; U)
MIME-Version: 1.0
To: CSOUND 
Subject: Writing opcodes that can be modulated by k and a-rate signals?
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi all:

I am writing several Csound opcodes for a class project, implementing
various forms of filters and other spectral modifications. Ideally, I
would like the opcodes to have the option of being modulated with both
k-rate signals, for smooth sweeps, and a-rate signals, for FM-type
effects. I have looked in the Csound source code for opcodes that
implement this, and the results are confusing, to say the least (for
example, oscili is included in entry.c as "osciliaa", "oscilikk", etc.).
Can anyone give me any tips on how to make an opcode modulatible by both
a and k rate variables? Do I need to write a different function for
every type of modulation (i.e. one for a-rate modulation, one for k-rate
modulation), and if so, how do I switch in between them without having
seperate names for the opcodes? Or, is there a simple solution that
accomodates modulation by both a and k-rate opcodes?

Thanks, 

Sean Costello


Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15582;
          10 May 99 22:20 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gxTA-0002uQ-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 22:20:12 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (WAA07412); Mon, 10 May 1999 22:17:35 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 22:17:23 +0100
Received: from root@renoir.op.net [209.152.193.4] by hermes via ESMTP (WAA17769); Mon, 10 May 1999 22:17:21 +0100 (BST)
Received: from someip.ppp.op.net (d-bm2-15.ppp.op.net [209.152.194.53]) by renoir.op.net (o1/$Revision: 1.18 $) with ESMTP id RAA23098; Mon, 10 May 1999 17:16:48 -0400 (EDT)
Message-Id: <199905102116.RAA23098@renoir.op.net>
To: Sean Costello 
Cc: csound@maths.ex.ac.uk
Subject: Re: Writing opcodes that can be modulated by k and a-rate signals? 
In-reply-to: Your message of "Mon, 10 May 1999 12:56:05 PDT."
             <373739D5.FCC617BE@seanet.com> 
Date: Mon, 10 May 1999 17:14:26 -0400
From: Paul Barton-Davis 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

There is a big difference between different usable names for the
opcode, different names for the opcode in entry.c, and differently
named functions to implement the opcodes.

I'm not altogether certain of what Csound does internally, but I had
to decode it to make things work in Quasimodo (which uses basically
the same opcode descriptions).

The convention that has been followed thus far (jpff can comment
further) is something like this:

	 "foo_i"  => opcode foo, use i-rate function only
         "foo_k"  => opcode foo, using k-rate function (and possibly i-rate)
	 "foo_a"  => opcode foo, using a-rate function (and possibly i-rate)

there are other versions of this scheme.

at one time, you didn't need to modify any code to add such opcodes,
but I think that this might not be the case now (see either rdorch.c
and/or insert.c for a list of strcmp()'s to determine if the opcode is
"special") 

so, if you add this to entry.c:

     { "foo_i", S(FOOBAR), "i", "ik", fooset, NULL, NULL },

you've defined an opcode that runs at i-time only, calling fooset,
passing it a ptr to FOOBAR, containing two input args (type i, and
type k) and one output argument, type i.

if you add this:

     { "foo_k", S(FOOBAR), "k", "ik", fooset, fook, NULL },

you've defined an opcode that runs at i-time (calling fooset()) and
perf-time (calling fook).

and if you add this:

     { "foo_a", S(FOOBAR), "a", "xk", fooset, fook, fooa },

you've defined an opcode that runs at i-time (calling fooset()) and
perf-time. at k-time, the choice between fook() and fooa() will be made
based on the types of the output and/or input arguments.

its also possible to use the XINCODE macro to determine from within
the opcode function if the input args are a-rate or k-rate, meaning
that if the output type is the same, you don't need two different
functions to implement handling of k-rate and a-rate input arguments.

grep for XINCODE to see how its used. its a rather ugly system,
because of some historic aspects of its usage. For instance,

	(p->XINCODE & 0x2) 

will test for the first argument being a-rate, whereas

	(p->XINCODE & 0x1) 

will test for, you guessed it, the second ! The XINCODE mechanism is
limited, I think, to just the first 3 or 4 input arguments.

if you have more questions that aren't answered here or by others, let
me know.

--p


Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15615;
          10 May 99 22:34 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gxgi-0002Ei-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 22:34:12 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (WAA16608); Mon, 10 May 1999 22:31:42 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 22:31:30 +0100
Received: from mserv1b.u-net.net [195.102.240.137] by hermes via ESMTP (WAA05651); Mon, 10 May 1999 22:31:30 +0100 (BST)
Received: from p122.nas2.is5.u-net.net ([195.102.200.250] helo=babcom.u-net.com)
	by mserv1b.u-net.net with esmtp (Exim 2.10 #61)
	id 10gxca-0007fV-00; Mon, 10 May 1999 22:29:56 +0100
Message-ID: <37373EC5.DB7005EF@babcom.u-net.com>
Date: Mon, 10 May 1999 21:17:09 +0100
From: Steven Cook 
Reply-To: steve@babcom.u-net.com
X-Mailer: Mozilla 4.04 (Macintosh; I; 68K)
MIME-Version: 1.0
To: luis jure 
CC: CSound list 
Subject: Re: oscil3 glitch problem (ampdb)
References: <007701be9a61$ce315f80$0e2f02c8@luisjure>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Hi All,

luis jure wrote:

> >The output from this contains a single sample -32768 spike about a third of
> >the way in for no apparent reason.
> 
> steve, your orchestra produces a perfectly clean sine sweep for me too
> (winsound 3.53; gabriel maldonado's directcsound 2.70, based on csound 3.52
> i think). so check your version of csound.
> 
> anyway, i don't think it's the best to put:
> 
> ilevl = ampdb(96 + p4)
> 
> according to the manual, ampdb returns a raw value of 32000 for 90dB, thus
> if you take 0dB as your maximum output, a value of 90 would give almost 0dB
> for 16 bits (-0.3 in fact) and not -6 dB as you seem to want.
> 
> by the way, looking at the output, ampdb doesn't seem to be extremely
> precise. or is it?

Hmm! I was under the impression that (perfect) 16 bit audio had a 96 dB
dynamic range, hence the above. Perhaps ampdb is calibrated wrong, or am I
missing something?

Anyway, my glitching problem remains, so here is a simplified version of my
orc and sco which shows the problem more clearly. When I run this I get a half
wave rectified sine, i.e. no negative output at all. Halving the table size
produces a sine sweep with a 1 sample wide -32768 spike on a zero crossing
point about one quarter of the way in, reducing the table size more cures the
problem. Replacing oscil3 with oscili also cures the problem. 

;Orc
sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 1

instr    1 ; Sine sweep

ilevl    = p4*32768 ; Level
ifreq1   = p5       ; Sweep start
ifreq2   = p6       ; Sweep end
asweep   expseg  ifreq1, p3, ifreq2
aosc     oscil3  ilevl, asweep, 1
out      aosc
endin

;Sco
f1 0 65536 10 1 ; Sine

;   Strt Leng Levl Freq1 Freq2
i1  0.00 1.00 1.00    20 20000
e

Thanks,

Steve Cook.



Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa15696;
          10 May 99 23:16 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by wallace.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10gyLP-0002vE-00
	for jpff@maths.bath.ac.uk; Mon, 10 May 1999 23:16:15 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (XAA10214); Mon, 10 May 1999 23:13:41 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Mon, 10 May 1999 23:13:29 +0100
Received: from dns2.seanet.com [199.181.164.2] by hermes via ESMTP (XAA15036); Mon, 10 May 1999 23:13:27 +0100 (BST)
Received: from seanet.com (costello.seanet.com [204.182.65.218]) by mx.seanet.com (8.9.3/Seanet-8.7.3) with ESMTP id PAA24770; Mon, 10 May 1999 15:13:14 -0700 (PDT)
Message-ID: <37375935.73C12AA1@seanet.com>
Date: Mon, 10 May 1999 15:09:57 -0700
From: Sean Costello 
X-Mailer: Mozilla 4.04 [en] (Win95; U)
MIME-Version: 1.0
To: Paul Barton-Davis 
CC: csound@maths.ex.ac.uk
Subject: Re: Writing opcodes that can be modulated by k and a-rate signals?
References: <199905102116.RAA23098@renoir.op.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

Paul Barton-Davis wrote:

> its also possible to use the XINCODE macro to determine from within
> the opcode function if the input args are a-rate or k-rate, meaning
> that if the output type is the same, you don't need two different
> functions to implement handling of k-rate and a-rate input arguments.

THAT'S what I need. All of my opcodes generate a-rate outputs, so a
simple way of choosing the specific a or k-rate routine within the
function itself should do it.

> grep for XINCODE to see how its used. 

No grepping on the Windoze 95 machine here at work. I will search for
instances of XINCODE tonight.

Thanks,

Sean Costello


Received: from xenakis.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa17262;
          11 May 99 12:53 BST
From: jpff@maths.bath.ac.uk
To: costello@seanet.com
CC: csound@maths.ex.ac.uk
In-reply-to: <373739D5.FCC617BE@seanet.com> (message from Sean Costello on
	Mon, 10 May 1999 12:56:05 -0700)
Subject: Re: Writing opcodes that can be modulated by k and a-rate signals?
BCC: jpff@maths.bath.ac.uk
References:  <373739D5.FCC617BE@seanet.com>
Date: Tue, 11 May 99 12:53:36 BST
Sender: jpff@maths.bath.ac.uk
Source-Info:  From (or Sender) name not authenticated.

You have two approaches, with subvariants,.

1) Easiest, make two opcodes, one for k and one for a.  

1a) In entry give the name the correct flag and the names can be the
same.

2) Look at biquad.c and in particular the moogvcf opcodevoid moogvcfset(MOOGVCF *p)
{
    p->xnm1 = p->y1nm1 = p->y2nm1 = p->y3nm1 = 0.0f;
    p->y1n  = p->y2n   = p->y3n   = p->y4n   = 0.0f;
    p->fcocod = (p->XINCODE & 01) ? 1 : 0;
    p->rezcod = (p->XINCODE & 04) ? 1 : 0;
}

where it looks to see if it is in i or k rate and acts accordingly 
...
     /* Handle a-rate modulation of fco & res. */
      if (p->fcocod) {
        fco = *(++fcoptr);
      }
      if (p->rezcod) {
        res = *(++resptr);
      }
      if ((p->rezcod==1) || (p->fcocod==1)) {
.....

At another time (ie not at marking time) I would like to explain
better, but Hans Mikelson seems to be teh expert on this.

==John



Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa17291;
          11 May 99 13:01 BST
Received: from [144.173.6.14] (helo=exeter.ac.uk)
	by shaun.maths.bath.ac.uk with esmtp (Exim 2.12 #1)
	id 10hBEH-0002cF-00
	for jpff@maths.bath.ac.uk; Tue, 11 May 1999 13:01:45 +0100
Received: from noether [144.173.8.10] by hermes via SMTP (MAA12726); Tue, 11 May 1999 12:54:01 +0100 (BST)
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 11 May 1999 12:53:46 +0100
Received: from exim@wallace.maths.bath.ac.uk [138.38.100.104] by hermes via ESMTP (MAA07933); Tue, 11 May 1999 12:53:45 +0100 (BST)
Received: from [138.38.97.36] (helo=maths.Bath.AC.UK ident=mmdf)
	by wallace.maths.bath.ac.uk with smtp (Exim 2.12 #1)
	id 10hB6U-0003PX-00; Tue, 11 May 1999 12:53:42 +0100
From: jpff@maths.bath.ac.uk
To: costello@seanet.com
CC: csound@maths.ex.ac.uk
In-reply-to: <373739D5.FCC617BE@seanet.com> (message from Sean Costello on
	Mon, 10 May 1999 12:56:05 -0700)
Subject: Re: Writing opcodes that can be modulated by k and a-rate signals?
References:  <373739D5.FCC617BE@seanet.com>
Date: Tue, 11 May 99 12:53:36 BST
Source-Info:  From (or Sender) name not authenticated.
Message-Id: 
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk

You have two approaches, with subvariants,.

1) Easiest, make two opcodes, one for k and one for a.  

1a) In entry give the name the correct flag and the names can be the
same.

2) Look at biquad.c and in particular the moogvcf opcodevoid moogvcfset(MOOGVCF *p)
{
    p->xnm1 = p->y1nm1 = p->y2nm1 = p->y3nm1 = 0.0f;
    p->y1n  = p->y2n   = p->y3n   = p->y4n   = 0.0f;
    p->fcocod = (p->XINCODE & 01) ? 1 : 0;
    p->rezcod = (p->XINCODE & 04) ? 1 : 0;
}

where it looks to see if it is in i or k rate and acts accordingly 
...
     /* Handle a-rate modulation of fco & res. */
      if (p->fcocod) {
        fco = *(++fcoptr);
      }
      if (p->rezcod) {
        res = *(++resptr);
      }
      if ((p->rezcod==1) || (p->fcocod==1)) {
.....

At another time (ie not at marking time) I would like to explain
better, but Hans Mikelson seems to be teh expert on this.

==John