measuring speed of a fader?

For general discussion related FlowStone
Post Reply
mccy
Posts: 69
Joined: Sun Feb 27, 2011 3:20 pm

measuring speed of a fader?

Post by mccy »

Measuring the speed of a fader, how would you do that?
I'd like to have an output in numbers how fast I move a Fader for scratching, so sometimes it goes up and down very fast. I would need an algorithm which measures how much 'way' the fader goes, how fast it moves...

Any Ideas?

Martin
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: measuring speed of a fader?

Post by KG_is_back »

Following ruby code should do it:

Code: Select all

def event(i,v,t)
if @pt #pt = previous time
dt=t-@pt #change in time
else
dt=1000.0 #if previous time doesn't exist make dt big
end
@pi=t
if @pv
output 0, (v-@pv)/dt #if previous value exists output speed = dv/dt
@pv=v
else
@pv=v
output 0,0.0 #if previous value doesn't exist, output zero.
end
end
Last edited by KG_is_back on Wed Oct 28, 2015 3:07 pm, edited 2 times in total.
adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: measuring speed of a fader?

Post by adamszabo »

I wanted to try it but I get a syntax error saying unexpected $end or something
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: measuring speed of a fader?

Post by KG_is_back »

oops sorry... bad copy-paste... there should be one more "end" in the end. Fixed in the original post.
mccy
Posts: 69
Joined: Sun Feb 27, 2011 3:20 pm

Re: measuring speed of a fader?

Post by mccy »

Wow, thank you!!! I will try it in the next days & show you the result. I want to control a filter cutoff with it to avoid artefacts when moving the fader slowly.
mccy
Posts: 69
Joined: Sun Feb 27, 2011 3:20 pm

Re: measuring speed of a fader?

Post by mccy »

adamszabo
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: measuring speed of a fader?

Post by adamszabo »

mccy wrote:I want to control a filter cutoff with it to avoid artefacts when moving the fader slowly.


Thats exactly what I was planning to do as well! Would you mind posting a project with that part?
mccy
Posts: 69
Joined: Sun Feb 27, 2011 3:20 pm

Re: measuring speed of a fader?

Post by mccy »

Had strange problems, when using midi or automation. Dropped the ruby thing.
All you need is a delay, substraction and some envelope following. It's so easy and I needed hours to get it:

- Calculate Signalchanges so that your values are 0-1 (ActualFaderposition) / (MaxFader-MinFader)
- use a sample delay with something above 100 samples (cant look right now)
- substract delayed signal from signal in time
- use some smoothing like envelope follower
=> you have the speed of the fader (between 0 &1)
- nothing simpler, to modulate a Filter with it!

Now it works with midi & automation & I love it!
Post Reply