<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Mitch. Yeah, I couldn't get sync to work for frequency either. I
    guess we should file that as a bug.<br>
    <br>
    The only refinements I would make is to put the code to update the
    envelope in a separate thread and spork it.<br>
    <br>
    Envelope e =&gt; blackhole;<br>
    440 =&gt; e.value;<br>
    SinOsc s =&gt; dac;<br>
    0.1 =&gt; s.gain;<br>
    100::ms =&gt; e.duration;<br>
    <br>
    spork ~gliss (100::samp);<br>
    while (1)<br>
    {<br>
      Math.random2(220,880) =&gt; e.target;<br>
      second =&gt; now;<br>
    }<br>
    <br>
    fun void gliss(dur updateRate)<br>
    {<br>
      while (1)<br>
      {<br>
        e.value() =&gt; s.freq;<br>
        updateRate =&gt; now;<br>
      }<br>
    }<br>
    <br>
    //------------------------------------------------------------<br>
    <br>
    <div class="moz-cite-prefix">On 09/03/2015 07:13 PM, Mitch Kaufman
      wrote:<br>
    </div>
    <blockquote cite="mid:BAY179-W1949DDD37BAE0459BB767FE1570@phx.gbl"
      type="cite">
      <style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style>
      <div dir="ltr">Hi list,<br>
        <br>
        I am a relatively new user and am enjoying exploring different
        areas of ChucK.  I was trying to develop a program to create
        glissons or short particles with a moving frequency range.  I
        came up with an approach but I think there may be an easier
        way.  Here is the program:<br>
        <br>
        SinOsc sin =&gt; dac;<br>
        Envelope env =&gt; blackhole; <br>
        500.0 =&gt; sin.freq =&gt; float x;  //starting frequency<br>
        100::ms =&gt; dur rampTime;  //ramp time period<br>
        0 =&gt; env.value;  //starting value<br>
        rampTime =&gt; env.duration;<br>
        400.0 =&gt; env.target;  //ramp to target - in this case, 900 Hz<br>
        now + rampTime =&gt; time t;<br>
        while( now &lt; t )<br>
        {<br>
            // modulate frequency by envelope<br>
            x+env.value() =&gt; sin.freq;<br>
            // advance time by 100 samples<br>
            100::samp =&gt; now;<br>
        }<br>
        <br>
        I think there may be an easier way of doing this using:<br>
        <br>
        Envelope env =&gt; SinOsc sin =&gt; dac;<br>
        <br>
        But I can't seem to get it working using a proper sin.sync
        value.  Does anyone have any ideas on improving the approach?<br>
        <br>
        Regards,<br>
        Mitch<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
chuck-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a>
<a class="moz-txt-link-freetext" href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>