MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Step

Method Step

Source/PulseSequence.cpp:156–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void 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
198void PulseSequence::GetModuleDimensions(float& width, float& height)
199{

Callers

nothing calls this directly

Calls 5

GetSyncedStepMethod · 0.80
GetStepsPerMeasureMethod · 0.80
GetMeasureMethod · 0.80
GetQuantizedMethod · 0.80
SetHighlightColMethod · 0.45

Tested by

no test coverage detected