On 11/14, Oleg Nesterov wrote:
>
> On 08/21, Oleg Nesterov wrote:
> >
> > On 08/20, Julius Smith wrote:
> > >
> > > Pretty fun!  This looks closely related Andy Moorer's technique:
> > >
> > > @ARTICLE{MoorerDSF75,
> > >         AUTHOR = "James A. Moorer",
> > >         TITLE = "The Synthesis of Complex Audio Spectra by Means of
> > >                 Discrete Summation Formulae",
> > >         JOURNAL = JAES,
> > >         VOLUME = 24,
> > >         PAGES = {717--727},
> > >         MONTH = dec,
> > >         NOTE = "Also available as CCRMA Report no.
> > > \htmladdnormallink{STAN-M-5}{https://ccrma.stanford.edu/STANM/stanms/stanm5/
> > > }",
> > >         YEAR = 1975
> > > }
> >
> > Thanks! At first glance I don't think this is very closely related
> > but interesting.
>
> So yes, this is another thing, I'll try to make another PR, I already
> have the code.

That paper has a lot of great ideas, but I would like to add the basic
oscillator(s) for the start.

Looks "obviously useful". The code is very simple.

But. I don't know how to document it properly. And of course, the naming.
Please see my best effort below.

Do you all have any suggestions on how I can improve the docs/naming?

Thanks,

Oleg.

//-----------------`(os.)xxx`-------------------------------
// An environment with sinusoidal oscillators with exponentially decaying 
harmonics
//
// #### Example test program
//
// ```
//     xxx.oscN(4, a, 1000,500)
// ```
//
// outputs:
//
// ```
//    so(1000) + a*so(1500) + a^2*so(2000) + a^3*so(2500) with { so = quadosc : 
!,_; }
// ```
//
// #### Reference
// https://ccrma.stanford.edu/STANM/stanms/stanm5/stanm5.pdf
// ---------------------------------------------------------
xxx = environment {
        qo = quadosc;
        co = qo : _,!;
        so = qo : !,_;

        // infinite number of harmonics, implies aliasing
        osc(a,f0,df) = (so(f0) - a*so(f0-df)) / (1 + a^2 - 2*a*co(df));

        // n harmonics, f0, f0 + df, ..., f0 + (n-1)*df
        oscN(n,a,f0,df) = osc(a,f0,df) - a^n * osc(a,fn,df)
        with {
                fn = f0 + n*df;
        };

        // finite number of harmonics, from f0 to nyquist
        oscNq(a,f0,df) = oscN(n,a,f0,df)
        with {
                n = (ma.SR/2 - f0) / df : int;
        };
};



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to