Csound Csound-dev Csound-tekno Search About

[Csnd] Re: a-rate if

Date2008-07-07 15:40
FromMichael Bechard
Subject[Csnd] Re: a-rate if
For handling a-to-k-rate manipulations I use downsamp to get from a to k-rate, and upsamp going the other way. I think downsamp does use averaging (or something like that?), but at ksmps=1 it won't matter.

Michael Bechard



----- Original Message ----
From: Joseph Sanger 
To: csound@lists.bath.ac.uk
Sent: Monday, July 7, 2008 9:12:00 AM
Subject: [Csnd] a-rate if

Hello again list,

I really want to do something like this:

    if        a1>a2    then

    ; some stuff

    endif

But if-statements don't work with a-rate variables.

I'm doing non-real-time stuff with ksmps=1, and I even tried changing 
all variables to k-rate and then using a(kout) at the end but ended up 
having all sorts of other difficulties, which I haven't got to the 
bottom of yet.

The only workaround I have so far is to copy the arate to krate using 
max_k (which is the only opcode I could find to do this) and then 
compare them, but I feel like I'm going round the houses a bit, so:

1. Is there a simpler / more elegant solution?

2. Is there another opcode which I've overlooked? Like the 'a' opcode, 
but in reverse; something which simply copies the a-rate variable to 
k-rate every ksmps, without averaging or finding the maximum.

3. Is there any reason why 'if' can't be made to accept a-rate variables 
in the (near!) future?

Yours gratefully,

Joe


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"