<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Note there are also a few different sample-hold chubgraphs in LiCK<div class=""><br class=""></div><div class=""><a href="https://github.com/heuermh/lick/tree/master/lick/lfo" class="">https://github.com/heuermh/lick/tree/master/lick/lfo</a></div><div class=""><br class=""></div><div class="">Cheers!</div><div class=""><br class=""></div><div class="">&nbsp; &nbsp;michael</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 20, 2020, at 2:10 PM, Forrest Curo &lt;<a href="mailto:treegestalt@gmail.com" class="">treegestalt@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Yes, I'm interested!</div><div class="">Whatever turns out easier, one could apply it to note lengths, amplitudes, other parameters&nbsp; in same way for same reasons: a bit of patterned randomness.<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 11:32 AM Mario Buoninfante &lt;<a href="mailto:mario.buoninfante@gmail.com" class="">mario.buoninfante@gmail.com</a>&gt; wrote:<br class=""></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" class=""><div class="">Hi,</div><div class=""><br class=""></div><div class="">In case you're interested I made a SampHold chugin that you can find here: <a href="https://github.com/mariobuoninfante/ChucK_chugins" target="_blank" class="">https://github.com/mariobuoninfante/ChucK_chugins</a><br class=""><br class=""></div><div class="">Cheers,</div><div class="">Mario<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 20 Apr 2020 at 18:05, Forrest Curo &lt;<a href="mailto:treegestalt@gmail.com" target="_blank" class="">treegestalt@gmail.com</a>&gt; wrote:<br class=""></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" class="">"A sample and hold uses a periodic wave as an input. The wave is sampled at regular<br class="">intervals. The resulting values are used as a control. It "samples" the wave and "holds" that<br class="">value until a new value is sampled. It can be thought of as an analog to digital converter with<br class="">a low frequency sampling rate (though technically the wave being sampled is also digital).<br class="">The effect is similar to a strobe light or motion picture film taking snapshots of a smooth<br class="">process. That smooth process is then quantized into discrete steps.<br class=""><div class=""><br class=""></div><div class="">"How is this useful in synthesis? Why would you want to freeze-frame a wave form?</div>The idea is that even though the sample rate is too low to accurately represent the true shape<br class="">of the wave, patterns will still emerge because the wave is periodic, and the sample rate is<br class=""><div class="">periodic."</div><div class=""><br class=""></div><div class="">[David Cottle, _Computer Music with Examples in Supercollider 3]</div><div class=""><br class=""></div><div class="">(This can be done in ChucK; the sndBuf containing the wave can be sampled via .valueAt without directly playing it.)<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 19, 2020 at 9:50 PM Forrest Curo &lt;<a href="mailto:treegestalt@gmail.com" target="_blank" class="">treegestalt@gmail.com</a>&gt; wrote:<br class=""></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" class=""><div class="">I've achieved&nbsp; dreadfulness with this. Okay, will vary the rhythm etc and reduce the range, get a more interesting scale, but... hmm!</div><div class="">SawOsc s =&gt; JCRev r =&gt; dac;<br class="">.1 =&gt; s.gain;<br class="">.1 =&gt; r.mix;<br class="">1 =&gt; int incsamp;<br class="">0 =&gt; int ps;<br class="">1 =&gt; float height;<br class="">0 =&gt; float maxsofar;<br class="">0 =&gt; float freq;<br class="">SndBuf buf;<br class=""><br class="">"/home/forrest/chuck/examples/basic/om.wav" =&gt; buf.read;<br class=""><br class="">buf.samples() &nbsp;=&gt; int numSamples;<br class="">&nbsp;Std.rand2(1, numSamples-1) =&gt; incsamp;<br class="">while(true){<br class="">        (incsamp + ps) % numSamples =&gt; ps;<br class="">        buf.valueAt(ps) + 0.125 =&gt; height;<br class="">        Std.mtof(Math.ceil(Std.fabs(500.0 * height)) ) =&gt; freq =&gt; s.freq;<br class="">        <br class="">        if(freq &gt; maxsofar) {<br class="">                 freq =&gt; maxsofar;<br class="">                &lt;&lt;&lt; maxsofar &gt;&gt;&gt;;<br class="">                }<br class="">0.75::second =&gt; now;<br class="">}<br class=""><br class=""><br class=""><br class=""><br class=""><br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 19, 2020 at 1:42 PM Forrest Curo &lt;<a href="mailto:treegestalt@gmail.com" target="_blank" class="">treegestalt@gmail.com</a>&gt; wrote:<br class=""></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" class=""><div class="">Um. that works.</div><div class="">So does this:</div><div class="">SndBuf s =&gt; blackhole; <br class="">"/home/forrest/chuck/examples/basic/om.wav" =&gt; s.read;<br class="">float samples;<br class="">0 =&gt; int i;<br class="">while (s.pos() &lt; s.samples()) &nbsp;{<br class="">&nbsp; &nbsp; &lt;&lt;&lt; s.last() &gt;&gt;&gt;;<br class="">&nbsp; &nbsp; s.pos() =&gt; i;<br class="">&nbsp; &nbsp; (s.valueAt(i)) =&gt; samples;<br class="">&nbsp; &nbsp; &lt;&lt;&lt; samples &gt;&gt;&gt;;<br class="">&nbsp; &nbsp; samp =&gt; now;</div><div class="">}</div><div class=""><br class=""></div><div class="">I was having trouble trying to read a sndBuf like an array, or put its contents into an array.</div><div class="">Maybe I was reading numbers off the end of the file. Declaring <br class=""></div><div class="">'float samples[]; '</div><div class="">and doing</div><div class="">'s.valueAt(i) =&gt; samples[i];'</div><div class=""><br class=""></div><div class="">got me a 'Null pointer' error. <br class=""></div><div class=""><br class=""></div><div class="">Stumbling over syntax, I guess. Thanks for help!<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 19, 2020 at 10:54 AM Perry Cook &lt;<a href="mailto:prc@cs.princeton.edu" target="_blank" class="">prc@cs.princeton.edu</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is truly odd.&nbsp; I don’t have easy means to test it.&nbsp; &nbsp;I don’t <br class="">
know why it wouldbe broken dependent on the dac, however.<br class="">
<br class="">
For fun you might try something like this, just to verify that the<br class="">
valueAt() function is what’s busted.<br class="">
<br class="">
SndBuf s =&gt; blackhole;&nbsp; <br class="">
“Fred.wav” =&gt; s.read;<br class="">
<br class="">
while (s.pos() &lt; s.samples())&nbsp; {<br class="">
&nbsp; &nbsp; &lt;&lt;&lt; s.last() &gt;&gt;&gt;;<br class="">
&nbsp; &nbsp; samp =&gt; now;<br class="">
}<br class="">
<br class="">
PRC<br class="">
<br class="">
&gt; On Apr 19, 2020, at 9:00 AM, <a href="mailto:chuck-users-request@lists.cs.princeton.edu" target="_blank" class="">chuck-users-request@lists.cs.princeton.edu</a> wrote:<br class="">
&gt; <br class="">
&gt; Send chuck-users mailing list submissions to<br class="">
&gt;&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
&gt; <br class="">
&gt; To subscribe or unsubscribe via the World Wide Web, visit<br class="">
&gt;&nbsp; &nbsp; &nbsp; &nbsp;<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
&gt; or, via email, send a message with subject or body 'help' to<br class="">
&gt;&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:chuck-users-request@lists.cs.princeton.edu" target="_blank" class="">chuck-users-request@lists.cs.princeton.edu</a><br class="">
&gt; <br class="">
&gt; You can reach the person managing the list at<br class="">
&gt;&nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:chuck-users-owner@lists.cs.princeton.edu" target="_blank" class="">chuck-users-owner@lists.cs.princeton.edu</a><br class="">
&gt; <br class="">
&gt; When replying, please edit your Subject line so it is more specific<br class="">
&gt; than "Re: Contents of chuck-users digest..."<br class="">
&gt; <br class="">
&gt; <br class="">
&gt; Today's Topics:<br class="">
&gt; <br class="">
&gt;&nbsp; &nbsp;1. sndBuf.valueAt (Forrest Curo)<br class="">
&gt; <br class="">
&gt; <br class="">
&gt; ----------------------------------------------------------------------<br class="">
&gt; <br class="">
&gt; Message: 1<br class="">
&gt; Date: Sun, 19 Apr 2020 07:30:15 -0700<br class="">
&gt; From: Forrest Curo &lt;<a href="mailto:treegestalt@gmail.com" target="_blank" class="">treegestalt@gmail.com</a>&gt;<br class="">
&gt; To: ChucK Users Mailing List &lt;<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a>&gt;<br class="">
&gt; Subject: [chuck-users] sndBuf.valueAt<br class="">
&gt; Message-ID:<br class="">
&gt;&nbsp; &nbsp; &nbsp; &nbsp;&lt;CAAn-Ecy0LKVHCWmoUL2Y7w67rsibhRAHOOkN1neZyU=az3vm=<a href="mailto:g@mail.gmail.com" target="_blank" class="">g@mail.gmail.com</a>&gt;<br class="">
&gt; Content-Type: text/plain; charset="utf-8"<br class="">
&gt; <br class="">
&gt; Using chuck linux-jack this gives me reasonable numbers between -1 and 1.<br class="">
&gt; Using chuck linux-alsa I'm able to play the file I've read into sndBuf; but<br class="">
&gt; trying to copy it via .valueAt gives absurdly high ["out of range"] numbers<br class="">
&gt; at each point. [It can be a different high number different times I run<br class="">
&gt; chuck, but the number it is turns up at every point I sample.]<br class="">
&gt; <br class="">
&gt; Is there a fix for this? Aside from using jack on a computer where it<br class="">
&gt; befnurgles the midi?<br class="">
&gt; -------------- next part --------------<br class="">
&gt; An HTML attachment was scrubbed...<br class="">
&gt; URL: &lt;<a href="http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200419/76d94eef/attachment-0001.html" rel="noreferrer" target="_blank" class="">http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20200419/76d94eef/attachment-0001.html</a>&gt;<br class="">
&gt; <br class="">
&gt; ------------------------------<br class="">
&gt; <br class="">
&gt; _______________________________________________<br class="">
&gt; chuck-users mailing list<br class="">
&gt; <a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
&gt; <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
&gt; <br class="">
&gt; <br class="">
&gt; End of chuck-users Digest, Vol 176, Issue 4<br class="">
&gt; *******************************************<br class="">
<br class="">
_______________________________________________<br class="">
chuck-users mailing list<br class="">
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
</blockquote></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br class="">
chuck-users mailing list<br class="">
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
</blockquote></div>
_______________________________________________<br class="">
chuck-users mailing list<br class="">
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank" class="">chuck-users@lists.cs.princeton.edu</a><br class="">
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" rel="noreferrer" target="_blank" class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br class="">
</blockquote></div>
_______________________________________________<br class="">chuck-users mailing list<br class=""><a href="mailto:chuck-users@lists.cs.princeton.edu" class="">chuck-users@lists.cs.princeton.edu</a><br class="">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users<br class=""></div></blockquote></div><br class=""></div></body></html>