<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yiv5676430106"><div id="yui_3_16_0_1_1448133741263_8013"><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_1_1448133741263_8012"><div dir="ltr" id="yiv5676430106yui_3_16_0_1_1448133741263_5357"><span id="yiv5676430106yui_3_16_0_1_1448133741263_5364">Including the case of Pd Double @ PD_FLOAT_PRECISION == 32</span></div> <br clear="none"><div class="yiv5676430106qtdSeparateBR" id="yui_3_16_0_1_1448133741263_8011"><br clear="none"><br clear="none"></div><div class="yiv5676430106yqt2040310087" id="yiv5676430106yqt00131"></div></div></div></div><div class=".yiv5676430106yahoo_quoted"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> On Saturday, November 21, 2015 2:40 PM, Jonathan Wilkes <jancsika@yahoo.com> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv5676430106y_msg_container"><div id="yiv5676430106"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"><div id="yiv5676430106yui_3_16_0_1_1448133741263_4546"><span>What's Pd Double do in this case?</span></div><div id="yiv5676430106yui_3_16_0_1_1448133741263_4545"><span><br clear="none"></span></div><div id="yiv5676430106yui_3_16_0_1_1448133741263_4549"><span>-Jonathan</span></div> <br clear="none"><div class="yiv5676430106qtdSeparateBR"><br clear="none"><br clear="none"></div><div class="yiv5676430106yahoo_quoted" style="display:block;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div class="yiv5676430106yqt1901456416" id="yiv5676430106yqt27926"><div dir="ltr"><font size="2" face="Arial"> On Saturday, November 21, 2015 2:25 PM, Matt Barber <brbrofsvl@gmail.com> wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div class="yiv5676430106y_msg_container"><div id="yiv5676430106"><div><div dir="ltr"><div class="yiv5676430106gmail_default" style="font-family:verdana, sans-serif;">Try it with an 8-point table and [tabosc4~]. It's still far more stable than [osc~].</div><div class="yiv5676430106gmail_default" style="font-family:verdana, sans-serif;"><br clear="none"></div><div class="yiv5676430106gmail_default" style="font-family:verdana, sans-serif;"><br clear="none"></div></div><div class="yiv5676430106gmail_extra"><br clear="none"><div class="yiv5676430106yqt8872662872" id="yiv5676430106yqtfd72677"><div class="yiv5676430106gmail_quote">On Sat, Nov 21, 2015 at 1:50 PM, Christof Ressi <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:christof.ressi@gmx.at" target="_blank" href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>></span> wrote:<br clear="none"><blockquote class="yiv5676430106gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I've found the reason! Looking at the Pd source code (d_osc.c and m_pd.h) [osc~] seems to read from a 512 (1<<9) point wavetable (defined by LOGCOSTABSIZE and COSTABSIZE in m_pd.h), whereas SuperCollider's SinOsc uses 8192 points. (Both programs do their audio math with 32-bit floats.)<br clear="none">
So I tried to substitute [osc~] with [tabosc4~] reading from a 8192 point wavetable (done with a simple cosinesum) - and the result is far more stable (although not perfect)! I think you can't really prevent this kind of drift with FM, although you can keep it very small by using very large wavetables. The better solution, however, is using PM, as you've discovered anyway.<br clear="none">
 <br clear="none">
<br clear="none">
Gesendet: Samstag, 21. November 2015 um 19:12 Uhr<br clear="none">
<span class="yiv5676430106">Von: "Alexandre Torres Porres" <<a rel="nofollow" shape="rect" ymailto="mailto:porres@gmail.com" target="_blank" href="mailto:porres@gmail.com">porres@gmail.com</a>><br clear="none">
</span>An: "Christof Ressi" <<a rel="nofollow" shape="rect" ymailto="mailto:christof.ressi@gmx.at" target="_blank" href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>><br clear="none">
Cc: Pd-List <<a rel="nofollow" shape="rect" ymailto="mailto:pd-list@lists.iem.at" target="_blank" href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>><br clear="none">
Betreff: Re: Re: [PD] oscillators (osc~ / cycle~) not working well in FM?<br clear="none">
<span class="yiv5676430106"><br clear="none">
> Does this make sense? :-D<br clear="none">
 <br clear="none">
yeah, I kinda had the same idea<br clear="none">
 <br clear="none">
> Can anyone explain why this kind doesn't in SC or Max?<br clear="none">
 <br clear="none">
that what I'd really love to know<br clear="none">
 <br clear="none">
here's my SC code that relates to my first example patch I posted here<br clear="none">
 <br clear="none">
<br clear="none">
// 0Hz FM<br clear="none">
{SinOsc.ar(SinOsc.ar(100, 0, 100 * 2pi), pi/2)}.scope<br clear="none">
 <br clear="none">
quite stable<br clear="none">
 <br clear="none">
2015-11-21 15:47 GMT-02:00 Christof Ressi <<a rel="nofollow" shape="rect" ymailto="mailto:christof.ressi@gmx.at" target="_blank" href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>>:<br clear="none">
<br clear="none">
Hey Alexander, that's very interesting! What's funny: when using [metro] + [vline~] instead of [phasor~], the drift is clearly slower. As you noted, PM seems to be stable (It is noteworthy that DX7 actually uses PM for better stability).<br clear="none">
 <br clear="none">
My guess it, it has something to do with rounding errors. And I can somehow intuitively see how this will affect FM but not PM:<br clear="none">
 <br clear="none">
Let's imagine a huge truck on a highway. On the truck is another car which can move forwards and backwards. And then there's a motercycle going at a fixed speed.<br clear="none">
 <br clear="none">
FM -> The car would remain fixed on the truck and someone would press and release the gas pedal of the truck periodically (starting from the same speed as the motercycle). If the amount of pressure/relief is not 100% precise, you can't really tell where exactly the car+truck will be after a couple of miles, even if the timing of manipulating the gas pedal is 100% exact, because small errors in speed will immediately result in small but lasting errors in location. So there will probably be a slow drift over time between the truck+car and the motercycle.<br clear="none">
 <br clear="none">
PM -> The truck moves at a fixed speed (same as the motorcycle) while the car on the truck goes forwards and backwards at a fixed intervall. The car is guaranteed to be in the middle of truck every N seconds. So even if the movement of the car might not be perfect, the location is 100% predictable at least every N*k seconds and this means that it will stay in phase with the motorcycle.<br clear="none">
 <br clear="none">
Does this make sense? :-D<br clear="none">
 <br clear="none">
Can anyone explain why this kind doesn't in SC or Max??? (I didn't test it myself) Larger look-up tables? More precision?<br clear="none">
 <br clear="none">
 <br clear="none">
<br clear="none">
Gesendet: Samstag, 21. November 2015 um 17:06 Uhr<br clear="none">
</span>Von: "Alexandre Torres Porres" <<a rel="nofollow" shape="rect" ymailto="mailto:porres@gmail.com" target="_blank" href="mailto:porres@gmail.com">porres@gmail.com</a>[<a rel="nofollow" shape="rect" ymailto="mailto:porres@gmail.com" target="_blank" href="mailto:porres@gmail.com">porres@gmail.com</a>]><br clear="none">
An: "Roman Haefeli" <<a rel="nofollow" shape="rect" ymailto="mailto:reduzent@gmail.com" target="_blank" href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>[<a rel="nofollow" shape="rect" ymailto="mailto:reduzent@gmail.com" target="_blank" href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>]><br clear="none">
Cc: "<a rel="nofollow" shape="rect" ymailto="mailto:pd-list@lists.iem.at" target="_blank" href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>[<a rel="nofollow" shape="rect" ymailto="mailto:pd-list@lists.iem.at" target="_blank" href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>]" <<a rel="nofollow" shape="rect" ymailto="mailto:pd-list@lists.iem.at" target="_blank" href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>[<a rel="nofollow" shape="rect" ymailto="mailto:pd-list@lists.iem.at" target="_blank" href="mailto:pd-list@lists.iem.at">pd-list@lists.iem.at</a>]><br clear="none">
<span class="yiv5676430106">Betreff: Re: [PD] oscillators (osc~ / cycle~) not working well in FM?<br clear="none">
<br clear="none">
By the way, I was wondering and thinking if this was a particularity of the "0Hz carrier FM", that is: a FM patch with no carrier frequency. But I tried other regular FM patches with a carrier signal and could see that it didn't keep static as well.<br clear="none">
 <br clear="none">
On the other hand, the same patch implemented as Phase Modulation (PM) maintains a static waveform in Pd.<br clear="none">
 <br clear="none">
In my last example, the patch I had as "waveshaping" could be thought of as a "0hz PM" patch.<br clear="none">
 <br clear="none">
Now, I tested the PM stability with the [phasor~] + [cos~] architecture and also with [cycle~]. <br clear="none">
 <br clear="none">
The FM instability happened with both [osc~] and [cycle~].<br clear="none">
 <br clear="none">
In Max, a FM patch with [cycle~] is stable.<br clear="none">
 <br clear="none">
In short, there's something fishy with FM in Pd...<br clear="none">
 <br clear="none">
cheers<br clear="none">
 <br clear="none">
</span><span class="yiv5676430106">2015-11-21 13:25 GMT-02:00 Alexandre Torres Porres <<a rel="nofollow" shape="rect" ymailto="mailto:porres@gmail.com" target="_blank" href="mailto:porres@gmail.com">porres@gmail.com</a>[<a rel="nofollow" shape="rect" ymailto="mailto:porres@gmail.com" target="_blank" href="mailto:porres@gmail.com">porres@gmail.com</a>]>:<br clear="none">
> Can you elaborate?<br clear="none">
 <br clear="none">
Not easily I'm afraid, so I'll try to keep it simple: it's a demonstration on the relationship between FM and waveshaping, compare now both patches in my new example. The waveshaping does not change through time.<br clear="none">
 <br clear="none">
But let me attempt to reason why it should keep static - it's like any other FM patch, once you have set the parameters, the waveform must be static and not change in time. My tests with supercollider and Max had a good result (waveform kept static). I also tried in Pd with cycle~ and in the newest vanilla.<br clear="none">
 <br clear="none">
cheers<br clear="none">
 <br clear="none">
<br clear="none">
</span><span class="yiv5676430106">2015-11-21 11:26 GMT-02:00 Roman Haefeli <<a rel="nofollow" shape="rect" ymailto="mailto:reduzent@gmail.com" target="_blank" href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>[<a rel="nofollow" shape="rect" ymailto="mailto:reduzent@gmail.com" target="_blank" href="mailto:reduzent@gmail.com">reduzent@gmail.com</a>]>:<br clear="none">
<br clear="none">
On Sat, 2015-11-21 at 02:59 -0200, Alexandre Torres Porres wrote:<br clear="none">
> howdy, attached there's a patch where I was experimenting with FM<br clear="none">
><br clear="none">
><br clear="none">
> the waveform shouldn't change with time, but it does. Give it a while<br clear="none">
> though, 30 seconds is enough to hear a change in tone quality, then<br clear="none">
> resseting the oscillator phase brings it back to where it was<br clear="none">
><br clear="none">
><br clear="none">
> don't know why it does come out of phase, an equivalent patch in SC<br clear="none">
> and Max does not get out of phase...<br clear="none">
<br clear="none">
I hear and see what you mean. Interesting question. Frankly, I don't<br clear="none">
quite understand why it is expected to stay in phase. Can you elaborate?<br clear="none">
<br clear="none">
Roman<br clear="none">
<br clear="none">
 _______________________________________________<br clear="none">
</span><a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a>[<a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a>] mailing listUNSUBSCRIBE and account-management -> <a rel="nofollow" shape="rect" target="_blank" href="http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]]">http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]]</a><br clear="none">
 _______________________________________________ <a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a>[<a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a>] mailing list UNSUBSCRIBE and account-management -> <a rel="nofollow" shape="rect" target="_blank" href="http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]]">http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list][http://lists.puredata.info/listinfo/pd-list[http://lists.puredata.info/listinfo/pd-list]]</a><br clear="none">_______________________________________________<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br clear="none">
UNSUBSCRIBE and account-management -> <a rel="nofollow" shape="rect" target="_blank" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div></div><br clear="none"><div class="yiv5676430106yqt8872662872" id="yiv5676430106yqtfd65296">_______________________________________________<br clear="none"><a rel="nofollow" shape="rect" ymailto="mailto:Pd-list@lists.iem.at" target="_blank" href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br clear="none">UNSUBSCRIBE and account-management -> <a rel="nofollow" shape="rect" target="_blank" href="http://lists.puredata.info/listinfo/pd-list">http://lists.puredata.info/listinfo/pd-list</a><br clear="none"></div><br clear="none"><br clear="none"></div></div>  </div> </div>  </div></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></body></html>