<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 => blackhole;<br>
440 => e.value;<br>
SinOsc s => dac;<br>
0.1 => s.gain;<br>
100::ms => e.duration;<br>
<br>
spork ~gliss (100::samp);<br>
while (1)<br>
{<br>
Math.random2(220,880) => e.target;<br>
second => now;<br>
}<br>
<br>
fun void gliss(dur updateRate)<br>
{<br>
while (1)<br>
{<br>
e.value() => s.freq;<br>
updateRate => 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 => dac;<br>
Envelope env => blackhole; <br>
500.0 => sin.freq => float x; //starting frequency<br>
100::ms => dur rampTime; //ramp time period<br>
0 => env.value; //starting value<br>
rampTime => env.duration;<br>
400.0 => env.target; //ramp to target - in this case, 900 Hz<br>
now + rampTime => time t;<br>
while( now < t )<br>
{<br>
// modulate frequency by envelope<br>
x+env.value() => sin.freq;<br>
// advance time by 100 samples<br>
100::samp => now;<br>
}<br>
<br>
I think there may be an easier way of doing this using:<br>
<br>
Envelope env => SinOsc sin => 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>