Opcodes
cabbageAraGetUpdate
Returns a trigger that is 1 for a single k-cycle whenever ARA model data changes.
Syntax
Section titled “Syntax”trig:k = cabbageAraGetUpdate()Performance
Section titled “Performance”- kTrig — fires
1for a single k-cycle whenever the shared ARA document model data has been refreshed (k-rate only)
Description
Section titled “Description”Each time the shared ARA document model data is refreshed by the host, this opcode returns 1 for exactly one k-cycle, then returns 0 again. Use it as a trigger to re-read source metadata with cabbageAraGet.
If you also need to know what kind of event fired (for example "audioSourceAdded" or "regionChanged"), use cabbageAraGetUpdateEvent, which returns the event type alongside the same trigger.
Example
Section titled “Example”instr 1 trig:k = cabbageAraGetUpdate() if trig == 1 then event("i", "ReadAraData", 0, 0.001) endifendin
instr ReadAraData idx:i = cabbageAraGet("currentIndex") cnt:i = cabbageAraGet("audioSourceCount") prints("update: source %d of %d\n", idx, cnt)endin