Re: Observer pattern limitations




Leslie Sanford wrote:
"David Barrett-Lennard" wrote:
Leslie Sanford wrote:

<snip>

Let's say that operator 1 and 2 have been marked dirty. We call "get"
on the output of 2 to get the results of the algorithm. Operator 2
enters a "getting" state in which it is refreshing itself. During
this phase, it calls "get" on operator 1. Operator 1 begins
refreshing itself.

Operator 1 calls "get" on operator 2 to get input for its feedback.
But! Operator 2 is already in the process of "getting." So what does
it do? Does this second call create infinite recursion? It shouldn't.
What should happen is that the previous value of Operator 2 should be
returned to Operator 1. In other words, during its "getting" state,
any calls to "get" should return the previous value of the operator.
What this implies is that each operator has to preserve its state
until the "getting" phase completes. At the very end of this phase,
it trades its old value with the new one.

This makes sense to me, but unless it is allowed to repeat the loop a
few times and converge to a fixed point solution (if it converges at
all), I'm not sure about the utility of the idea because the output
depends on the initial state, or is that what you want?

It's as if the diagram represents an algorithm for applying a
mutative operation to its existing state to yield a new state.

One thing I didn't mention, and this clarify things, each
operator represents a sine waveform. You can think of each operator as
an iterator that iterates through a circular buffer holding a sine
waveform. The speed with which the operator iterates through the
waveform is determined by its initial settings and the modulation it is
receiving via its input. The algorithm is run repeatedly, once for each
sample, to synthesize a waveform in real time. Each time the algorithm
is run, the operators move forward through the sine wavetable. The
resulting waveform is sent to the keyboard's output from which you can
plug in a mixer or amplifier or whatever that lets you listen to the
sound.

It certainly does clarify things.

Cheers,
David Barrett-Lennard

.



Relevant Pages

  • Re: Observer pattern limitations
    ... on the output of 2 to get the results of the algorithm. ... enters a "getting" state in which it is refreshing itself. ... operator represents a sine waveform. ... The speed with which the operator iterates through the ...
    (comp.object)
  • Re: Whats all this Magic Sinewave stuff anyway?
    ... Presumably with a sinewave algorithm. ... Yeah, a class D amp instead of a linear amp would be better, ... you would like the waveform to LOOK like a sinewave on a scope) ...
    (sci.energy.hydrogen)
  • Re: How do I set or clear the Sign Flag?
    ... If you mean that random numbers, created by reading the SID noise ... waveform, don't seem to be random, yes, they're not. ... it's _the_ algorithm) in x86 ASM but I'm sure you can find it in the ...
    (comp.sys.cbm)
  • Re: Observer pattern limitations
    ... the output of one operator can feedback into ... Perhaps this is how cyclic dependencies could be treated ... the output of 2 to get the results of the algorithm. ... "getting" state in which it is refreshing itself. ...
    (comp.object)
  • Re: Observer pattern limitations
    ... the output of one operator can feedback into ... Perhaps this is how cyclic dependencies could be treated ... the output of 2 to get the results of the algorithm. ... "getting" state in which it is refreshing itself. ...
    (comp.object)