Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-03-04 Thread Olli Niemitalo
A simple way to stabilize most quadrature oscillators including Martin's quadrature oscillator is to multiply each state variable by a temporary variable: g = 1.5 - 0.5*(u*u + v*v) where u and v are unit-amplitude quadrature oscillator outputs. The correction does not need to be done very

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-03-03 Thread Olli Niemitalo
On Thu, Feb 21, 2019 at 11:16 PM robert bristow-johnson wrote: > But Martin, if you let this thing run for days on end, would not eventually > the amplitude of the output change a bit? Short answer: yes, sometimes significantly for audio purposes when using 32-bit float state variables, but

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-26 Thread STEFFAN DIEDRICHSEN
Martin, thanks for (re-)posting this. I had a look at your website and found some articles, which are very interesting. The idea of the reverse IIR filter is super brilliant. Best, Steffan > On 21.02.2019|KW8, at 19:33, Martin Vicanek wrote: > > You can have both: A (hyper)stable

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-23 Thread Andrew Simper
;x2 = triangle*triangle; >return triangle*(1.570781972 - x2*(0.6458482979 - x2*(0.07935067784 - > x2*0.004284352588))); > } > > i haven't run this code nor checked it for syntax. but it's conceptually > so simple that i'll bet it works. > > r b-j > > ------

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-22 Thread robert bristow-johnson
inal Message ---- Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator From: "Olli Niemitalo" Date: Thu, February 21, 2019 11:58 pm To: "A discussion list for music-related DSP" -- > On

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Olli Niemitalo
On Fri, Feb 22, 2019 at 9:08 AM robert bristow-johnson < r...@audioimagination.com> wrote: > i just got in touch with Olli, and this "triangle wave to sine wave" > shaper polynomial is discussed at this Stack Exchange: > > > >

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread robert bristow-johnson
al Message Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator From: "robert bristow-johnson" Date: Thu, February 21, 2019 1:33 pm To: "A discussion l

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Andrew Simper
On Thu, 21 Feb 2019 at 16:06, robert bristow-johnson < r...@audioimagination.com> wrote: > > > Original Message ---- > Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator > From: "Andrew Simper"

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread robert bristow-johnson
to a sinusoid. i thought, years ago, we were discussing this and Olli Niemeto had optimized coefficients for the polynomial. r b-j Original Message Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator From: "Phil Burk"

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread robert bristow-johnson
Original Message Subject: [music-dsp] Time-variant 2nd-order sinusoidal resonator From: "Martin Vicanek" Date: Thu, February 21, 2019 10:33 am To: music-dsp@music.columbia.edu

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Dario Sanfilippo
This looks great. Thanks, Martin. Dario On Thu, 21 Feb 2019 at 19:33, Martin Vicanek wrote: > *Ian wrote: > Every time you modify the filter coefficients, modify the state of the > **filter so that it will produce the output you are expecting. Easy to

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Phil Burk
Another approach is to use a Taylor Expansion. It's pretty accurate in the first quadrant. One advantage over the resonator is that it does not drift. Another advantage is that you can do FM without paying the penalty of recalculating the coefficients. Here is some free Java source.

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Ethan Fenn
You probably won't need to correct the amplitude every sample because the error introduced every tick should be tiny. You can do it every N samples and just see what value of N introduces an acceptable amount of noise. Or just fold the amplitude management in as Robert suggests, that way you get

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread STEFFAN DIEDRICHSEN
If an update on a zero-crossing is enough, you might want to take a look at the wave guide oscillator: https://ccrma.stanford.edu/~jos/pasp/Digital_Waveguide_Oscillator.html It does like updates at zero-crossings, but needs some history corrections. The coupled-form oscillator, as discussed in

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread Dario Sanfilippo
wrote: > > > Original Message ---- > Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator > From: "Andrew Simper" > Date: Wed, February 20, 2019 9:20 pm > To: "Robert Bristow-Johnson&qu

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-21 Thread robert bristow-johnson
Original Message Subject: Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator From: "Andrew Simper" Date: Wed, February 20, 2019 9:20 pm To: "Robert Bristow-Johnson" "A discussion l

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread Andrew Simper
This looks pretty good to me, and I like the amplitude adjustment g[n] term :) Depending on the situation you may want to modulate the frequency of the oscillator pretty fast, so it can help to use a tan approximation function and then a division and a few other operations to get your cos (w) and

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread robert bristow-johnson
i did that wrong.  i meant to say:      x[n] = a[n] + j*b[n] = g[n-1]*exp(j*w[n]) * x[n-1]   this is the same as     a[n] = g[n-1]*cos(w[n])*a[n-1] - g[n-1]*sin(w[n])*b[n-1]  

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread robert bristow-johnson
On Wed, February 20, 2019 9:10 pm, "Ethan Fenn" wrote: > > A very simple oscillator recipe is: > > a(t+1) = C*a(t) - S*b(t) > b(t+1) = S*a(t) + C*b(t) > > Where C=cos(w), S=sin(w), w being the angular frequency. a and b are your > two state variables that are updated every sample

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread Evan Balster
Hello — The method Ethan recommends is sometimes known as a Variable Phasor , and I'm quite fond of these! I like to visualize them as the hand of a clock. The update function is effectively a complex product (which works like a rotation) and you can use a

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread Ethan Fenn
A very simple oscillator recipe is: a(t+1) = C*a(t) - S*b(t) b(t+1) = S*a(t) + C*b(t) Where C=cos(w), S=sin(w), w being the angular frequency. a and b are your two state variables that are updated every sample clock, either of which you can use as your output. There won't be any phase or

Re: [music-dsp] Time-variant 2nd-order sinusoidal resonator

2019-02-20 Thread Ian Esten
The problem you are experiencing is caused by the fact that after changing the filter coefficients, the state of the filter produces something different to the current output. There are several ways to solve the problem: - The time varying bilinear transform: