Csound Csound-dev Csound-tekno Search About

Re: parameter interpolation

Date2007-08-26 03:07
From"Art Hunkins"
SubjectRe: parameter interpolation
Line works at k-rate; I don't think reinits are necessary. And it doesn't
add lag like portk.

Art Hunkins

----- Original Message ----- 
From: "Greg Thompson" 
To: 
Sent: Saturday, August 25, 2007 7:31 PM
Subject: Re: [Csnd] parameter interpolation


> Thanks - portk works for now.  I figured I could just use a control
> rate filter.  Wanted to make sure I wasn't overlooking anything.
>
> Yikes, are you suggesting bundling reinits in UDOs?  That sounds like
> some nasty code. :)
>
> thanks
> greg
>
> On Aug 25, 2007, at 7:18 PM, Oeyvind Brandtsegg wrote:
>
> > The simplest way is to use portk or tonek.
> > This won't give you a linear sweep though,
> > for that you would use a line opcode and reinit, admittedly a bit
> > kludgy but could maybe be put into a UDO (if there's not one tht does
> > this already).
> > Oeyvind
> >
> >
> > 2007/8/26, Greg Thompson :
> >>
> >>
> >> gisin ftgen 0, 0, 4096, 10, 1, 0.5, 0.25, 0.125, 0.0625, 0.03125,
> >> 0.015625
> >>
> >>     instr 10
> >> iBasePitch = p4
> >>
> >> kFreePitch  chnget "Pitch"
> >> kAmpChannel chnget "Amp"
> >>
> >> kPitch  = cpspch(iBasePitch + kFreePitch)
> >>
> >> aAmp    interp  kAmpChannel
> >>
> >> aAmp    = ampdbfs(aAmp)
> >>
> >> kEnv    line    1.0, p3, 0.0
> >>
> >> a1      oscili aAmp * kEnv, kPitch, gisin
> >>
> >>         outs a1, a1
> >>
> >>     endin
> >>
> >>
> >>
> >>
> >> So, I have a slider representing pitch and amplitude.  I'm using
> >> channels to
> >> pass values into the orchestra.  So, in this case, I'm using the
> >> chnget
> >> opcode.
> >>
> >> I'm wondering how I do some simple form of interpolation so if I
> >> get a value
> >> of 1.0 at time t1 and then 2.0 at time t2.  It gradual shifts from
> >> 1.0 to
> >> 2.0 over a slew time.  In Max, I would use the line object.
> >>
> >> Can one suggest a proper way to do this in Csound?
> >>
> >> thanks
> >> greg
> > -- 
> > Send bugs reports to this list.
> > To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
> >
>
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk