| Hello,
I was thinking today about digital filtering and realized that most of the
digital filters I had seen were pretty linear with some a0*yn + a1*yn-1 +
...=b0*xn + b1*xn-1 + ... something like that, but why not just use some
arbitrarily complex function of xn, yn, xn-1, yn-1, ... ?
yn = F(xn, xn-1, xn-2, ..., yn-1, yn-2, ...)
Or with possibly multiple input signals and functions:
x1n, x2n, ...
y1n = F1(x1n, x1n-1,..., x2n, x2n-1,..., y1n-1, y1n-2, ..., y2n, y2n-1,
y2n-2...)
y2n = F2(....etc)
Is anyone working with these systems? Complex chaotic systems come to mind.
Of course I don't think I want to try and figure out the frequency
response... :)
Bye,
Hans Mikelson
; Oh, and here is an example:
; Arbitrary Digital Filter
; by Hans Mikelson
; ORCHESTRA
; Note: sr must equal kr
sr=44100
kr=44100
ksmps=1
nchnls=2
instr 1
idur = p3
axn init 0
axnm1 init 0
axnm2 init 0
ayn init 0
aynm1 init 0
aynm2 init 0
kc1 linseg .2, idur*.5, .8, idur*.5, .1
kc2 linseg 3.5, idur*.2, .4, idur*.8, 2.1
ax1n, ax2n diskin 11, 1
axn = ax1n/32000
; Digital filter with arbitrarily complex function.
ayn =
kc1*sin(axn*2+3*cos(kc2*aynm2))-.3*axnm1*aynm1+.1*ayn*axnm2*sqrt(ayn*ayn+axn
m1*axnm1)
axnm2 = axnm1
axnm1 = axn
aynm2 = aynm1
aynm1 = ayn
outs ayn*32000, ayn*32000
endin
; SCORE
; Sta Dur
i1 0.0 2.0
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa05096;
8 Dec 98 16:15 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znPnO-0000rB-00; Tue, 8 Dec 1998 16:15:30 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (PAA03135); Tue, 8 Dec 1998 15:59:43 GMT
Received: from sunny.ex.ac.uk by maths.ex.ac.uk; Tue, 8 Dec 1998 15:12:27 GMT
Received: from [134.173.53.8] by sunny via ESMTP (PAA06548); Tue, 8 Dec 1998 15:12:27 GMT
Received: from [134.173.38.61] (Spjut.Eng.HMC.Edu)
by THUBAN.AC.HMC.EDU (PMDF V5.1-7 #D3207)
with ESMTP id <01J534MP52OA9PME2S@THUBAN.AC.HMC.EDU> for
csound@maths.ex.ac.uk; Tue, 8 Dec 1998 07:12:19 PST
Date: Tue, 08 Dec 1998 07:15:24 -0800
From: Erik Spjut
Subject: Re: Digital Filters with Orc & Sco
In-reply-to: <000e01be2267$939f0240$a1e167ce@default>
X-Sender: spjut@thuban.ac.hmc.edu
To: Hans Mikelson , Csound
Message-id:
MIME-version: 1.0
Content-type: text/plain; charset="us-ascii"
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
There is a reason that most filters are boring linear combinations of
present and past samples. For linear filters the frequency response doesn't
depend on the input amplitude and no new frequency components are
introduced. In other words, you can predict ahead of time what will happen.
With non-linear systems all bets are off and the more non-linear the system
the harder it is to predict what will happen. The frequency response (if
you could define it) depends on the shape, amplitude and phase of the
input. Mama always said that non-linear filters are like a box of
chocolates...
Bifurcation, chaos, strange attractors and such are not necessarily bad
things. It's just that few of us have the nerve to face the unknown
unarmed. Let us know what you find.
At 10:59 PM -0600 12/7/98, Hans Mikelson wrote:
>Hello,
>
>I was thinking today about digital filtering and realized that most of the
>digital filters I had seen were pretty linear with some a0*yn + a1*yn-1 +
>...=b0*xn + b1*xn-1 + ... something like that, but why not just use some
>arbitrarily complex function of xn, yn, xn-1, yn-1, ... ?
>
>yn = F(xn, xn-1, xn-2, ..., yn-1, yn-2, ...)
>
>Or with possibly multiple input signals and functions:
>
>x1n, x2n, ...
>y1n = F1(x1n, x1n-1,..., x2n, x2n-1,..., y1n-1, y1n-2, ..., y2n, y2n-1,
>y2n-2...)
>y2n = F2(....etc)
>
>Is anyone working with these systems? Complex chaotic systems come to mind.
>Of course I don't think I want to try and figure out the frequency
>response... :)
-------------------------------------------------------------------------------
Erik Spjut (spyoot, rhymes with cute) - Associate Professor of Engineering
and Associate Director for Engineering Computing, Center for Design Education
Harvey Mudd College, Claremont, CA 91711-5990 USA
Erik_Spjut@hmc.edu Ph & Voice mail (909) 607-3890 Fax (909) 621-8967
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa05880;
8 Dec 98 19:42 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znT1W-00017X-00; Tue, 8 Dec 1998 19:42:18 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (TAA08014); Tue, 8 Dec 1998 19:33:51 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 8 Dec 1998 19:33:43 GMT
Received: from UX3.SP.CS.CMU.EDU [128.2.198.103] by hermes via SMTP (TAA07909); Tue, 8 Dec 1998 19:33:38 GMT
Message-Id: <199812081933.TAA07909@hermes>
Subject: Re: Digital Filters with Orc & Sco
To: Csound mailing list
Date: Tue, 8 Dec 1998 14:32:14 -0500 (EST)
From: Eli Brandt
In-Reply-To: <000e01be2267$939f0240$a1e167ce@default> from "Hans Mikelson" at Dec 7, 98 10:59:44 pm
X-Portmanteau: pantryptaminergeticallysisterrainbowtie
Reply-To: eli+@cs.cmu.edu
X-Mailer: ELM [version 2.4 PL25-40]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Hans Mikelson wrote:
> I was thinking today about digital filtering and realized that most of the
> digital filters I had seen were pretty linear with some a0*yn + a1*yn-1 +
> ...=b0*xn + b1*xn-1 + ... something like that, but why not just use some
> arbitrarily complex function of xn, yn, xn-1, yn-1, ... ?
>
> yn = F(xn, xn-1, xn-2, ..., yn-1, yn-2, ...)
[...]
> Is anyone working with these systems? Complex chaotic systems come to mind.
You're probably aware of this, but I thought I'd mention that a
convenient way to experiment with this is the nlfilt opcode. As a
bonus, there's an article (Dobson and ffitch, ICMC96) describing
useful parameter ranges so you're not flying blind.
One annoyance (feature of musical interest, whatever) with
non-linearity in the feedback path is the aliasing that results from a
reasonable implementation. Signal bandwidth tries to increase
exponentially with time...
--
Eli Brandt | eli+@cs.cmu.edu | http://www.cs.cmu.edu/~eli/
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06117;
8 Dec 98 21:00 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znUFN-0001C5-00; Tue, 8 Dec 1998 21:00:41 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (UAA17207); Tue, 8 Dec 1998 20:58:45 GMT
From: XLR8R251@aol.com
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 8 Dec 1998 20:58:33 GMT
Received: from imo14.mx.aol.com [198.81.17.4] by hermes via ESMTP (UAA10156); Tue, 8 Dec 1998 20:58:27 GMT
Received: from XLR8R251@aol.com
by imo14.mx.aol.com (IMOv18.1) id 2FRYa29919
for ; Tue, 8 Dec 1998 15:45:10 -0500 (EST)
Message-ID: <938e56d8.366d8fd6@aol.com>
Date: Tue, 8 Dec 1998 15:45:10 EST
To: csound@maths.ex.ac.uk
Mime-Version: 1.0
Subject: Error...linseg (help!)
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Mailer: AOL 4.0 for Windows 95 sub 226
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Hello all,
I've been working on an "all csound" drum kit, and have run into an error that
I can't figure out. It reads as follows:
Error: linseg not initialized (krate)
The instrument plays fine under .sco control, but the error started occuring
when I converted it to MIDI control. As far as I can tell, everything looks
fine, including the linsegs. Has anyone seen this before and/or know what to
do about it?
Thanks in advance,
Dewey Cooksey
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06245;
8 Dec 98 22:09 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znVJx-0001FE-00; Tue, 8 Dec 1998 22:09:29 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (WAA03652); Tue, 8 Dec 1998 22:07:17 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Tue, 8 Dec 1998 22:07:04 GMT
Received: from jaguars-int.cableinet.net [193.38.113.9] by hermes via SMTP (WAA03560); Tue, 8 Dec 1998 22:07:04 GMT
Received: (qmail 15943 invoked from network); 8 Dec 1998 19:38:33 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.20)
by jaguars with SMTP; 8 Dec 1998 19:38:33 -0000
Message-ID: <366D81FB.45A67868@cableinet.co.uk>
Date: Tue, 08 Dec 1998 19:46:04 +0000
From: Richard Dobson
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: csound@maths.ex.ac.uk
Subject: Re: Digital Filters with Orc & Sco
References: <000e01be2267$939f0240$a1e167ce@default>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
It doesn't have to be that 'complex' to be chaotic, of course; my own
experiments got quite a long way just using x^^2 as the non-linear element,
combined with delay and linear filter elements - that's the basis of the
nlfilt opcode. The paper I wrote with John Fitch is on his site somewhere.
Richard Dobson
http://www.wkweb5.cableinet.co.uk/rwd
Check out my Soundcard Attrition Page!
Hans Mikelson wrote:
>
> Hello,
>
> I was thinking today about digital filtering and realized that most of the
> digital filters I had seen were pretty linear with some a0*yn + a1*yn-1 +
> ...=b0*xn + b1*xn-1 + ... something like that, but why not just use some
> arbitrarily complex function of xn, yn, xn-1, yn-1, ... ?
>
> yn = F(xn, xn-1, xn-2, ..., yn-1, yn-2, ...)
>
> Or with possibly multiple input signals and functions:
>
> x1n, x2n, ...
> y1n = F1(x1n, x1n-1,..., x2n, x2n-1,..., y1n-1, y1n-2, ..., y2n, y2n-1,
> y2n-2...)
> y2n = F2(....etc)
>
> Is anyone working with these systems? Complex chaotic systems come to mind.
> Of course I don't think I want to try and figure out the frequency
> response... :)
>
> Bye,
> Hans Mikelson
>
> ; Oh, and here is an example:
> ; Arbitrary Digital Filter
> ; by Hans Mikelson
> ; ORCHESTRA
> ; Note: sr must equal kr
> sr=44100
> kr=44100
> ksmps=1
> nchnls=2
>
> instr 1
>
> idur = p3
>
> axn init 0
> axnm1 init 0
> axnm2 init 0
> ayn init 0
> aynm1 init 0
> aynm2 init 0
>
> kc1 linseg .2, idur*.5, .8, idur*.5, .1
> kc2 linseg 3.5, idur*.2, .4, idur*.8, 2.1
>
> ax1n, ax2n diskin 11, 1
> axn = ax1n/32000
>
> ; Digital filter with arbitrarily complex function.
> ayn =
> kc1*sin(axn*2+3*cos(kc2*aynm2))-.3*axnm1*aynm1+.1*ayn*axnm2*sqrt(ayn*ayn+axn
> m1*axnm1)
>
> axnm2 = axnm1
> axnm1 = axn
> aynm2 = aynm1
> aynm1 = ayn
>
> outs ayn*32000, ayn*32000
>
> endin
>
> ; SCORE
> ; Sta Dur
> i1 0.0 2.0
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06735;
9 Dec 98 2:49 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znZh7-0002Ux-00; Wed, 9 Dec 1998 02:49:41 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (CAA20085); Wed, 9 Dec 1998 02:37:58 GMT
From: XLR8R251@aol.com
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 9 Dec 1998 02:37:47 GMT
Received: from imo24.mx.aol.com [198.81.17.68] by hermes via ESMTP (CAA00075); Wed, 9 Dec 1998 02:37:46 GMT
Received: from XLR8R251@aol.com
by imo24.mx.aol.com (IMOv18.1) id QYEWa19922
for ; Tue, 8 Dec 1998 21:26:09 +1900 (EST)
Message-ID: <59c24f58.366ddfc1@aol.com>
Date: Tue, 8 Dec 1998 21:26:09 EST
To: csound@maths.ex.ac.uk
Mime-Version: 1.0
Subject: Re: Re: Error...linseg (help!)
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: quoted-printable
X-Mailer: AOL 3.0 for Mac sub 84
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
>> Hello all,
>>
>> I've been working on an "all csound" drum kit,
>
>Hmm, could you plz send it to me? I=B4m also working in a similar project=
Received: from shaun.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa06872;
9 Dec 98 4:41 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by shaun.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znbRE-0001XS-00; Wed, 9 Dec 1998 04:41:24 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (EAA08007); Wed, 9 Dec 1998 04:38:04 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 9 Dec 1998 04:37:52 GMT
Received: from mail.brproductions.com [209.54.19.2] (may be forged) by hermes via ESMTP (EAA14556); Wed, 9 Dec 1998 04:37:50 GMT
Received: from [209.54.19.112] (p1112.accesshub.net [209.54.19.112])
by ns1.accesshub.net (2.5 Build 2639 (Berkeley 8.8.6)/8.8.4) with ESMTP
id XAA00430; Tue, 08 Dec 1998 23:39:40 -0500
Message-Id: <199812090439.XAA00430@ns1.accesshub.net>
X-Mailer: Microsoft Outlook Express for Macintosh - 4.01 (295)
Date: Tue, 08 Dec 1998 23:35:17 -0500
Subject: Re: Error...linseg (help!)
From: Chris Sattinger
To: XLR8R251@aol.com
CC: csound
Mime-version: 1.0
X-Priority: 3
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
>Hello all,
>
>I've been working on an "all csound" drum kit, and have run into an error that
>I can't figure out. It reads as follows:
>
>Error: linseg not initialized (krate)
>
>The instrument plays fine under .sco control, but the error started occuring
>when I converted it to MIDI control. As far as I can tell, everything looks
>fine, including the linsegs. Has anyone seen this before and/or know what to
>do about it?
>
>Thanks in advance,
>Dewey Cooksey
>
Well as with all things that once worked and now mysteriously don't : its
probably a missing ; a slightly moved } or ) or something like that.
8/10 with programming that's what happened when it all of a sudden stopped
working.
___________________________________________________
crucial_systems.com
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07139;
9 Dec 98 6:11 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0zncqK-0002hK-00; Wed, 9 Dec 1998 06:11:24 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (GAA22452); Wed, 9 Dec 1998 06:03:03 GMT
From: XLR8R251@aol.com
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 9 Dec 1998 06:02:51 GMT
Received: from imo24.mx.aol.com [198.81.17.68] by hermes via ESMTP (GAA25350); Wed, 9 Dec 1998 06:02:49 GMT
Received: from XLR8R251@aol.com
by imo24.mx.aol.com (IMOv18.1) id IFAEa19912
for ; Wed, 9 Dec 1998 01:01:03 -0500 (EST)
Message-ID:
Date: Wed, 9 Dec 1998 01:01:03 EST
To: csound@maths.ex.ac.uk
Mime-Version: 1.0
Subject: drum kit
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Mailer: AOL 3.0 for Mac sub 84
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
My apologies to those who recieve this twice. It looked like not all of this
made it through the first time.
*****
Here is the "non-MIDI" instr. As you can see the only p references are to p4
and p5, easily changeable to veloc and notnum. Sorry I didn't include it in
my original post as I was at work. I have tried this version, without MIDI,
and I am now getting the same error, so it must be somewhere in my code.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1
;f1 0 2048 10 1 ;sine wave
;f2 0 2049 5 1 256 .667 1792 .0001 ;exp env
instr 4 ;Drum Kit
;=======================================
iamp = p4*10
inote = p5
if inote==36 goto Kick
if inote==38 goto Snare
if inote==42 goto HHat
goto end
Kick:
ifdur = .00125
;pitch
;-------------------
kenv linseg 0, .001, 1, .001, 1, .002, .4, .246, 0
kfrq expseg 75, ifdur, 50, .25-ifdur, 25
alow oscil kenv*iamp, kfrq, 1
alow butterlp alow, 1000
;click
;-------------------
kamp linseg 0, .001, .15, .002, 0, .247, 0
anrnd rand kamp
anoiz oscil anrnd*iamp, 200, 1
asig = alow+anoiz
goto end
Snare:
;tone
;-------------------
kenv linseg 0, .001, iamp, .01, iamp, .015, iamp*.3, .015, 0
kpch linseg 750, .002, 600, .004, 400
asnr oscil kenv, kpch, 1
;snap
;-------------------
k1 expseg iamp*.45, .18, .001
k2 gauss 10000
a1 oscil k1, k2, 1
anoiz = a1
asig = asnr+anoiz
;verb
;-------------------
arev reverb2 asig, .26, 1
arev butterlp arev, 4000
asig = asig+arev*.08
goto end
HHat:
idur = 0.3335
ifrq = 15000
k4 linseg 1, idur-.05, 1, .05, 0, .01, 0
ks oscili iamp, idur, 2
ar randi ks, ifrq
a1 atone ar, ks+ifrq
a1 balance a1, ar
a1 oscili a1, ifrq, 1
asig = k4*a1
goto end
end:
out asig
endin
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07232;
9 Dec 98 7:12 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0zndn0-0002jY-00; Wed, 9 Dec 1998 07:12:02 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (HAA05482); Wed, 9 Dec 1998 07:09:36 GMT
From: XLR8R251@aol.com
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 9 Dec 1998 07:09:25 GMT
Received: from imo24.mx.aol.com [198.81.17.68] by hermes via ESMTP (HAA05638); Wed, 9 Dec 1998 07:09:24 GMT
Received: from XLR8R251@aol.com
by imo24.mx.aol.com (IMOv18.1) id 0ZJIa19912
for ; Wed, 9 Dec 1998 02:08:46 -0500 (EST)
Message-ID:
Date: Wed, 9 Dec 1998 02:08:46 EST
To: csound@maths.ex.ac.uk
Mime-Version: 1.0
Subject: Re: drum kit
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Mailer: AOL 3.0 for Mac sub 84
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
Ok, I seem to have figured it out. The following:
>if inote==36 goto Kick
>if inote==38 goto Snare
>if inote==42 goto HHat
> goto end
should read like this:
if inote==36 goto kick
if inote==38 goto snare
if inote==42 goto hhat
; goto end
I'm not sure if the caps had anything to do with it, but commenting out the
"goto end" did. All things considered, I still have a problem I'd like your
help on. When I combine my instruments together in one .orc, midified, perf
crashes on me. It does so when skipping meta events from the .mid file.
"skipping meta event 58, skipping meta event 59, skipping meta" (then it
hangs) Trouble is, I've scoured my .mid file and cleaned it up as much as
possible, but can't seem to get rid of these meta events. Comments,
suggestions anyone?
Thanks again,
Dewey Cooksey
Received: from wallace.maths.bath.ac.uk by omphalos.maths.Bath.AC.UK id aa07382;
9 Dec 98 9:23 GMT
Received: from [144.173.6.14] (helo=exeter.ac.uk)
by wallace.maths.bath.ac.uk with esmtp (Exim 1.92 #2)
for jpff@maths.bath.ac.uk
id 0znfpq-0002qd-00; Wed, 9 Dec 1998 09:23:06 +0000
Received: from noether [144.173.8.10] by hermes via SMTP (JAA07086); Wed, 9 Dec 1998 09:19:30 GMT
Received: from exeter.ac.uk by maths.ex.ac.uk; Wed, 9 Dec 1998 09:19:16 GMT
Received: from jaguars-int.cableinet.net [193.38.113.9] by hermes via SMTP (JAA12788); Wed, 9 Dec 1998 09:19:16 GMT
Received: (qmail 16882 invoked from network); 9 Dec 1998 09:16:38 -0000
Received: from unknown (HELO cableinet.co.uk) (194.117.146.152)
by jaguars with SMTP; 9 Dec 1998 09:16:38 -0000
Message-ID: <366E41BA.935F5511@cableinet.co.uk>
Date: Wed, 09 Dec 1998 09:24:10 +0000
From: Richard Dobson
X-Mailer: Mozilla 4.5 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: XLR8R251@aol.com, csound@maths.ex.ac.uk
Subject: Re: drum kit
References:
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-csound-outgoing@maths.ex.ac.uk
Precedence: bulk
The problem is almost invariably the use of goto. Opcodes are not
initialized at performance time, but, well, at init time. Depending on what
MIDI notes are received, one or more of the linsegs is being skipped, so
they are not getting initialized. Commenting out the 'goto end' ameliorates
the problem, but probably doesn't eliminate it (I haven't had time this
morning to run it. The only safe method is to ensure all the linsegs and
similar are initialized at the start (use a special init pass, using igoto
if necessary), and then just ~use~ them at perf time.
Richard Dobson
http://www.wkweb5.cableinet.co.uk/rwd
XLR8R251@aol.com wrote:
>
> My apologies to those who recieve this twice. It looked like not all of this
> made it through the first time.
>
> *****
>
> Here is the "non-MIDI" instr. As you can see the only p references are to p4
> and p5, easily changeable to veloc and notnum. Sorry I didn't include it in
> my original post as I was at work. I have tried this version, without MIDI,
> and I am now getting the same error, so it must be somewhere in my code.
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 1
>
> ;f1 0 2048 10 1 ;sine wave
> ;f2 0 2049 5 1 256 .667 1792 .0001 ;exp env
>
> instr 4 ;Drum Kit
> ;=======================================
>
> iamp = p4*10
> inote = p5
>
> if inote==36 goto Kick
> if inote==38 goto Snare
> if inote==42 goto HHat
> goto end
> |