Actually, if you set reshaping
to \elastic
it does work properly to rebuild the dependents, at least when the bus size changes!
Ndef.clear
Ndef(\kr2, { DC.kr([44, 55]) }).reshaping = \elastic;
Ndef(\copyk2, Ndef(\kr2)).reshaping = \elastic;
Ndef(\kr2, { DC.kr([91, 92, 93]) });
Ndef(\kr2).bus // -> Bus(control, 4, 3, localhost)
Ndef(\copyk2).bus.get // Bus control index: 7 values: [ 91.0, 92.0, 93.0 ].
Ndef(\copyk2).bus // -> Bus(control, 7, 3, localhost)
I’m rather impressed!
However, the original example, with a manual bus move that stays at the same size still doesn’t get detected, even with \elastic
. But I suppose this isn’t that much of a concern in typical use of Ndefs.
Ndef.clear
Ndef(\kr2, { DC.kr([44, 55]) }).reshaping = \elastic;
Ndef(\copyk2, Ndef(\kr2)).reshaping = \elastic;
Ndef(\kr2).bus // -> Bus(control, 0, 2, localhost)
Ndef(\kr2).bus.get // Bus control index: 0 values: [ 44.0, 55.0 ].
b = Bus.control(s, 2) // -> Bus(control, 4, 2, localhost)
Ndef(\kr2).bus = b
Ndef(\kr2).send
Ndef(\copyk2).bus.get // Bus control index: 2 values: [ 0.0, 0.0 ].