[chuck-users] Chunity - RunCode() vs RunFile() affecting the stereo image

Luis Bergmann luisbergmann at gmail.com
Tue Nov 27 08:31:56 EST 2018

Hi Jack,

Thanks for the information about Chunity inner workings, I was indeed
calling RunFile on a ChuckSubInstance, so that's is why the output was mono

I actually did not even considered or thought possible sending directly to
ChuckMainInstance, as I learned the steps through the Chunity tutorial. I
did a quick test with RunFile calling a ChuckMainInstance with GetComponent
and it did work perfectly in stereo this time. That's is great as the
RunFile method seems preferable to a Machine.add inside a RunCode.

The reason I wanted to use panning on a ChuckSubInstance is that I was
calling various ChucK files that were part of a music composition, and one
of these was a synth part that had a wider panning randomization. So my
workaround was calling a Machine.add inside a RunCode.



On Mon, Nov 26, 2018 at 3:17 PM Jack Atherton <lja at ccrma.stanford.edu>

> Hi Luis,
> Are you sure the issue is between RunFile and RunCode? I would expect
> those two to behave the same way (but it's possible there is indeed a bug
> somewhere). That said, if you're calling one on a ChuckMainInstance vs a
> ChuckSubInstance, they would behave differently. The way that
> ChuckSubInstances are implemented, they have a mono Gain that secretly acts
> as a stand-in for their dac, so that their audio can be spatialized
> differently from other ChuckSubInstances. Running a ChucK script on a
> ChuckMainInstance should work as normally. Machine.add() would bypass the
> dac-replacement and also run normally.
> If you want to use panning rather than Unity's spatialization, it might
> make sense for those scripts to be going to the ChuckMainInstance anyway.
> Do you have a use case where you want to use ChucK panning on a
> ChuckSubInstance?
> Best,
> Jack
> On Mon, Nov 26, 2018 at 6:12 AM Luis Bergmann <luisbergmann at gmail.com>
> wrote:
>> Hello all,
>> I've been making a demo using Chunity to create music and sound for the
>> Unity demo Space Shooter.
>> I think Chunity is great and open up lots of possibilities, not only
>> regarding procedural synthesis but also implementing features commonly
>> found in game audio middlewares like Fmod and Wwise.
>> One particularly odd issue that I've found is that when using RunFile the
>> audio plays in mono only. That doesn't happen when using RunCode() or with
>> Machine.add(), as the stereo image using Pan2 or SndBuf2 is not affected
>> using these methods.
>> Does anyone notice that, or maybe I am missing something?
>> Best regards,
>> Luis
>> --
>> Luis Bergmann | +55 11 94284 0574
>> Twitter: @_luisbergmann
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

Luis Bergmann | +55 11 94284 0574
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20181127/049e038b/attachment.html>

More information about the chuck-users mailing list