Hey Robin,<div><br></div><div>I haven't had a chance to thoroughly review your patch, but to answer your questions --</div><div><br></div><div>tickf provides an input and output buffer within which nframes frames are allocated for, each consisting of a sample for each channel. I forget if different numbers of input/output channels are handled correctly, so if weird things are happening that could be an issue. But basically buffer[i*nc+c] will hold the sample for channel c of the i-th frame, assuming there are nc total channels. </div>
<div><br></div><div>You should be able to derive from UGen, change the number of channels, and use either a tick or tickf function (but never both) -- see WvOut2 or SndBuf2 for an example. </div><div><br></div><div>nframes can be > 1 if you have --adaptive# set (experimental adaptive sample block buffering). </div>
<div><br></div><div>Changing the number of I/O channels in a ugen at run-time definitely seems the most natural mode of operation, but poses some problems in terms of the details of that operation. For example, what happens to existing connections the ChucK programmer has made between individual ugen channels. I don't mean to open up a discussion about such issues, but rather to give an idea of what challenges are involved in the "ideal" approach. Truthfully there seem to be enough pitfalls with changing the number of IO channels at run time that Im not sure the benefits justify the few use cases Im aware of. </div>
<div><br></div><div>spencer</div><div><br><br><div class="gmail_quote">On Sun, Sep 9, 2012 at 2:53 PM, Robin Haberkorn <span dir="ltr"><<a href="mailto:robin.haberkorn@googlemail.com" target="_blank">robin.haberkorn@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not yet a ChucK expert. Did I do the multi-channel UGen stuff<br>
correctly (tickf)?<br>
Exactly how does tickf work? When do I get nframes > 1?<br>
Also, is it really necessary to have a tick-function when building the<br>
UGen as mono? I found that setting the UGen up as UGen_Stereo/Multi but<br>
specifying only one output channel does not work. Neither can I derive<br>
the class from "UGen" but specify only a tickf-function - for some<br>
reason I need the "tick" function. When deriving from UGen_Stereo, I<br>
must specify a tickf-function for multichannel output to work, but I may<br>
also specify a tick-function. Is it ignored?<br>
<br>
It would seem plausible to be able to derive from UGen_Multi but specify<br>
only one output channel (it's just a special case). Also it would seem<br>
useful and clean to be able to change the number of in/out channels at<br>
runtime, e.g. so a SndBuf always has as many output channels as the<br>
loaded soundfile. Instead you have introduced new classes (e.g. SndBuf2<br>
which is derived from SndBuf but has 2 output channels).<br>
<br>
What do you think?<br>
<div class="HOEnZb"><div class="h5"><br>
On 08/09/12 23:50, Robin Haberkorn wrote:<br>
> Hi!<br>
><br>
> As promised I took a look at LiSa and fixed many bugs. See the git<br>
> commit description in the patch for details. It applies to v1.3.1.0.<br>
><br>
> I couldn't really improve its performance significantly but you may now<br>
> again compile LiSa as a mono UGen (#define LiSa_channels 1) which does<br>
> the trick for me. Haven't yet even used a profiler or memory checker on<br>
> ChucK (but I will sooner or later).<br>
><br>
> Tested LiSa only superficially but some things like tracking mode 1 and<br>
> 2 are completely broken beginning with v1.3.0.0! Will test them soon and<br>
> post updated patches if necessary as I intend to use these tracking modes.<br>
><br>
> btw. I see many examples in the ChucK code where comments are used to<br>
> denote author and subject of a change. Why are you doing that? If every<br>
> developer writes proper commit messages you may just as well use "svn<br>
> blame" (or later "git blame") and "svn log".<br>
><br>
> Best regards,<br>
> Robin<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
chuck-dev mailing list<br>
<a href="mailto:chuck-dev@lists.cs.princeton.edu">chuck-dev@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev</a><br>
<br>
</div></div></blockquote></div><br></div>