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

Method DrawModule

Source/BiquadFilterEffect.cpp:110–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void BiquadFilterEffect::DrawModule()
111{
112 mTypeSelector->Draw();
113
114 mFSlider->Draw();
115 mQSlider->Draw();
116 mGSlider->Draw();
117
118 auto FreqForPos = [](float pos)
119 {
120 return 20.0 * std::pow(2.0, pos * 10);
121 };
122
123 float w, h;
124 GetModuleDimensions(w, h);
125 ofSetColor(52, 204, 235);
126 ofSetLineWidth(1);
127 ofBeginShape();
128 const int kPixelStep = 1;
129 for (int x = 0; x < w + kPixelStep; x += kPixelStep)
130 {
131 float freq = FreqForPos(x / w);
132 if (freq < gSampleRate / 2)
133 {
134 float response = mBiquad[0].GetMagnitudeResponseAt(freq);
135 ofVertex(x, (.5f - .666f * log10(response)) * h);
136 }
137 }
138 ofEndShape(false);
139}
140
141float BiquadFilterEffect::GetEffectAmount()
142{

Callers

nothing calls this directly

Calls 7

ofSetColorFunction · 0.85
ofSetLineWidthFunction · 0.85
ofBeginShapeFunction · 0.85
ofVertexFunction · 0.85
ofEndShapeFunction · 0.85
DrawMethod · 0.45

Tested by

no test coverage detected