Csound Csound-dev Csound-tekno Search About

Re: feed back loops

Date1997-10-13 15:37
Fromjames@maths.ex.ac.uk
SubjectRe: feed back loops
owner-csound-outgoing wrote
>From owner-csound-outgoing Thu Oct  2 14:54:11 1997
From: owner-csound-outgoing
Date: Thu, 2 Oct 97 14:54:11 GMT
Message-Id: <21826.9710021454@maths.exeter.ac.uk>
To: owner-csound-outgoing
Subject: BOUNCE Csound: Non-member submission from [Erik Spjut ]

>From Erik_Spjut@HMC.Edu Thu Oct  2 15:54:06 1997 remote from 
Received: from hermes.ex.ac.uk by maths.exeter.ac.uk; Thu, 2 Oct 97 15:54:06 +0100
Received: from Thuban.AC.HMC.Edu [134.173.53.8] by hermes via ESMTP (PAA15018); Thu, 2 Oct 1997 15:53:57 +0100
Received: from [134.173.38.61] (Spjut.Eng.HMC.Edu)
 by THUBAN.AC.HMC.EDU (PMDF V5.1-7 #18017)
 with ESMTP id <01IOBO8ZVD6G9OILW6@THUBAN.AC.HMC.EDU> for
 csound@maths.exeter.ac.uk; Thu, 2 Oct 1997 07:55:29 PDT
Date: Thu, 02 Oct 1997 07:55:33 -0700
From: Erik Spjut 
Subject: Re: feed back loops
In-Reply-To: <34316D2C.88949076@cc.gatech.edu>
X-Sender: spjut@thuban.ac.hmc.edu
To: charlie hubbard , csound 
Message-Id: 
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

At 4:20 PM -0500 9/30/97, charlie hubbard wrote:
>Can someone give me an example of a feedback loop?
>Is that possible in csound or do you have to synthesize
>a feedback loop like that?

Feedback loops are possible in Csound but you have to set kr=sr to make
them work. Short ones (of one or two samples) are relatively easy. Long
ones (like 0.5 seconds) are well nigh impossible. Russel Pinkston has
several examples in his orc's. A short example (with two 1-sample feedback
loops) follows:

sr     = 44100
kr     = 44100 ;permit access to aprev's
ksmps  = 1
nchnls = 1
;-------------------------------------------
        instr 10;IIR Filter Example (thanks to Russell Pinkston)
a1      linseg  0, 0.01, 10000, p3-0.1,9000,0.09,0,1,0
a2      oscil   a1,p4, 1 ;Generate an input
aprev1  init    0                       ; init y(n-1) to 0
aprev2  init    0                       ; init y(n-2) to 0
ainput   =      a2
;              y(n) = a0x(n) - b1y(n-1) - b2y(n-2)
aoutput =       1*ainput - 0.5*aprev1 - 0.5*aprev2
aprev2  =       aprev1
aprev1  =       aoutput
        out     aoutput
        endin

-------------------------------------------------------------------------------
Erik Spjut (rhymes with cute) - Acting Director,The Center for Design Education
and/or Associate Professor of Engineering
Harvey Mudd College, Claremont, CA 91711  USA
Erik_Spjut@hmc.edu      Ph & Voice mail (909) 607-3890      Fax (909) 621-8967



-- 
James Andrews, maths CDO, ext.3977