if then at audio rate?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

if then at audio rate?

zappfinger
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: if then at audio rate?

Victor Lazzarini
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 <[hidden email]> 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: if then at audio rate?

Adam Puckett-2
Interesting solution Victor, definitely more elegant than mine.

Here's mine:

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



On 2/10/12, Victor <[hidden email]> 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 <[hidden email]> 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 [hidden email] 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: if then at audio rate?

joachim-3
In reply to this post by Victor Lazzarini
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 <[hidden email]> 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 [hidden email] 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: if then at audio rate?

zappfinger
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: if then at audio rate?

Victor Lazzarini
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 [hidden email] 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





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 [hidden email] with body "unsubscribe csound"

Loading...