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

Method OnTransportAdvanced

Source/DotSequencer.cpp:203–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void DotSequencer::OnTransportAdvanced(float amount)
204{
205 for (int i = 0; i < (int)mPlayingDots.size(); ++i)
206 {
207 if (mPlayingDots[i].mPitch != -1)
208 {
209 const DotGrid::DotData& data = mDotGrid->GetDataAt(mPlayingDots[i].mCol, mPlayingDots[i].mRow);
210 double noteOffTime = -1;
211
212 if (data.mOn == false || mStepIdx < mPlayingDots[i].mCol)
213 {
214 noteOffTime = NextBufferTime(!K(includeLookahead));
215 }
216 else
217 {
218 double noteEnd = mPlayingDots[i].mPlayedTime + TheTransport->GetDuration(mInterval) * std::max(.5f, data.mLength);
219 if (noteEnd < NextBufferTime(K(includeLookahead)))
220 noteOffTime = noteEnd;
221 }
222
223 if (noteOffTime != -1)
224 {
225 mNoteOutput.PlayNote(noteOffTime, mPlayingDots[i].mPitch, 0);
226 mPlayingDots[i].mPitch = -1;
227 }
228 }
229 }
230
231 if (mShouldStopAllNotes)
232 {
233 for (int i = 0; i < (int)mPlayingDots.size(); ++i)
234 {
235 if (mPlayingDots[i].mPitch != -1)
236 {
237 mNoteOutput.PlayNote(NextBufferTime(!K(includeLookahead)), mPlayingDots[i].mPitch, 0);
238 mPlayingDots[i].mPitch = -1;
239 }
240 }
241 mShouldStopAllNotes = false;
242 }
243}
244
245int DotSequencer::RowToPitch(int row) const
246{

Callers

nothing calls this directly

Calls 4

NextBufferTimeFunction · 0.85
sizeMethod · 0.80
GetDurationMethod · 0.80
PlayNoteMethod · 0.45

Tested by

no test coverage detected