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

Method DrawModule

Source/UnstablePressure.cpp:64–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void UnstablePressure::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.GetPressure(voice)->GetBufferValue(i), -1, 1);
92 ofVertex((i * rect.width) / gBufferSize + rect.x, rect.y + (1 - sample) * rect.height);
93 }
94 ofEndShape();
95 }
96 }
97
98 ofPopStyle();
99
100 mAmountSlider->Draw();
101 mWarbleSlider->Draw();
102 mNoiseSlider->Draw();
103}
104
105void UnstablePressure::PlayNote(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation)
106{

Callers

nothing calls this directly

Calls 14

ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofClampFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofNoFillFunction · 0.85
ofBeginShapeFunction · 0.85
ofVertexFunction · 0.85
ofEndShapeFunction · 0.85
ofPopStyleFunction · 0.85
GetBufferValueMethod · 0.80
GetValueMethod · 0.45

Tested by

no test coverage detected