Master Volume and Track Volume with Takeover

samedi 8 août 2015

Just finally beat a couple issues that have been bugging me for a while so I thought I would post for others. The issue is the absolute value of midi CC assigned to track volumes or group volumes.

Issue #1 - you have a fader assigned to track volume, but as soon as you move it the track jumps to the volume.

Issue #2 - you have a fader assigned to scope "group" - when you move that fader it also passes absolute values to each track assigned to the group (i.e. issue #1 plus no relative volume scaling).

So these two scripts are an attempt to give me track volume faders with takeover capability plus a "master volume" fader (also with its own takeover) that will scale each track up or down by a relative amount. I.E. if Track 1 is at level 50 and track 2 is at level 70, when you move the master fader up 10 track 1 will go to 60 and track 2 to 80.

I assign the first script (TrackVolume) to the first 8 faders on my Korg NanoKontrol, assigning each fader to a different track via the midi control scope. I assign the second script (MasterVolume) to the 9th fader on my NanoKontrol.

Hope this helps someone else. It's kind of nice for me - I have 8 track faders with takeover now plus a master fader with relative scaling. Boom.

Track Volume Script

Code:

!name TrackVolume
!controller

#control track output level with wait for takeover
#i.e. wait until the cc value actually crosses the display value

Variable track ccThreshVal
Variable track ccThreshSet
Variable track ccThreshCrossed

If ccThreshCrossed = 1
        #Threshold has been crossed, make output match cc value
        Message Track $trackNumber Volume $midiValue
        set output midiValue
elseif ccThreshSet = 1
        #Threshold has been set but not crossed yet
        Message Track $trackNumber takeover at $ccThreshVal current $midiValue
        if midiValue = ccThreshVal
                set ccThreshCrossed 1
        endif       
else
        #Threshold has not been set yet - set threhold value to current display value (i.e. first launch of this script this session this track)
        set ccThreshVal        output
        set ccThreshSet 1
endif

Master Volume Script

Code:

!name MasterVolume
!controller

#This script assumes the use of the TrackVolume script and related variables.
#The idea is to have a master volume that is "relative" - i.e. control individual tracks by the relative value rather than absolute
#As opposed to the "group volume" control - that control is hard set, when you move the control it forces all tracks to same vol
#I'm not going to attempt scaling values, just will take +- values and add or subtract to each track

Variable Global ccGlobThreshVal
Variable Global ccGlobThreshSet
Variable Global ccGlobThreshCrossed
Variable Global GlobLastLevel
Variable track ccThreshVal
Variable track ccThreshSet
Variable track ccThreshCrossed
Variable ValDiff

If ccGlobThreshCrossed = 1
        #Threshold has been crossed, calculate difference from last level on this fader move
        Message MasterVolume $midiValue
        set ValDiff (midiValue - GlobLastLevel)
        #reset GlobalLastLevel for next fader move
        set GlobLastLevel (GlobLastLevel + ValDiff)
        #Apply current fader move to each track
        for *
                set output (output + ValDiff)
                #reset individual track fader takeover settings (for TrackVolume script - this will force that script to reset the threshold for the new vol setting)
                set ccThreshCrossed 0
                set ccThreshSet 0
        next
elseif ccGlobThreshSet = 1
        #Threshold has been set but not crossed yet
        Message MasterVolume takeover at $ccGlobThreshVal current $midiValue
        if midiValue = ccGlobThreshVal
                set ccGlobThreshCrossed 1
        endif       
else
        #Threshold has not been set yet - set threhold value to highest display value (i.e. first launch of this script this session)
        set ccGlobThreshVal 0
        for *
                if output > ccGlobThreshVal
                        set ccGlobThreshVal output
                        set GlobLastLevel ccGlobThreshVal
                        set ccGlobThreshSet 1
                endif
        next
endif



0 commentaires:

Enregistrer un commentaire

 

Lorem

Ipsum

Dolor