Re: CVS commit - 0.95.07
Jan Depner <[email protected]>
| Newsgroups | gmane.comp.audio.jamin.devel |
|---|---|
| Message-ID | <1178364512.21602.3.camel@eviltwin> |
On Sat, 2007-05-05 at 12:12 +0100, Steve Harris wrote:
> On 4 May 2007, at 18:47, Jan Depner wrote:
>
> > On Fri, 2007-05-04 at 12:24 -0500, Jan Depner wrote:
> >> OK, I've got the meters set up for RMS on output and I've got the
> >> function calls set up in intrim.c to handle it. If someone can
> >> figure
> >> out how to compute RMS using Steve's routines -
> >> http://www.ecs.soton.ac.uk/~swh/rms/ we can get this thing
> >> working. I
> >> am assuming that the calls would need to go in the following loop in
> >> process.c :
> >>
> >> for (pos = 0; pos < nframes; pos++) {
> >> for (port = 0; port < nchannels; port++) {
> >> const float oa = fabs(out[port][pos]);
> >>
> >> if (oa > lim_peak[LIM_PEAK_OUT]) {
> >> lim_peak[LIM_PEAK_OUT] = oa;
> >> }
> >> if (oa > out_peak[port]) {
> >> out_peak[port] = oa;
> >> }
> >> }
> >> }
> >>
> >> but I'm probably wrong ;-)
> >>
> >
> > Just for fun I implemented the "naive" RMS in the above loop
> > and it
> > looks purty (as we say down here in the South). It's probably not
> > what
> > we're looking for but it does prove that I've got the meters and
> > callbacks set up properly ;-)
>
> Great!
>
> To hook up the code, you just need to initialise the RMS object with
> a call to rms_new(), then call rms_run_buffer() on each audio buffer,
> and the float that you get back is the RMS signal level.
>
I just put this into process_signal :
for (port = 0 ; port < nchannels ; port++)
{
rms *r;
r = rms_new (sample_rate, 0.1);
rms_peak[port] = rms_run_buffer (r, out[port], nframes);
rms_free (r);
}
rms_peak is a misnomer but I was just duping the out_peak code and it
was easier ;-) The RMS meters come up with a value of about -20.0 and
they don't look quite right to me so I probably did something wrong. I
can commit the changes and then you can take a look to see what's wrong
if you have time.
> - Steve
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Jamin-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jamin-devel
--
Jan 'Evil Twin' Depner
http://myweb.cableone.net/eviltwin69
"Life should NOT be a journey to the grave with the intention of
arriving safely in an attractive and well preserved body, but rather to
skid in sideways, chardonnay in one hand, chocolate in the other, body
thoroughly used up, totally worn out, and screaming 'WOO HOO, what a ride'"
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/