| Thd manual says that reinit takes a label as an argument which is the
label which starts the special initialisation pass. This code is
terminated by rireturn or and endin
Also rgoto is a ju,mp only at reinitialisation time.
==John ff
Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18765;
14 Mar 97 16:59 GMT
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa14703;
14 Mar 97 16:58 GMT
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
Fri, 14 Mar 1997 16:58:36 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA27255);
Fri, 14 Mar 1997 16:52:36 GMT
Received: from hermes.ex.ac.uk by noether.maths.exeter.ac.uk;
Fri, 14 Mar 97 16:52:26 GMT
Received: from ella.mills.edu [144.91.3.20] by hermes via ESMTP (QAA27239);
Fri, 14 Mar 1997 16:52:22 GMT
Received: from localhost by ella.mills.edu
via SMTP (940816.SGI.8.6.9/930416.SGI) id IAA13656;
Fri, 14 Mar 1997 08:51:02 -0800
Date: Fri, 14 Mar 1997 08:51:02 -0800 (PST)
From: Mike Berry
To: tolve
Cc: csound list
Subject: Re: Question: Envelopes
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
This may seem a little ugly, but you could put in a linseg command
with, say, 20 segments (or however many you needed maximum). Then read
the coeficients out of tables. That way each note simply chooses which
env shape by a single p field. You still have to predetermine all of the
envelopes you would need, but you could add them just to the score, not by
duplicating the instr. Simply use 0's for the coef's at the end that you
didn't need for that particular shape.
Mike Berry
mikeb@mills.edu
http://www.mills.edu/PEOPLE/gr.pages/mikeb.public.html/mikeb.homepage.html
Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa18816;
14 Mar 97 17:03 GMT
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa14867;
14 Mar 97 17:03 GMT
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
Fri, 14 Mar 1997 17:03:17 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (QAA27638);
Fri, 14 Mar 1997 16:56:12 GMT
Received: from hermes.ex.ac.uk by noether.maths.exeter.ac.uk;
Fri, 14 Mar 97 16:56:03 GMT
Received: from maila.surrey.ac.uk [131.227.102.8] by hermes
via SMTP (QAA27623); Fri, 14 Mar 1997 16:56:02 GMT
Received: from psy.surrey.ac.uk (actually host psy1.psy.surrey.ac.uk)
by maila.surrey.ac.uk with SMTP (PP) with ESMTP;
Fri, 14 Mar 1997 16:55:07 +0000
Received: from PSY1/MAIL_QUEUE by psy.surrey.ac.uk (Mercury 1.21);
14 Mar 97 16:56:42 GMT0BST
Received: from MAIL_QUEUE by PSY1 (Mercury 1.30); 14 Mar 97 16:54:58 GMT0BST
From: Peter Kearton
Organization: Psychology Dept, Surrey Univ. U.K.
To: csound@maths.ex.ac.uk
Date: Fri, 14 Mar 1997 16:54:37 GMT
Subject: RE envelope code and reinit
Priority: normal
X-Mailer: Pegasus Mail v3.31
Message-Id:
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Hi,
I tried the code too. What is needed is the parameter 'start'
after the 'reinit' to jump to the 'start:' labelled point in the code,
Pete Kearton
Received: from stork2.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa19949;
14 Mar 97 23:55 GMT
Received: from goggins.bath.ac.uk by stork.maths.Bath.AC.UK id aa23318;
14 Mar 97 23:54 GMT
Received: from hermes.ex.ac.uk by goggins.bath.ac.uk with SMTP (PP);
Fri, 14 Mar 1997 23:54:45 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (XAA16848);
Fri, 14 Mar 1997 23:50:42 GMT
Received: from hermes.ex.ac.uk by noether.maths.exeter.ac.uk;
Fri, 14 Mar 97 23:50:35 GMT
Received: from smtp.utexas.edu [128.83.126.2] by hermes via SMTP (XAA16835);
Fri, 14 Mar 1997 23:50:33 GMT
Received: (qmail-queue invoked by uid 0); 14 Mar 1997 23:49:20 -0000
Received: from unknown (HELO mail.utexas.edu) (128.83.126.1)
by smtp.utexas.edu with SMTP; 14 Mar 1997 23:49:20 -0000
Received: from slip-84-3.ots.utexas.edu (slip-84-3.ots.utexas.edu [128.83.219.67])
by mail.utexas.edu with SMTP id RAA12967;
Fri, 14 Mar 1997 17:49:19 -0600 (CST)
Date: Fri, 14 Mar 1997 17:49:19 -0600 (CST)
Message-Id: <199703142349.RAA12967@mail.utexas.edu>
X-Sender: r.pinkston@mail.utexas.edu
X-Mailer: Windows Eudora Version 1.4.4
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: tolve
From: Russell Pinkston
Subject: Re: Question: Envelopes
Cc: csound@maths.ex.ac.uk
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Tolve,
Sorry, but I just realized I left the reinit target out of my first suggestion:
>Use this:
>
>instr 1
>idur = p3/2
>start: timout 0,idur,continue
> reinit
>continue:
>k1 linen 20000,5,idur,5
> rireturn
>asig oscil k1,cpspch(p5),p4
>out asig
>endin
>
The reinit statement following the timout should read as follows, of course:
reinit start
Now, as to your goal of...
>trying to find most intuitive (hah) method of working with long, complex
>envelopes consisting of, if you will excuse my french, untold stages of
>attack, decay, sustain, and, eventually, release, in unlimited
>combinations, and with unlimited numbers of different values that i assign,
>one at a time.
...I think the key word (and problem) is "unlimited." As someone else has
pointed out, expseg and linseg are the csound envelope units with the
greatest number of possible stages. (The practical limit may not be a
specific number of arguments, but the number of characters you can fit on
the line, I think. Max may be 255, or something.) If you really want
unlimited numbers of stages, however, I think you're going to have to go
with some form of table look up and reinitialization. In other words, use
gen 2 to fill as large a table as you need with your envelope segment data,
in the format val1 dur1 val2 dur2 val3 dur3 val4 dur4...etc.
ival2 table 0,ienvtable ;init ival2 to start pt
index = 1 ;init index to 1st dur
getnewargs:
ival1 = ival2 ;new val1 is old val2
idur table index,ienvtable ;get next duration
ival2 table index+1,ienvtable ;get new value2
index = index+2 ;update for next read
kgate linseg ival1,idur,ival2 ;or use expseg
timout 0,idur,continue ;wait idur seconds
reinit getnewargs ;then reinit
continue:
rireturn
Hope this helps (and works this time).
Regards,
Russell
----------------------------------
Russell F. Pinkston, D.M.A.
Associate Professor of Composition
Director, Electronic Music Studios
School of Music
The University of Texas at Austin
Austin, TX 78712
[512-471-0865]
|