| 62 | } |
| 63 | |
| 64 | void UnstablePitch::DrawModule() |
| 65 | { |
| 66 | if (Minimized() || IsVisible() == false) |
| 67 | return; |
| 68 | |
| 69 | ofPushStyle(); |
| 70 | ofRectangle rect(3, 3, mWidth - 6, 34); |
| 71 | const int kGridSize = 30; |
| 72 | ofFill(); |
| 73 | for (int col = 0; col < kGridSize; ++col) |
| 74 | { |
| 75 | float x = rect.x + col * (rect.width / kGridSize); |
| 76 | float y = rect.y; |
| 77 | float val = mPerlin.GetValue(gTime, x / rect.width * 10, 0) * ofClamp(mPerlin.mPerlinAmount * 5, 0, 1); |
| 78 | ofSetColor(val * 255, 0, val * 255); |
| 79 | ofRect(x, y, (rect.width / kGridSize) + .5f, rect.height + .5f, 0); |
| 80 | } |
| 81 | |
| 82 | ofNoFill(); |
| 83 | ofSetColor(0, 255, 0, 90); |
| 84 | for (int voice = 0; voice < kNumVoices; ++voice) |
| 85 | { |
| 86 | if (mIsVoiceUsed[voice]) |
| 87 | { |
| 88 | ofBeginShape(); |
| 89 | for (int i = 0; i < gBufferSize; ++i) |
| 90 | { |
| 91 | float sample = ofClamp(mModulation.GetPitchBend(voice)->GetBufferValue(i) * 5, -1, 1); |
| 92 | ofVertex((i * rect.width) / gBufferSize + rect.x, rect.y + (-sample * .5f + .5f) * rect.height); |
| 93 | } |
| 94 | ofEndShape(); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | ofPopStyle(); |
| 99 | |
| 100 | mAmountSlider->Draw(); |
| 101 | mWarbleSlider->Draw(); |
| 102 | mNoiseSlider->Draw(); |
| 103 | } |
| 104 | |
| 105 | void UnstablePitch::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation) |
| 106 | { |
nothing calls this directly
no test coverage detected