Rolfdegen
Well-known member
Hallo friends
I'm using the Teensy Audio Lib for a state variable filter. I control the filter frequency for key tracking via the frequency control input.
The filter's corner frequency is set via filter.frequency()
The control of the filter frequency works correctly. But the resonance frequency shifts downwards and no longer matches the filter frequency.
I programmed the Filter.octave control to a fixed value of 7 (7 octaves).
Thanks for help. Greetings Rolf
I'm using the Teensy Audio Lib for a state variable filter. I control the filter frequency for key tracking via the frequency control input.
The filter's corner frequency is set via filter.frequency()
The control of the filter frequency works correctly. But the resonance frequency shifts downwards and no longer matches the filter frequency.
I programmed the Filter.octave control to a fixed value of 7 (7 octaves).
Code:
//*************************************************************************
// play Voices
//*************************************************************************
void voice1On(byte note, byte velocity, float level) {
keytrackingValue = KEYTRACKINGAMT[note] * keytrackingAmount; // keytrackingAmount = 0.0 - 1.0 (0-100%)
filterModMixer1.gain(2, keytrackingValue);
voices[0].note = note;
voices[0].timeOn = millis();
// Amp velocity
float velo = (0.5 - myAmpVelocity) + (VELOCITY[velocitySens][velocity] * myAmpVelocity);
voiceMixer1.gain(0, velo);
//voiceMixer1.gain(0, VELOCITY[velocitySens][velocity] * VOICEMIXERLEVEL);
// Filter velocity
velo = ((0.5 - myFilVelocity) + (VELOCITY[velocitySens][velocity] * myFilVelocity));
//FilterVelo1.amplitude(velo);
filterEnvelope1.noteOn();
ampEnvelope1.noteOn();
voices[0].voiceOn = 1;
if (glideSpeed > 0 && note != prevNote) {
glide1.amplitude((prevNote - note) * DIV24); //Set glide to previous note frequency (limited to 1 octave max)
glide1.amplitude(0, glideSpeed * GLIDEFACTOR); //Glide to current note
}
if (unison == 0)prevNote = note;
}
filterOctave = 7.0f;
filter1.octaveControl(filterOctave);
filter2.octaveControl(filterOctave);
filter3.octaveControl(filterOctave);
filter4.octaveControl(filterOctave);
filter5.octaveControl(filterOctave);
filter6.octaveControl(filterOctave);
filter7.octaveControl(filterOctave);
filter8.octaveControl(filterOctave);
void updateFilterFreq() {
filter1.frequency(filterFreq);
filter2.frequency(filterFreq);
filter3.frequency(filterFreq);
filter4.frequency(filterFreq);
filter5.frequency(filterFreq);
filter6.frequency(filterFreq);
filter7.frequency(filterFreq);
filter8.frequency(filterFreq);
}
filterOctave = 7.0f;
filter1.octaveControl(filterOctave);
filter2.octaveControl(filterOctave);
filter3.octaveControl(filterOctave);
filter4.octaveControl(filterOctave);
filter5.octaveControl(filterOctave);
filter6.octaveControl(filterOctave);
filter7.octaveControl(filterOctave);
filter8.octaveControl(filterOctave);
// KeyTracking Amt
const static float KEYTRACKINGAMT[128] = {
0, 0.008, 0.016, 0.024, 0.031,
0.039, 0.047, 0.055, 0.063, 0.071, 0.079, 0.087, 0.094, 0.102, 0.110,
0.118, 0.126, 0.134, 0.142, 0.150, 0.157, 0.165, 0.173, 0.181, 0.189,
0.197, 0.205, 0.213, 0.220, 0.228, 0.236, 0.244, 0.252, 0.260, 0.268,
0.276, 0.283, 0.291, 0.299, 0.307, 0.315, 0.323, 0.331, 0.339, 0.346,
0.354, 0.362, 0.370, 0.378, 0.386, 0.394, 0.402, 0.409, 0.417, 0.425,
0.433, 0.441, 0.449, 0.457, 0.465, 0.472, 0.480, 0.488, 0.496, 0.504,
0.512, 0.520, 0.528, 0.535, 0.543, 0.551, 0.559, 0.567, 0.575, 0.583,
0.591, 0.598, 0.606, 0.614, 0.622, 0.630, 0.638, 0.646, 0.654, 0.661,
0.669, 0.677, 0.685, 0.693, 0.701, 0.709, 0.717, 0.724, 0.732, 0.740,
0.748, 0.756, 0.764, 0.772, 0.780, 0.787, 0.795, 0.803, 0.811, 0.819,
0.827, 0.835, 0.843, 0.850, 0.858, 0.866, 0.874, 0.882, 0.890, 0.898,
0.906, 0.913, 0.921, 0.929, 0.937, 0.945, 0.953, 0.961, 0.969, 0.976,
0.984, 0.992, 1
};
Thanks for help. Greetings Rolf