| 60 | } |
| 61 | |
| 62 | void 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 | |
| 89 | void Polyrhythms::DrawModule() |
| 90 | { |
nothing calls this directly
no test coverage detected