Jump to content

Adjust volume curves?


Recommended Posts

I have a crossfader on a 2 deck player I'm making.

I'd like to be able to adjust the crossfader curve like real mixers using a slider control. sliding it from a streight mix to a sharp/hard mix.

see graph below (streight mix - normal mix - sharper mix)

Posted Image

I currently have it doing a streight mix (left side image) using the following code to get a number between 0~100 from the crossfader slider ,converting it to decimal and multipling it by individual player volume, but am unsure how to make it adjust volumes like the other curves, which would make better mixes I think.

;convert 0~100 to 0.0~1.0
$xVolume = GUICtrlRead($crossfader)
    If $xVolume <> 100 Then
        If StringLen($xVolume) = 1 Then
            $xVolume = "0.0" & $xVolume
        Else
            $xVolume = "0." & $xVolume
        EndIf
    Else
        $xVolume = "1.0"
    EndIf

$crossfadeA = (1 - $xVolume)*(100 - GUICtrlRead($volumeA))
WMSetVolume($oDeckA, $crossfadeA)
$crossfadeB = $xVolume*(100 - GUICtrlRead($volumeB))
WMSetVolume($oDeckB, $crossfadeB)

Maths is not my stronge point, I figure it is a matter of getting a value from a curve adjust slider and doing something tricky to the $xVolume?

My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...