<div dir="ltr"><div>You are adding a new connection from your SndBuf to the dac on every iteration of the for loop. Either only do this once, near the top of the file where you set the gain, or also break the connection within the body of the for loop (i.e. buf =&lt; dac; once you are done with it).</div><div><br></div><div>~Jack<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 4, 2020 at 9:07 PM Brian Robison &lt;<a href="mailto:brobison@gmail.com">brobison@gmail.com</a>&gt; wrote:<br></div><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">Hi, ChucK users!  I&#39;m having a problem that seems like it should have a simple solution, but I can&#39;t figure it out.<br><br>Here&#39;s a program which plays a WAV (which is about 1.5 seconds long) every two seconds, several times:<br><br>SndBuf buf;<br>&quot;d3-fa.wav&quot; =&gt; buf.read;<br>0.2 =&gt; buf.gain;<br><br>2000 =&gt; int notelen;<br><br>for (0 =&gt; int i; i &lt; 20; i++) {<br>    0 =&gt; buf.pos;<br>    buf =&gt; dac;<br>    notelen::ms =&gt; now;<br>}<br><br>Each time (using ChucK 1.4), it gets louder, and I can&#39;t figure out why.  What am I getting wrong?<br><br>Thanks!<br><div>Brian</div><div><br></div><div>PS. you can find my d3-fa.wav here:</div><div><br></div><div><a href="https://drive.google.com/file/d/1B0ZNnGNcF5BKGzmYpdMYdZOO5SbC_4FQ/view" target="_blank">https://drive.google.com/file/d/1B0ZNnGNcF5BKGzmYpdMYdZOO5SbC_4FQ/view</a></div></div>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div>