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

Method OnTransportAdvanced

Source/Polyrhythms.cpp:62–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void Polyrhythms::OnTransportAdvanced(float amount)
63{
64 PROFILER(Polyrhythms);
65
66 if (!mEnabled)
67 return;
68
69 double time = NextBufferTime(true);
70
71 for (int i = 0; i < mRhythmLines.size(); ++i)
72 {
73 int beats = mRhythmLines[i]->mGrid->GetCols();
74
75 TransportListenerInfo info(nullptr, kInterval_CustomDivisor, OffsetInfo(0, false), false);
76 info.mCustomDivisor = beats;
77
78 double remainderMs;
79 int oldStep = TheTransport->GetQuantized(NextBufferTime(true) - gBufferSizeMs, &info);
80 int newStep = TheTransport->GetQuantized(NextBufferTime(true), &info, &remainderMs);
81 float val = mRhythmLines[i]->mGrid->GetVal(newStep, 0);
82 if (newStep != oldStep && val > 0)
83 PlayNoteOutput(time - remainderMs, mRhythmLines[i]->mPitch, val * 127, -1);
84
85 mRhythmLines[i]->mGrid->SetHighlightCol(time, newStep);
86 }
87}
88
89void Polyrhythms::DrawModule()
90{

Callers

nothing calls this directly

Calls 7

NextBufferTimeFunction · 0.85
OffsetInfoClass · 0.85
sizeMethod · 0.80
GetQuantizedMethod · 0.80
GetValMethod · 0.80
GetColsMethod · 0.45
SetHighlightColMethod · 0.45

Tested by

no test coverage detected