// Use this for initialization void Start() { Indicator[] indicators; indicators = GetComponentsInChildren <Indicator>(); System.Array.Sort(indicators, delegate(Indicator ind1, Indicator ind2) { return(ind1.indicatorNum.CompareTo(ind2.indicatorNum)); }); base.initialise(); dataComponent = new SequencerComponent(audioEngine.bufferSize, indicators); base.postInitialse(); }
private void tick(float value) { SequencerComponent prevSequencer = null; if (io.dataInputs[0].isConnected()) { prevSequencer = io.dataInputs[0].connectedSocket.adjoinedComponent as SequencerComponent; } if (prevSequencer != null) { noteFound = prevSequencer.noteFound; } else { noteFound = false; } //If the sequence here isn't complete and no note has already been found if (index < 8 && !noteFound) { updateIndicator(); if (io.dataOutputs[0].isConnected()) { noteFound = true; io.dataOutputs[0].set(values[index] * states[index]); io.dataOutputs[0].push(); } index++; } else { indicatorOff(); if (io.dataOutputs[0].isConnected()) { io.dataOutputs[0].set(value); io.dataOutputs[0].push(); } } SequencerComponent nextSequencer = null; if (io.dataOutputs[0].isConnected()) { nextSequencer = io.dataOutputs[0].connectedSocket.adjoinedComponent as SequencerComponent; } if (index >= 8 && nextSequencer == null) { resetChain(); } }
public void resetChain() { reset(); SequencerComponent prevSequencer = this; while (prevSequencer.io.dataInputs[0].isConnected()) { if (prevSequencer.io.dataInputs[0].connectedSocket.adjoinedComponent is SequencerComponent) { prevSequencer = prevSequencer.io.dataInputs[0].connectedSocket.adjoinedComponent as SequencerComponent; prevSequencer.reset(); } else { break; } } }