If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
key follow formula
10 posts
• Page 1 of 1
key follow formula
Can somebody tell formula.
I thought that there just pitch multiplied by the coefficient. But I began to compare realized that there a little more complex.
I thought that there just pitch multiplied by the coefficient. But I began to compare realized that there a little more complex.
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: key follow formula
Key follow means, that, for example, a filter will adjust its cutoff according to the octave steps from the reference note.
Mostly the reference note is middle C, so if a note plays 1 octave higher (and key follow is at 100%) the filter will open up to double the cutoff frequency.
reference is C3, note played is C4, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 2kHz
reference is C3, note played is C2, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 500 Hz
reference is C3, note played is F#2, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 1.5 kHz
That said, and if pitch is the midi note number, it should work with
cutoff + ((pitch - 60) / 12 * cutoff * fkdepth)
where fkdepth is a percentage value in the range [0, 1], for the strength of the follow key function
Mostly the reference note is middle C, so if a note plays 1 octave higher (and key follow is at 100%) the filter will open up to double the cutoff frequency.
reference is C3, note played is C4, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 2kHz
reference is C3, note played is C2, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 500 Hz
reference is C3, note played is F#2, lowpass is set to 1 kHz, follow key is at 100% --> the filter will open up to 1.5 kHz
That said, and if pitch is the midi note number, it should work with
cutoff + ((pitch - 60) / 12 * cutoff * fkdepth)
where fkdepth is a percentage value in the range [0, 1], for the strength of the follow key function
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: key follow formula
Hey Logado,
I made a big mistake (that also nobody else seem to have noticed). It leads to the change being made absolute rather than relative!
Here is the corrected, relative version:
I made a big mistake (that also nobody else seem to have noticed). It leads to the change being made absolute rather than relative!
Here is the corrected, relative version:
- Code: Select all
cutoff = 1000 #a cutoff frequency like from a filter
reference = 60.0 #To what midi note does the function refer to (middle c = 60)
pitch = 60.0 #The current pitch as midi note
fkdepth = 1.0 #The strength of the follow-key-function
f = 0.0
oct = (pitch / 12.0) - (reference / 12)
if oct < 0
f = 1 / (oct.abs * 2)
elsif oct == 0
f = 1.0
else
f = oct.abs * 2
end
result = cutoff * (f * fkdepth)
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: key follow formula
I think it works well now. But if keyfollow set to zero filter is always closed. I need to add сlassic dry/wet mix?
- Attachments
-
- keyfollow.fsm
- (221.72 KiB) Downloaded 868 times
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: key follow formula
yes if depth is 0% , cutoff knob should set the the filter
why not do all the calculation in the pitch range
so it would be cutoff(pitch) = (pitch - reference)*depth+cutoff(pitch)
and then convert the range from pitch to 0..1
its like in the stock module just that you also subtract the reference octave from the pitch
why not do all the calculation in the pitch range
so it would be cutoff(pitch) = (pitch - reference)*depth+cutoff(pitch)
and then convert the range from pitch to 0..1
its like in the stock module just that you also subtract the reference octave from the pitch
- Attachments
-
- keyfollow.fsm
- (739.03 KiB) Downloaded 816 times
Last edited by Nubeat7 on Sun Jun 14, 2015 10:22 pm, edited 1 time in total.
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: key follow formula
Yes, that was a second absolute-relative error I made. Thanks Nubeat, for correcting it
I never saw a key follow funtion in the stock modules. So It was all from my head. Maybe that is an excuse?
I never saw a key follow funtion in the stock modules. So It was all from my head. Maybe that is an excuse?
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: key follow formula
tulamide wrote:Yes, that was a second absolute-relative error I made. Thanks Nubeat, for correcting it
I never saw a key follow funtion in the stock modules. So It was all from my head. Maybe that is an excuse?
Do not worry, you guided me on the right path.
- Logado
- Posts: 62
- Joined: Tue Jan 06, 2015 5:42 pm
Re: key follow formula
don't mind tulamide, its an interesting thread, i never invested that much thoughts and your explanation makes it very clear i think its also a good thing to do it with a reference octave!
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 70 guests