<div dir="ltr">2017-06-03 15:01 GMT-03:00 Jean Menezes da Rocha <span dir="ltr">&lt;<a href="mailto:jean@menezesdarocha.info" target="_blank">jean@menezesdarocha.info</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Unfortunately, my knowledge of SuperCollider is very limited and I don&#39;t feel like I&#39;m able to translate your code.</div></blockquote><div><br></div>Here&#39;s an attempt to make SC code clearer.<div><br></div><div>Here&#39;s the fm example I found in chuck, using sync = 2</div><div><br></div><div>







<p class="gmail-p1">////////////////////////////////////////////////////</p>
<p class="gmail-p1">SinOsc<span class="gmail-s1"> m =&gt; </span>SinOsc<span class="gmail-s1"> c =&gt; </span><span class="gmail-s2">dac</span><span class="gmail-s1">; </span>// modulator to carrier</p>
<p class="gmail-p1"><span class="gmail-s3">400</span><span class="gmail-s1"> </span>=&gt;<span class="gmail-s1"> </span>c.freq; // carrier frequency</p>
<p class="gmail-p4"><span class="gmail-s3">201</span><span class="gmail-s1"> </span>=&gt;<span class="gmail-s1"> </span>m.freq; // modulator frequency</p>
<p class="gmail-p1"><span class="gmail-s3">1500</span><span class="gmail-s1"> </span>=&gt;<span class="gmail-s1"> </span>m.gain; // modulation index</p>
<p class="gmail-p4"><span class="gmail-s3">2</span><span class="gmail-s1"> </span>=&gt;<span class="gmail-s1"> </span>c.sync; // FM synthesis (sync is 2)</p>
<p class="gmail-p5">while<span class="gmail-s1">( </span>true<span class="gmail-s1"> ) </span><span class="gmail-s3">1</span><span class="gmail-s1">::</span>second<span class="gmail-s1"> =&gt; </span>now<span class="gmail-s1">; </span>// time-loop</p><p class="gmail-p5"><span class="gmail-s1">////////////////////////////////////////////////////<br></span></p><p class="gmail-p5"><span class="gmail-s1"><br></span></p><p class="gmail-p5"><span class="gmail-s1">And now for the SC equivalent</span></p><p class="gmail-p5"><span class="gmail-s1"><br></span></p><p class="gmail-p5"><span class="gmail-s1">////////////////////////////////////////////////////<br></span></p><p class="gmail-p5">{var carrier = 400; // carrier frequency</p><p class="gmail-p5">var modulator = 201; // modulator frequency</p><p class="gmail-p5">var index = 1500; // modulation index</p><p class="gmail-p5">var m = SinOsc.ar(modulator) * index; // modulating signal</p><p class="gmail-p5">var c = SinOsc.ar(carrier + m); // frequency modulation (carrier + modulating signal)</p><p class="gmail-p5"><span class="gmail-s1"></span></p><p class="gmail-p5">Out.ar (0, c ! 2)}.play</p><p class="gmail-p5">////////////////////////////////////////////////////<br></p><p class="gmail-p5"><br></p><p class="gmail-p5">and now a phase modulation example in SC</p><p class="gmail-p5"><br></p><p class="gmail-p5"><span class="gmail-s1">////////////////////////////////////////////////////<br></span></p><p class="gmail-p5">{var carrier = 400; // carrier frequency</p><p class="gmail-p5">var modulator = 201; // modulator frequency</p><p class="gmail-p5">var index = 2pi; // modulation index</p><p class="gmail-p5">var m = SinOsc.ar(modulator) * index; // modulating signal</p><p class="gmail-p5">var c = SinOsc.ar(carrier, m); // frequency modulation (carrier + modulating signal)</p><p class="gmail-p5"><span class="gmail-s1"></span></p><p class="gmail-p5">Out.ar (0, c ! 2)}.play</p><p class="gmail-p5">////////////////////////////////////////////////////</p><p class="gmail-p5"><br></p><p class="gmail-p5">note, the SinOsc in SuperCollider takes frequency input as the first variable in parenthesis, and phase (in radians) in the second.</p><p class="gmail-p5"><br></p><p class="gmail-p5">cheers</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-03 15:31 GMT-03:00 Alexandre Torres Porres <span dir="ltr">&lt;<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">2017-06-03 15:01 GMT-03:00 Jean Menezes da Rocha <span dir="ltr">&lt;<a href="mailto:jean@menezesdarocha.info" target="_blank">jean@menezesdarocha.info</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Alexandre,<div><br></div><div>As far as I understand it, the .sync attribute is more like an identifier, rather than a true numeric value (that is, 0 says you are syncing frequency with frequency; 1 says that you are syncing phase with frequency; 2 says you are doing true Frequency Modulation). As you are telling that no value means no sound, one can infer that there is no default value for that, and if you are feeding UGen =&gt; UGen, telling which is your sync method is mandatory (but I can be mistaken, as usual).</div></div></blockquote><div> </div></span><div>there may be a default parameter, right? And that seems to be 0. If I have sync at &quot;0&quot;, I hear no sound.</div><div><br></div><div>Anyway, it doesn&#39;t seem like the sync parameter is able to do hard sync. It seemed that the &quot;0&quot; value would do that, but, as I said, I hear nothing.</div><div><br></div><div>If phase input is linear in chuck, then the code from SuperCollider would be equivalent, but it is not. And even if it wasn&#39;t linear, I tried it with radian values and did not get the same results.</div><div><br></div><div>I suspect it is not really doing phase modulation because it doesn&#39;t matter if I change the carrier frequency, and that is weird.</div><div><br></div><div>well, I guess I&#39;m repeating myself, sorry, just anxious in the hope of clarification.</div><div><br></div><div>thanks</div></div></div></div>
</blockquote></div><br></div>