It looks like you are using the two signal paths in a similar way, so the first thing you can is to organise the samey stuff in a class. Basically whereever you have copied something and added "2" at the end.
Here's a rearranged version of your code (finally got around to testing github :) ):
https://github.com/Antimon262/curtisullerich_test/blob/master/tmp1.ck
The bottom code that generates stuff is pretty much as you wrote it. The top stuff is a class with some common stuff, the play method (it's like yours except it uses data stored in the object (defined by the class) instead of taking arguments), and a method that mimics what you did in your endless loop.
Below that is some initalization of the two objects, followed by this:
spork ~ mySynths[0].startPlaying();
spork ~ mySynths[1].startPlaying();
Hello,In my experiments with ChucK I've reached the point of wanting to use multiple instruments in polyphony (two Moogs in this case).My example is on GitHub here.
My usage pattern feels awkward and not very clean, and I'm hoping someone else has encountered the same situation. My question: What is a good way to manage and use multiple instruments in ChucK?It seems like a simple thing to want to do, but I haven't found any examples in the doc that work this way. Am I completely backwards about how I want to accomplish polyphony?
My particular use case is made most awkward because I'm using an ADSR envelope. I think it's mostly ChucK's style of time tracking/advancement that's derailing me. If I'm not describing this well enough, please let me know. Any advice is appreciated.Thanks!Curtis
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users