Csound Csound-dev Csound-tekno Search About

[Csnd] Stairstepping

Date2010-12-22 04:41
FromJim Aikin
Subject[Csnd] Stairstepping
I'd like to produce a glissando of equal-tempered frequency values from a
smooth ramp within a single note. Unfortunately, cpsxpch only works at
i-time, not at k-time. I tried to duck the issue by writing an opcode, but
this crashes Csound:

opcode	GetFreq	k, k
kVal		xin
iVal = i(kVal)
iOut	cpsxpch	iVal, 31, 2, 40
kOut = iOut
xout	kOut
endop

I can achieve my objective using table lookup, or from an arithmetic process
that turns the ramp into integers (which is what I was doing already, as the
input to the above opcode, after transforming the integers into values with
two decimal places) and then does various calculations to transform the
stairsteps into the desired frequencies. But if I do that, I'll have to
calculate all of the values for 31-note equal temperament by hand, and I'm
basically lazy. I'll do it if I have to....

Is there a k-time equivalent for cpsxpch, or a shortcut for getting
equivalent results via a simple formula?

Thanks!

--Jim Aikin

Date2010-12-22 09:52
Fromjoachim heintz
Subject[Csnd] Re: Stairstepping
if your base frequency is 100 Hz, and you want to calculate the 5th  
step of a 31-tone equal tempered scale, the formula is
100 * 2^(5/31)
or in general:
ibasfreq * 2^(istep/31)
is this what you meant?

	joachim


Am 22.12.2010 um 05:41 schrieb Jim Aikin:

>
> I'd like to produce a glissando of equal-tempered frequency values  
> from a
> smooth ramp within a single note. Unfortunately, cpsxpch only works at
> i-time, not at k-time. I tried to duck the issue by writing an  
> opcode, but
> this crashes Csound:
>
> opcode	GetFreq	k, k
> kVal		xin
> iVal = i(kVal)
> iOut	cpsxpch	iVal, 31, 2, 40
> kOut = iOut
> xout	kOut
> endop
>
> I can achieve my objective using table lookup, or from an arithmetic  
> process
> that turns the ramp into integers (which is what I was doing  
> already, as the
> input to the above opcode, after transforming the integers into  
> values with
> two decimal places) and then does various calculations to transform  
> the
> stairsteps into the desired frequencies. But if I do that, I'll have  
> to
> calculate all of the values for 31-note equal temperament by hand,  
> and I'm
> basically lazy. I'll do it if I have to....
>
> Is there a k-time equivalent for cpsxpch, or a shortcut for getting
> equivalent results via a simple formula?
>
> Thanks!
>
> --Jim Aikin
> -- 
> View this message in context: http://csound.1045644.n5.nabble.com/Stairstepping-tp3314586p3314586.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>
>



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"

Date2010-12-22 13:18
FromAndres Cabrera
Subject[Csnd] Re: Stairstepping
Hi Jim,

I've also been bitten by this bug... You forgot to add a comma after
the opcode name...

Cheers,
Andres

On Wed, Dec 22, 2010 at 4:41 AM, Jim Aikin  wrote:
>
> I'd like to produce a glissando of equal-tempered frequency values from a
> smooth ramp within a single note. Unfortunately, cpsxpch only works at
> i-time, not at k-time. I tried to duck the issue by writing an opcode, but
> this crashes Csound:
>
> opcode  GetFreq k, k
> kVal            xin
> iVal = i(kVal)
> iOut    cpsxpch iVal, 31, 2, 40
> kOut = iOut
> xout    kOut
> endop
>
> I can achieve my objective using table lookup, or from an arithmetic process
> that turns the ramp into integers (which is what I was doing already, as the
> input to the above opcode, after transforming the integers into values with
> two decimal places) and then does various calculations to transform the
> stairsteps into the desired frequencies. But if I do that, I'll have to
> calculate all of the values for 31-note equal temperament by hand, and I'm
> basically lazy. I'll do it if I have to....
>
> Is there a k-time equivalent for cpsxpch, or a shortcut for getting
> equivalent results via a simple formula?
>
> Thanks!
>
> --Jim Aikin
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Stairstepping-tp3314586p3314586.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>
>


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"


Date2010-12-23 05:56
FromJim Aikin
Subject[Csnd] Re: Stairstepping
Thanks, Joachim. And thanks, Andres.

In the next release, I hope the compiler will flag the absence of a comma as
an error.