<div dir="ltr">Alexandre,<div><br></div><div>I have translated a PD patch (see the last graph on <a href="http://pd-tutorial.com/english/ch03s06.html">this page</a>) and it is modulating AND responding to frequency changes. See if this does the trick for you (doesn't sound exactly like your SC code, but I think some fiddling with modulation index can be useful):</div><div><br></div><div><font face="monospace">Step imp; // now I am using an impulse to generate sound after calculating stuff from phasor/sinosc</font></div><div><font face="monospace">Phasor carrier; // Miller said to do so ;)</font></div><div><font face="monospace">SinOsc modul; // a phasor as carrier, a sinosc as modulator</font></div><div><font face="monospace">Gain g; // this object serves only to sum the signals</font></div><div><font face="monospace">1 => g.op; // op number 1 is sum.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">400 => carrier.freq;</font></div><div><font face="monospace">201 => modul.freq;</font></div><div><font face="monospace">1 => float ind => modul.gain; // so, modul. signal * index + carrier signal.</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">imp => dac; // impulse is actually generating sound</font></div><div><font face="monospace">carrier => g => blackhole; // both generators go through a Gain object an then to the blackhole</font></div><div><font face="monospace">modul => g; // so that they only lend data to the Impulse generator</font></div><div><font face="monospace"><br></font></div><div><font face="monospace">while ( true ) { // this loop includes a timed function only to show that this stuff responds to changes into carrier's frequency</font></div><div><font face="monospace"> now + 1::second => time later;</font></div><div><font face="monospace"> while (now < later) {</font></div><div><font face="monospace"> Math.cos(g.last()) => imp.next; // i am running this through a Cosine function since Phasor is a ramp (let's smooth that)</font></div><div><font face="monospace"> 1::samp => now;</font></div><div><font face="monospace"> }</font></div><div><font face="monospace"> if ( maybe ) 20 + carrier.freq() => carrier.freq;</font></div><div><font face="monospace"> else -30 + carrier.freq() => carrier.freq;</font></div><div><font face="monospace">}</font></div><div><br></div><div>Please notice that Miller Puckette's approach includes using the phasor as *carrier* and sinosc as *modulator*, so that we can separate phase treatment and wave generation (phasor + cos). I am using an Impulse generator in order to be allowed to pass the resulting signal through the cosine function before sending it to DAC.</div><div><br></div><div>Keep trying...</div></div><br><div class="gmail_quote"><div dir="ltr">Em dom, 4 de jun de 2017 às 03:34, Alexandre Torres Porres <<a href="mailto:porres@gmail.com">porres@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-06-04 2:35 GMT-03:00 Alexandre Torres Porres <span dir="ltr"><<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>></span>:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div><br></div></span><div>It's not easy to explain, but you found the magic number/formula that makes Frequency modulation sound like Phase Modulation. </div></div></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Actually, I shouldn't have said this, I don't wanna give you the idea it comes down to this, but there are just too many details I didn't want get into, sorry. What I can say is that you got pretty close, not 100% there yet, and that is not as simple as just doing this every time, it gets more complicated.</div><div><br></div><div>Sorry again for not getting into the math and everything. What I'd like to add is that people use phase modulation instead of trying to replicate it via frequency modulation cause it's just more convenient to do directly via phase modulation if you want it to behave like that.</div><div><br></div><div>cheers</div><div><br></div><div><br></div></div></div></div>
</blockquote></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr">Jean Menezes da Rocha<div>Compositor</div><div>Professor</div><div>Doutorando em Música pela Universidade Federal da Bahia</div></div></div>