Around line #289 in herculeslinux.cpp (its also now used in
herculeslinuxlegacy.cpp):

    // GED's magic formula -- no longer used.
    // double v = ((second+1)/(4.-
((second>((7/8.)*256))*((second-((7/8.)*256))*1/16.))));

    // Albert's http://zunzun.com/ site saves the day by solving our data
points to this new magical formula...
    double magic = (0.733835252488 * tan((0.00863901501308 * second) -
4.00513109039)) + 0.887988233294;

The second formula is what we had to change the pots value to in order to
keep it synced up with the on screen control.

It was determined rather approximately via brute force reading of the delta
in physical (0..255) and engine values (0.0..4.0) and applying a formula
finder @ zunzun.com.

It's worth noting that the pots on the herc only rotate like 300 degrees,
sharing the same dead area (bottom of the rotation) as the mixxx pots on
screen, so if you have a different dead area on your controller you'll have
probably have to recalculate a new function for that.  I can explain the
method for this, if you are interested.

Perhaps now that we understand what causes this weird looking behavior on
the pots -> engine we can find a cleaner formula (one that could even
include a deadzone) and use that everywhere?

Cheers,

-G

-- 
            __
--- == __/ t.O ==--
http://stacktrace.org/

On Dec 10, 2007 5:22 AM, Adam Davison <[EMAIL PROTECTED]> wrote:

> Hi Sacha,
>
> I can only speak for the Windows (MIDI) Hercules code where we use the
> setValueFromMidi function which loggifies the values. Tuma is trying
> to map a MIDI device so this change will affect him.
>
> Garth may correct this but my understanding is that on Linux you also
> have to deal with the non-linearity of what the Hercules hardware
> itself returns since there is no driver there to do it for you. So I
> think his plan is just to unfold the raw herc output into a pot value
> directly rather than pass it through two magic formulas separately.
>
> Adam
>
> On 10/12/2007, Sacha Berger <[EMAIL PROTECTED]> wrote:
> > Hi Adam & Albert,
> >
> > Am Montag, den 10.12.2007, 08:16 +0000 schrieb Adam Davison:
> > > Ah yes. I remember this now. I ended up applying this in some form and
> > > the midi code now uses this. It was also affecting my Hercules on
> > > Windows. So this will indeed probably solve Tuma's problem.
> >
> > Maybe---but the hercules code is right now not using the
> > controllogpotmeter?
> >
> > CU.Sacha
> >
> >
> >
> >
>
> -------------------------------------------------------------------------
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
-------------------------------------------------------------------------
SF.Net email is sponsored by: 
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to