<div dir="ltr"><div dir="ltr"><div>Thanks, Joel and JT! I got my Additive object working as a Chubgraph, exactly like I wanted.</div><div><br></div><div>Interestingly, I thought I&#39;d have to connect my Additive object&#39;s signal chain before i called init(), but afterwards also seems to work just fine.</div><div><br></div><div>Revised code is at <a href="https://gist.github.com/forrcaho/21acdb25e05a8620f56dba591cd52ed5">https://gist.github.com/forrcaho/21acdb25e05a8620f56dba591cd52ed5</a> in case anyone is interested.<br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 10:08 PM JP YĆ©pez &lt;<a href="mailto:jpyepezimc@gmail.com">jpyepezimc@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 style="overflow-wrap: break-word;">Hey Forrest,<div><br></div><div>Haven&#39;t really had a chance to take a closer look at the code, but from your description, I think Chubgraphs might be able to help you out with this. If you haven&#39;t tried them out, Chubgraphs have a built-in outlet, and if you connect all AdditivePartials to it, you should be able to simply connect/disconnect the Additive instance, which takes care of all the partials. Here&#39;s a bit of useful info on them:</div><div><br></div><div><a href="http://chuck.stanford.edu/extend/#chubgraphs" target="_blank">http://chuck.stanford.edu/extend/#chubgraphs</a></div><div><br></div><div>Chubgraphs are a good way to create your own flexible classes that can be part of audio chains, so maybe this is something like what you have in mind?</div><div><br></div><div>Hope it helps!</div><div><br></div><div>JP</div><div><div><br><blockquote type="cite"><div>On 4/01/2019, at 4:44 PM, Forrest Cahoon &lt;<a href="mailto:forrest.cahoon@gmail.com" target="_blank">forrest.cahoon@gmail.com</a>&gt; wrote:</div><br class="gmail-m_3569820178028428588Apple-interchange-newline"><div><div dir="ltr"><div>Thanks! This was totally evading me.</div><div><br></div><div>So even though I haven&#39;t called b.play(), its AdditivePartials will make sound when time advances -- that&#39;s what I was missing.<br></div><div>Another option that works is to set the gain of each partial to 0 in init and at the end of play().</div><div><br></div><div>What I would really like is be able to write these classes in some way that I can connect the signal chain using the Additive object, like</div><div><br></div><div>Additive a =&gt; NRev r =&gt; dac;</div><div><br></div><div>which would somehow call a method on a to hook up the signal chain to all the partials behind the scenes. Is that at all possible?</div><div>Or failing that, some other way I can specify the signal chain for individual Additive objects outside the class (e.g. a connectSignal() method)?</div><div><br></div><div>Forrest<br></div><br><div><div><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 3, 2019 at 1:30 AM Joel Matthys &lt;<a href="mailto:jwmatthys@gmail.com" target="_blank">jwmatthys@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>Hey Forrest.</div><br><div>I messed around for a long time with your code before it finally struck me:</div><br><div>You connected your AdditivePartials to the dac too soon!</div><br><div>In your code you connect <font style="font-family:monospace">this=&gt;dac</font> when the AdditivePartials are instantiated, but you don&#39;t set gain and freq until you <font style="font-family:monospace">spork~ play</font>.</div><br><div>So when you pass the first <font style="font-family:monospace">0.5:</font><font style="font-family:monospace"><span>:second</span></font><font style="font-family:monospace"> =&gt; now</font>, Additive b is sounding at full gain on default settings.</div><br><div>If you move <font style="font-family:monospace">this =&gt; dac</font> from the init function to the top of the play function, all is well. You should probably add <font style="font-family:monospace">this =&lt; dac</font> at the end of your play function too.</div><br><div>Joel</div><br><div><u></u><div><div>Sent from <a href="https://link.getmailspring.com/link/1546499923.local-a2481a69-52f7-v1.5.4-1d923cf4@getmailspring.com/0?redirect=https%3A%2F%2Fgetmailspring.com%2F&amp;recipient=Y2h1Y2stdXNlcnNAbGlzdHMuY3MucHJpbmNldG9uLmVkdQ%3D%3D" target="_blank">Mailspring</a>, the best free email app for work</div></div><u></u></div><div class="gmail-m_3569820178028428588gmail-m_357623576467901216gmail_quote_attribution">On Jan 2 2019, at 10:02 pm, Forrest Cahoon &lt;<a href="mailto:forrest.cahoon@gmail.com" target="_blank">forrest.cahoon@gmail.com</a>&gt; wrote:</div><blockquote><div><div><div><div>Sorry, I tried to come up with a more hello-world example of the problem I&#39;m experiencing, but I really don&#39;t know what&#39;s going on so I have to post something a bit complex.</div><div><br></div><div><div>My ChucK code is here:</div></div><div><a href="https://link.getmailspring.com/link/1546499923.local-a2481a69-52f7-v1.5.4-1d923cf4@getmailspring.com/1?redirect=https%3A%2F%2Fgist.github.com%2Fforrcaho%2F21acdb25e05a8620f56dba591cd52ed5&amp;recipient=Y2h1Y2stdXNlcnNAbGlzdHMuY3MucHJpbmNldG9uLmVkdQ%3D%3D" title="https://gist.github.com/forrcaho/21acdb25e05a8620f56dba591cd52ed5" target="_blank">https://gist.github.com/forrcaho/21acdb25e05a8620f56dba591cd52ed5</a></div><div><br></div><div>I have a class called AdditivePartial and one called Additive which contains an array of AdditivePartial objects.</div><div><br></div><div>The Additive objects play method sporks the play method for all its partials.</div><div><br></div><div>The first Additive object I create appears to ignore the noteAmplitude I have set; it is pegged and clipping. That is, until the second Additive object is sporked, at which point the first object suddenly &quot;remembers&quot; it&#39;s noteAmplitude.</div><div><br></div><div>I&#39;ve looked at the output in Sonic Visualiser and that confirmed this is what&#39;s happening, at least on my linux machine.</div><div><br></div><div>Can anyone reproduce this behavior, or does it work for you? If you can reproduce it, what the heck is going on?</div><div><br></div><div>Forrest</div><div><br></div><div><br></div><div><br></div></div></div><div>_______________________________________________</div><div>chuck-users mailing list</div><div><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">chuck-users@lists.cs.princeton.edu</a></div><div><a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a></div></div></blockquote><img class="gmail-m_3569820178028428588gmail-m_357623576467901216mailspring-open" alt="Sent from Mailspring" style="border: 0px none; width: 0px; height: 0px;" src="https://link.getmailspring.com/open/1546499923.local-a2481a69-52f7-v1.5.4-1d923cf4@getmailspring.com?recipient=Y2h1Y2stdXNlcnNAbGlzdHMuY3MucHJpbmNldG9uLmVkdQ%3D%3D" width="0" height="0">_______________________________________________<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></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" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br></div></blockquote></div><br></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>