Csound Csound-dev Csound-tekno Search About

[Csnd] if then at audio rate?

Date2012-02-10 22:07
Fromzappfinger
Subject[Csnd] if then at audio rate?
I am trying to detect some peaks in an audio signal as it comes in, but

 	if (ain > 2.0) then

does not work for audio rate signals?



Richard

--
View this message in context: http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5473889.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-02-10 23:08
FromVictor
SubjectRe: [Csnd] if then at audio rate?
The solution to this is: use a UDO with setksmps 1 copy the audio signal into a krate var, using downsamp, do the comparison, output the result.



On 10 Feb 2012, at 22:07, zappfinger  wrote:

> I am trying to detect some peaks in an audio signal as it comes in, but
> 
>    if (ain > 2.0) then
> 
> does not work for audio rate signals?
> 
> 
> 
> Richard
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5473889.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"
> 


Date2012-02-10 23:22
FromAdam Puckett
SubjectRe: [Csnd] if then at audio rate?
Interesting solution Victor, definitely more elegant than mine.

Here's mine:

if(i(k(aval)) == 1.0) then ;...



On 2/10/12, Victor  wrote:
> The solution to this is: use a UDO with setksmps 1 copy the audio signal
> into a krate var, using downsamp, do the comparison, output the result.
>
>
>
> On 10 Feb 2012, at 22:07, zappfinger  wrote:
>
>> I am trying to detect some peaks in an audio signal as it comes in, but
>>
>>    if (ain > 2.0) then
>>
>> does not work for audio rate signals?
>>
>>
>>
>> Richard
>>
>> --
>> View this message in context:
>> http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5473889.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"
>
>

Date2012-02-11 11:57
Fromjoachim heintz
SubjectRe: [Csnd] if then at audio rate?
or use the max_k opcode, which might be more effective in terms of cpu
usage.
	joachim

Am 11.02.2012 00:08, schrieb Victor:
> The solution to this is: use a UDO with setksmps 1 copy the audio signal into a krate var, using downsamp, do the comparison, output the result.
> 
> 
> 
> On 10 Feb 2012, at 22:07, zappfinger  wrote:
> 
>> I am trying to detect some peaks in an audio signal as it comes in, but
>>
>>    if (ain > 2.0) then
>>
>> does not work for audio rate signals?
>>
>>
>>
>> Richard
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5473889.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"
> 
> 

Date2012-02-11 12:59
Fromzappfinger
Subject[Csnd] Re: if then at audio rate?
Most elegant, Joachim.

Victor's solution is also very interesting, since it would mean that you can
do manipulation at the a rate level..

Richard

--
View this message in context: http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5474910.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2012-02-11 17:28
FromVictor Lazzarini
SubjectRe: [Csnd] Re: if then at audio rate?
yes, if you want to implement any sample-level DSP, the most efficient solution is to do it in a UDO. I use this approach all the time when prototyping DSP algorithms.

Victor
On 11 Feb 2012, at 12:59, zappfinger wrote:

> Most elegant, Joachim.
> 
> Victor's solution is also very interesting, since it would mean that you can
> do manipulation at the a rate level..
> 
> Richard
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/if-then-at-audio-rate-tp5473889p5474910.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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie