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

Method OnScaleChanged

Source/NoteSinger.cpp:123–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123void NoteSinger::OnScaleChanged()
124{
125 mNumBuckets = MIN(TheScale->NumTonesInScale() * 4, NOTESINGER_MAX_BUCKETS);
126
127 for (int i = 0; i < mNumBuckets; ++i)
128 {
129 int pitch = GetPitchForBucket(i);
130 float f = TheScale->PitchToFreq(pitch);
131
132 mBands[i].SetFilterType(kFilterType_Bandpass);
133 mBands[i].SetFilterParams(f, 40 + mNumBuckets * 2 - i * 2);
134
135 mPeaks[i].SetDecayTime(.05f);
136 }
137}
138
139int NoteSinger::GetPitchForBucket(int bucket)
140{

Callers

nothing calls this directly

Calls 5

PitchToFreqMethod · 0.80
SetDecayTimeMethod · 0.80
NumTonesInScaleMethod · 0.45
SetFilterTypeMethod · 0.45
SetFilterParamsMethod · 0.45

Tested by

no test coverage detected