Hi,
I’ve been trying to model some basic logic chips (flip-flops, counters, etc.) in SC to make a kind of virtual lunetta synth. And I’ve been drawn to JITLib and Ndefs as a way of playing with them in a modular-like way. I’m new to JIT and have never used Ndefs before…so I’m sure I’m missing something…but here’s my question.
Say I have a Ndef that outputs different things on multiple channels. For instance, on one channel it outputs a square wave, and on the other it outputs the inverse of the square wave (ie. when one is high, the other is low, etc – kind of like Q and barQ on an old logic chip). Or say I have an Ndef that is acting like a counter: for each trigger it receives, it will output a pulse, first on channel zero, the next on channel one, the next on channel two, etc. until it reaches, say ten, then it starts over.
Here’s the question: how can I grab only one of an Ndef’s multiple outs and route it into another Ndef? I’d like to be able to do something like this piece of fantasy code…
Ndef(\someOscillator).set(\theOscillatorGate, Ndef(\counter).out(3));
It is the Ndef(\counter).out(3)
part that I’m curious about. How can I grab, say, only channel 3 of that Ndef’s output, so I can plug it into another Ndef?
I’m sure there is some simple solution, but I haven’t been able to find it. Any help from the collective hive mind would be appreciated.
–Brian