| 154 | } |
| 155 | |
| 156 | void PulseSequence::Step(double time, float velocity, int flags) |
| 157 | { |
| 158 | if (!mEnabled) |
| 159 | return; |
| 160 | |
| 161 | int direction = 1; |
| 162 | if (flags & kPulseFlag_Backward) |
| 163 | direction = -1; |
| 164 | |
| 165 | mStep = (mStep + direction + mLength) % mLength; |
| 166 | |
| 167 | if (flags & kPulseFlag_Reset) |
| 168 | mStep = 0; |
| 169 | else if (flags & kPulseFlag_Random) |
| 170 | mStep = gRandom() % mLength; |
| 171 | |
| 172 | if (!mHasExternalPulseSource || (flags & kPulseFlag_SyncToTransport)) |
| 173 | { |
| 174 | mStep = TheTransport->GetSyncedStep(time, this, mTransportListenerInfo, mLength); |
| 175 | } |
| 176 | |
| 177 | if (flags & kPulseFlag_Align) |
| 178 | { |
| 179 | int stepsPerMeasure = TheTransport->GetStepsPerMeasure(this); |
| 180 | int numMeasures = ceil(float(mLength) / stepsPerMeasure); |
| 181 | int measure = TheTransport->GetMeasure(time) % numMeasures; |
| 182 | mStep = ((TheTransport->GetQuantized(time, mTransportListenerInfo) % stepsPerMeasure) + measure * stepsPerMeasure) % mLength; |
| 183 | } |
| 184 | |
| 185 | float v = mVels[mStep] * velocity; |
| 186 | |
| 187 | if (v > 0) |
| 188 | { |
| 189 | DispatchPulse(GetPatchCableSource(), time, v, 0); |
| 190 | |
| 191 | if (mStep < kIndividualStepCables) |
| 192 | DispatchPulse(mStepCables[mStep], time, v, 0); |
| 193 | } |
| 194 | |
| 195 | mVelocityGrid->SetHighlightCol(time, mStep); |
| 196 | } |
| 197 | |
| 198 | void PulseSequence::GetModuleDimensions(float& width, float& height) |
| 199 | { |
nothing calls this directly
no test coverage detected