Csound Csound-dev Csound-tekno Search About

[Csnd] Does madsr work with filters?

Date2013-06-28 16:43
FromShawnn O'rourke
Subject[Csnd] Does madsr work with filters?
I'm trying to use madsr to control the cut off frequency of a filter, but I can't get it to work.  In the instrument below, if I use madsr to control the amplitude of an oscillator, it works as I expect, but when I use it to control the cut off frequency of a filter all I hear is a click when I press a key.  Does madsr work with filters?  Or am I doing something wrong?

BTW, I'm using csound 5.11 (I haven't upgraded in a long time) on Windows 7.

Thanks,

Shawn

<CsoundSynthesizer>

<CsOptions>
; linux
;-odac:plughw:0,0 -iadc:plughw:0,0 -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0 -B2048 -b1024

; windows
-odac2 -+rtmidi=virtual -M1 -B2048 -b1024
</CsOptions>


<CsInstruments>
sr     = 44100
kr     = 4410
ksmps  = 10
nchnls = 1

;---- Insturment 1 ----

instr 1     
    kfrq cpsmidib 12
    iamp ampmidi 3000

    ;kenv madsr 0.5, 1, 0.5, 0.5
    ;asig oscil iamp*kenv, kfrq, 2
    asig oscil iamp, kfrq, 2

    kcf madsr 0.01, 1, 0.1, 0.5
    ;kcf expseg 1, 1, 0.1
    kcf = 10000*kcf
    afilt rezzy asig, kcf, 50

    ; reuse asig
    asig balance afilt, asig

    out asig
endin

</CsInstruments>
<CsScore>

f1  0 8192 10   1   
f2  0 8192 10   1 0.5 0.333 0.25 0.2 0.167 0.142 0.125 0.111 0.1

; play for 10 hours
f0 36000

</CsScore>
</CsoundSynthesizer>

Date2013-06-28 17:02
FromSteven Yi
SubjectRe: [Csnd] Does madsr work with filters?
My guess is that the filter doesn't like having a 0 value. You could
try doing something like:

kcf = 10000*kcf + 0.0001



On Fri, Jun 28, 2013 at 8:43 AM, Shawnn O'rourke  wrote:
> I'm trying to use madsr to control the cut off frequency of a filter, but I
> can't get it to work.  In the instrument below, if I use madsr to control
> the amplitude of an oscillator, it works as I expect, but when I use it to
> control the cut off frequency of a filter all I hear is a click when I press
> a key.  Does madsr work with filters?  Or am I doing something wrong?
>
> BTW, I'm using csound 5.11 (I haven't upgraded in a long time) on Windows 7.
>
> Thanks,
>
> Shawn
>
> 
>
> 
> ; linux
> ;-odac:plughw:0,0 -iadc:plughw:0,0 -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0
> -B2048 -b1024
>
> ; windows
> -odac2 -+rtmidi=virtual -M1 -B2048 -b1024
> 
>
>
> 
> sr     = 44100
> kr     = 4410
> ksmps  = 10
> nchnls = 1
>
> ;---- Insturment 1 ----
>
> instr 1
>     kfrq cpsmidib 12
>     iamp ampmidi 3000
>
>     ;kenv madsr 0.5, 1, 0.5, 0.5
>     ;asig oscil iamp*kenv, kfrq, 2
>     asig oscil iamp, kfrq, 2
>
>     kcf madsr 0.01, 1, 0.1, 0.5
>     ;kcf expseg 1, 1, 0.1
>     kcf = 10000*kcf
>     afilt rezzy asig, kcf, 50
>
>     ; reuse asig
>     asig balance afilt, asig
>
>     out asig
> endin
>
> 
> 
>
> f1  0 8192 10   1
> f2  0 8192 10   1 0.5 0.333 0.25 0.2 0.167 0.142 0.125 0.111 0.1
>
> ; play for 10 hours
> f0 36000
>
> 
> 

Date2013-06-28 17:20
FromShawnn O'rourke
SubjectRe: [Csnd] Does madsr work with filters?
Yep, that was it.  Thanks for the quick response!



From: Steven Yi <stevenyi@gmail.com>
To: Csound <csound@lists.bath.ac.uk>
Sent: Friday, June 28, 2013 9:02 AM
Subject: Re: [Csnd] Does madsr work with filters?

My guess is that the filter doesn't like having a 0 value. You could
try doing something like:

kcf = 10000*kcf + 0.0001



On Fri, Jun 28, 2013 at 8:43 AM, Shawnn O'rourke <shawno1059@yahoo.com> wrote:
> I'm trying to use madsr to control the cut off frequency of a filter, but I
> can't get it to work.  In the instrument below, if I use madsr to control
> the amplitude of an oscillator, it works as I expect, but when I use it to
> control the cut off frequency of a filter all I hear is a click when I press
> a key.  Does madsr work with filters?  Or am I doing something wrong?
>
> BTW, I'm using csound 5.11 (I haven't upgraded in a long time) on Windows 7.
>
> Thanks,
>
> Shawn
>
> <CsoundSynthesizer>
>
> <CsOptions>
> ; linux
> ;-odac:plughw:0,0 -iadc:plughw:0,0 -+rtaudio=alsa -+rtmidi=alsa -M hw:1,0
> -B2048 -b1024
>
> ; windows
> -odac2 -+rtmidi=virtual -M1 -B2048 -b1024
> </CsOptions>
>
>
> <CsInstruments>
> sr    = 44100
> kr    = 4410
> ksmps  = 10
> nchnls = 1
>
> ;---- Insturment 1 ----
>
> instr 1
>    kfrq cpsmidib 12
>    iamp ampmidi 3000
>
>    ;kenv madsr 0.5, 1, 0.5, 0.5
>    ;asig oscil iamp*kenv, kfrq, 2
>    asig oscil iamp, kfrq, 2
>
>    kcf madsr 0.01, 1, 0.1, 0.5
>    ;kcf expseg 1, 1, 0.1
>    kcf = 10000*kcf
>    afilt rezzy asig, kcf, 50
>
>    ; reuse asig
>    asig balance afilt, asig
>
>    out asig
> endin
>
> </CsInstruments>
> <CsScore>
>
> f1  0 8192 10  1
> f2  0 8192 10  1 0.5 0.333 0.25 0.2 0.167 0.142 0.125 0.111 0.1
>
> ; play for 10 hours
> f0 36000
>
> </CsScore>
> </CsoundSynthesizer>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"