| Hi Kevin,
The code for rms is available at:
https://github.com/csound/csound/blob/develop/OOps/ugens5.c#L1197-L1207
https://github.com/csound/csound/blob/develop/OOps/ugens5.c#L1233-L1252
The first link is for rmsset, the initialization code, and the second
link is for the perf-time code.
>From what I understand, the value of ihp has zero effect on
performance. It is only used to calculate c1 and c2 coefficients
internally.
Beyond that, I haven't studied the processing code so I can not give any advice.
steven
On Wed, Jul 27, 2016 at 5:01 PM, Kevin Welsh wrote:
> I'm attempting to use the rms opcode to detect clipping in an
> instrument. The opcode allows you to optionally set a half power
> point, with the default value being 10.
>
> I've noticed that detecting clipping with the "hpp" set at 10 is very
> ineffective... and after some experimentation it seems that setting it
> much higher (currently set to 22050 but that is purely arbitrary and
> doesn't seem to need to be related to "sr") yields much better results
> in my detection of the clipping. If I understand what is happening,
> using the hpp of 10 means I would only be detecting clipping in the
> lower end (probably subaudible) end of the spectrum.
>
> First and most importantly, is setting the hpp so high a bad idea from
> a performance standpoint? I don't want to cause rms to use more
> resources than needed, since the end goal is to use this in cabbage
> plugins in a DAW with lots of other processing happening real time. I
> don't think it should matter one bit as it's basically just changing a
> filter cutoff point, but I'm hoping someone who knows that for a fact
> can confirm that I'm not doing something silly.
>
> Second, is there a more "ideal" hpp setting for detecting clipping in
> a harmonically rich setting? Or maybe another way to do this entirely
> that might be more efficient?
>
> Thanks for any pointers and advice!
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |