<p dir="ltr">Hi Alexandre,</p>
<p dir="ltr">If you look at the complete formula here (under "spectral analysis" - for sure it is better then my explanation):<br>
<a href="https://en.wikipedia.org/wiki/Frequency_modulation_synthesis?wprov=sfla1">https://en.wikipedia.org/wiki/Frequency_modulation_synthesis?wprov=sfla1</a></p>
<p dir="ltr">You can see that alongside the Carrier Frequency there's the phase. This one is a sine wave (that goes from -1 to 1). Now we can consider SinOsc on ChucK, the same that the first sin in the formula above. Everything is feeding SinOsc in ChucK can be considered the same that all the stuff into parenthesis. Thus the argument you pass to SinOsc ( oscil.freq(certainFreq) ) is the Carrier Frequency (a fixed argument) and the the signal coming out from the Fm oscillator (scaled with a given value Am/Fm or ModInd, it is the same) is modulation factor that makes the Carrier Freq oscillate.<br>
Now 2pi is needed only if you deal with a ramp, with a phasor. Cause Phasor*2pi gives you a sine. If you already have a sine there is no need to use 2pi.</p>
<p dir="ltr">Cheers,<br>
Mario</p>
<p dir="ltr">Sent from my Wiko ROBBY</p>
<div class="quote">On Jun 4, 2017 17:20, Alexandre Torres Porres &lt;porres@gmail.com&gt; wrote:<br type='attribution'><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">2pi is already there if you are using a phase input, cause it seems the phase is normalized (0 to 1 instead of 0 - 2pi) in Chuck.</span><div><span style="font-size:12.8px"><br /></span></div><div><span style="font-size:12.8px">What I mean is how to implement the same result with both frequency and phase modulation in a Chuck code, using SinOsc.</span></div><div><span style="font-size:12.8px"><br /></span></div><div><span style="font-size:12.8px">All these things have to be adjusted</span></div><div><span style="font-size:12.8px"><br /></span></div><div><span style="font-size:12.8px">But if the phase input wasn&#39;t normalized to 0-1, like is the case with SuperCollider, you don&#39;t need it.</span></div><div><span style="font-size:12.8px"><br /></span></div><div><span style="font-size:12.8px">cheers</span></div></div><div><br /><div class="elided-text">2017-06-04 13:09 GMT-03:00 mario.buoninfante <span dir="ltr">&lt;<a href="mailto:mario.buoninfante&#64;gmail.com">mario.buoninfante&#64;gmail.com</a>&gt;</span>:<br /><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi Alexandre,</p>
<p dir="ltr">In my implementation there&#39;s​ no need to use 2pi. That is required if you&#39;re using a phasor (in math terms). In that case you need 2pi to have the angular frequency. But if you&#39;re using instead a Sine wave there&#39;s no need, cause 2pi is already there. <br />
Looking at the formula I posted before, the Fm oscillator is the phase parameter, while the Cm is the frequency. You can consider them as an offset (Cm) and an deviation from it (Fm).<br />
The index mod is equal to Am/Fm, but of course the parameter that you can use with an oscillator is the amplitude (Am), thus from the previous one you have Am &#61; Fm*modInd</p>
<p dir="ltr">Cheers,<br />
Mario</p>
<p dir="ltr">Sent from my Wiko ROBBY</p><div><div>
<div>On Jun 4, 2017 16:39, Alexandre Torres Porres &lt;<a href="mailto:porres&#64;gmail.com">porres&#64;gmail.com</a>&gt; wrote:<br /><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">btw, for adjusting the index, you&#39;re just multiplying the frequency to the index, you should also multiply it by 2pi (like Jean found out by accident).<div><br /></div></div><div><br /><div>2017-06-04 12:29 GMT-03:00 Alexandre Torres Porres <span dir="ltr">&lt;<a href="mailto:porres&#64;gmail.com">porres&#64;gmail.com</a>&gt;</span>:<br /><blockquote style="margin:0 0 0 0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br /><div><br /><div>2017-06-04 4:24 GMT-03:00 mario buoninfante <span dir="ltr">&lt;<a href="mailto:mario.buoninfante&#64;gmail.com">mario.buoninfante&#64;gmail.com</a>&gt;</span>:<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb( 204 , 204 , 204 );padding-left:1ex"><div>
    <p>this is the simplest modulation, that usually is considered as
      FM, but in the end is a PM.</p></div></blockquote><div>Well, as I see it, it should be either FM or PM, it can&#39;t be one but in the end is something else. And your code is can only (not usually) be considered FM.</div><div><br /></div><div>But it seems you&#39;re saying both are related, without getting into details - which is something we&#39;ve already discussed here, and I&#39;ve also pointed out (with no details either). But the bottom line is that they&#39;re different, and the same input parameters generate different results. Though I&#39;ve said before <span style="font-size:12.8px">the parameters can be &#34;converted&#34;/&#34;adjusted&#34; to sound the same.</span></div><div><br /></div><div>Namely, the same modulation index does not generate the same result (Jean noticed that), and I can add the detail that the same modulating signal/waveform generate different results too. For example, a triangular wave modulating the phase is the same as a square wave modulating the frequency. So, they&#39;re quite different. </div><div><br /></div><div>In terms of sine waves, what we&#39;ve been doing so far, if you modulate the phase with a sine wave, you need to modulate the frequency with a cosine wave.</div><div><br /></div><div>Like I pointed before, if you&#39;re going for a phase modulation implementation, you should just modulate the phase <span style="font-size:12.8px">instead of trying to replicate it via frequency modulation, cause it&#39;s just more convenient to do directly via phase modulation if you want it to behave like that.</span></div><div><br /></div><div>And that not</div></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div>