Hey all,

Please, everybody (who cares) please take a look at RateControl -- it's 
an EngineControl object which is in charge of rate calculation in the 
engine in my features_looping branch. In Mixxx 1.8 it will be the 
central place where the Engine decides to calculate the rate of the 
song. Before all this logic was buried in EngineBuffer and hard to 
evaluate on the whole. Now it lives in a tiny class.

http://bazaar.launchpad.net/~mixxxdevelopers/mixxx/features_looping/annotate/head%3A/mixxx/src/engine/ratecontrol.cpp

RateControl::calculateRate is the meat of the class.

The functionality there was (mostly) copied from EngineBuffer -- I don't 
think it's an exact copy, but it's close enough.

Going forward, we should look at what we provide to devices / scripts / 
controls in the way of controlling a song's rate.

We currently have 3 ways of controlling the rate: the "wheel", 
"scratch", and "jog".

The psuedocode for how these work towards calculating the rate is as 
follows (xxx_co_value is the value of the control object of that name):

wheelValue = 40 * wheel_co_value

scratchValue = 1
if scratch_co_value > 0
    scratchValue = scratch_co_value + 1
else if scratch_co_value < 0:
    scratchValue = scratch_co_value - 1

jogValue = rate_range * filtered(jog_co_value)

raw_rate = rate_slider * rate_direction * rate_range
rate = (1 + raw_rate)
rate += wheelValue
rate *= scratchValue
rate += jogValue

if reverse
  rate = -rate

As you can see the wheel, scratch, and jog each affect the engine's 
playback rate in different ways. From what I can tell, these are 
probably the result of supporting specific devices (wheel for the 
xponent, jog for hercules devices).

Now that we have MIDI scripting, I think that device specific hacks 
should not be built in to the mixing engine. I think we should support 
the most general, common set of controls that a script could possibly 
want for controlling the audio playback.

To get the ball rolling, I'll just write some of my thoughts.

1) We should have engine support for scratching. This is something that 
almost any device with a wheel will want support for. This probably 
won't work in the way it currently does (multiplying the rate of the 
song). From what Sean has told me about his alpha-beta filter work, this 
will be more complicated than just modulating the rate.

2) We will want a method of making additions / subtractions from the 
rate. This is close to how the wheel currently works.

3) We will want to have a way of scaling the rate by a factor. This is 
akin to what scratch currently does.


Thoughts? What will crazy mixing devices of the future need to control 
in Mixxx to make them useful to DJs?
RJ

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to