Rane Twelve Mapping for Mixxx

XML preset files and script files (.js) for MIDI and other controllers.

Moderators: garth, User Customization Moderators

Rane Twelve Mapping for Mixxx

Postby Michael Z Freeman » Sun Apr 19, 2020 3:28 pm

Hi,

RaneDJ-img-TwlvHeadrBkgK.jpg
RaneDJ-img-TwlvHeadrBkgK.jpg (190.74 KiB) Viewed 1208 times


I obtained a very nice Rane Twelve - https://www.rane.com/catalog/product/vi ... egory/185/

After hacking around with XML files and Javascript I resorted to seeing if I could find an already available mapping that would work with the Rane. To my surprise the Numark V7 almost works out of the box. The Rane platter starts rotating when play is hit in Mixxx, and the other way round, Mixxx starts playing when starting from the Rane itself. So clearly there are similar control schemes at work here. However the platter is rotating too slowly. Obviously the Numark script needs some fine tuning.

Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.2.3+"> <!-- Schema version number to help compatibility, should the MIDI format change -->
    <info>
      <name>Rane Twelve</name>
      <author>Michael Z Freeman</author>
      <description>Initial mapping for Rane Twelve to test platter functionality. I have the "revised" Rane Twelve with the inset power and USB sockets underneath the controller otherwise there is no difference in functionality. This is NOT tested with the Rane Twelve Mk2 which is rumoured to be released as some future date and has extra buttons on it.</description>
        <wiki>Encoded URL to Mixxx wiki page documenting this controller mapping</wiki>
        <forums>Encoded URL to Mixxx discussion forums page for this controller mapping</forums>
    </info>
    <controller id="Rane"> <!-- Many controllers in one file supported. A controller should only appear once -->
         <scriptfiles>
           <file filename="Numark-V7-scripts.js" functionprefix="NumarkV7"/>
        </scriptfiles>   
      <controls> <!-- One control group -->
        <control> <!-- Several controls -->
          <group>[Channel1]</group>
           <key>NumarkV7.ScratchA</key>
          <status>0xE0</status> <!-- "midino" XML entry ommmited - see https://mixxx.org/wiki/doku.php/midi_controller_mapping_file_format#pitch_controls -->
          <options>
                <Script-Binding/>       
            <!-- all control specific options should go here - sensitivity etc. Specifics to be decided by spec -->
                <!-- "Soft-takeover" here so that when switching decks the platter speed does not mess up the deck that is being changed to ? -->
                <!-- See - https://mixxx.org/wiki/doku.php/midi_controller_mapping_file_format#input_options and https://mixxx.org/wiki/doku.php/midi_scripting?s[]=scratchtick#soft-takeover -->
          </options>
        </control>
       </controls>
    </controller>
</MixxxControllerPreset>


Maybe there are other controllers that are even closer to the Rane that already have mappings for Mixxx ?

Anyway the Numark V7 is a starting point.

So ...

1. My Javascript skills are not very advanced. I can understand the code and alter some of it but I just don't have a massive amount of experience with Javascript.

2. There must be other Rane Twelve owners out there that want the Rane to work with Mixxx.

3. Development nuts and bolts: I noticed a "case" statement in the Numark script. As I found out the Rane platter cannot just be plugged straight into mix. I've heard that its divided into sections. Debug shows a pitch control and another control that cycles across a range of values ...

Code: Select all
Debug [Controller]: Rane Twelve: t:3896 ms status 0xE0: pitch bend ch 1, value 0x3A78
Debug [Controller]: Rane Twelve: t:3899 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x22
Debug [Controller]: Rane Twelve: t:3899 ms status 0xE0: pitch bend ch 1, value 0x2642
Debug [Controller]: Rane Twelve: t:3902 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x23
Debug [Controller]: Rane Twelve: t:3902 ms status 0xE0: pitch bend ch 1, value 0x0FB4
Debug [Controller]: Rane Twelve: t:3906 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x24
Debug [Controller]: Rane Twelve: t:3906 ms status 0xE0: pitch bend ch 1, value 0x373A
Debug [Controller]: Rane Twelve: t:3909 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x25
Debug [Controller]: Rane Twelve: t:3909 ms status 0xE0: pitch bend ch 1, value 0x1CFD
Debug [Controller]: Rane Twelve: t:3912 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x26
Debug [Controller]: Rane Twelve: t:3912 ms status 0xE0: pitch bend ch 1, value 0x013A
Debug [Controller]: Rane Twelve: t:3915 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x27


Clearly the Numark must work in a similar way or it would not work the way it does out of the box.

4. Code would need refactoring and updating and tuning to the Rane itself.

Lets go ! :D
"I heard the sound of the Universe vibrating as one harmonious force."
User avatar
Michael Z Freeman
 
Posts: 94
Joined: Thu Sep 15, 2011 10:02 pm

Re: Rane Twelve Mapping for Mixxx

Postby Michael Z Freeman » Sat May 02, 2020 5:06 pm

So an update.

Full bi directional control has not been established ! I'll try and make a video in the next few days. See attachments below. Now the Rane wheel controls Mixxx and I experimented with various slow downs, spin back and scratching. There did seem to be a slight warble noticeable in some tracks I was playing so something still might need fine tuning somewhere, but this is definitely progress !

The reason this works now is that I discovered that the Numark V7 script distributed with Mixxx is actually an old version of the script (1.1). There is a newer version here (v2.0).

I then altered "NumarkV7.ScratchA" in the XML file to having a 0x06 on the "midino" with "status" being retained still 0xB0.

Of course you can still only control a single deck but that's one of the next things.

Use the following attachments.

Rane_Twelve.midi.xml
(21.27 KiB) Downloaded 163 times


Rane-Twelve-scripts.js
(64.41 KiB) Downloaded 163 times


Also here are what the Rane buttons and controls are outputting. Only control I still need to do is the Strip Search.

> Wheel = " Debug [Controller]: Rane Twelve: t:324735 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x06, val 0x3E
Debug [Controller]: Rane Twelve: t:324735 ms status 0xE0: pitch bend ch 1, value 0x3878"
> Start/Stop = "Debug [Controller]: Rane Twelve MIDI 1: t:127286 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x34, val 0x7F"
> 45 = "Debug [Controller]: Rane Twelve MIDI 1: t:19636 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x7F"
> 33 = "Debug [Controller]: Rane Twelve MIDI 1: t:20140 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x00"
> Motor On/Off (***ONLY ON OFF***) = "Debug [Controller]: Rane Twelve MIDI 1: t:24920 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x4B, val 0x7F"
> Cue Mode (NOTICE DOWN AND UP STATE) = "Debug [Controller]: Rane Twelve MIDI 1: t:17156 ms status 0x94 (ch 5, opcode 0x9), ctrl 0x00, val 0x7F" ... "Debug [Controller]: Rane Twelve MIDI 1: t:17331 ms status 0x94 (ch 5, opcode 0x9), ctrl 0x00, val 0x00"
> Deck 1 = "Debug [Controller]: Rane Twelve MIDI 1: t:28684 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x40, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:28684 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x33, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:28684 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:28684 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x09, val 0x40
Debug [Controller]: Rane Twelve MIDI 1: t:28684 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x77, val 0x00
> Deck 2 = "Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x33, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0x91 (ch 2, opcode 0x9), ctrl 0x40, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0x91 (ch 2, opcode 0x9), ctrl 0x33, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0xB1 (ch 2, opcode 0xB), ctrl 0x09, val 0x40
Debug [Controller]: Rane Twelve MIDI 1: t:6020 ms status 0xB1 (ch 2, opcode 0xB), ctrl 0x77, val 0x00
> Deck 3 ="Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0x91 (ch 2, opcode 0x9), ctrl 0x33, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0x92 (ch 3, opcode 0x9), ctrl 0x40, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0x92 (ch 3, opcode 0x9), ctrl 0x33, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0xB2 (ch 3, opcode 0xB), ctrl 0x09, val 0x40
Debug [Controller]: Rane Twelve MIDI 1: t:5766 ms status 0xB2 (ch 3, opcode 0xB), ctrl 0x77, val 0x00
> Deck 4 = "Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0x92 (ch 3, opcode 0x9), ctrl 0x33, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0x93 (ch 4, opcode 0x9), ctrl 0x40, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0x93 (ch 4, opcode 0x9), ctrl 0x33, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0x9F (ch 16, opcode 0x9), ctrl 0x38, val 0x00
Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0xB3 (ch 4, opcode 0xB), ctrl 0x09, val 0x40
Debug [Controller]: Rane Twelve MIDI 1: t:4968 ms status 0xB3 (ch 4, opcode 0xB), ctrl 0x77, val 0x00
> Cue Mode = "Debug [Controller]: Rane Twelve MIDI 1: t:17159 ms status 0x94 (ch 5, opcode 0x9), ctrl 0x00, val 0x00"
> Strip = Similar to wheel (lots of messages will add here later).
> Pitch = "Debug [Controller]: Rane Twelve MIDI 1: t:50562 ms status 0xB0 (ch 1, opcode 0xB), ctrl 0x77, val 0x70" with different values.
> Pitch Range Select ...
- 8% = "Debug [Controller]: Rane Twelve MIDI 1: t:67278 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0B, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:67459 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0B, val 0x00"
- 16% = "Debug [Controller]: Rane Twelve MIDI 1: t:68825 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0C, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:69024 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0C, val 0x00"
- 50% = "Debug [Controller]: Rane Twelve MIDI 1: t:70337 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0D, val 0x7F
Debug [Controller]: Rane Twelve MIDI 1: t:70466 ms status 0x90 (ch 1, opcode 0x9), ctrl 0x0D, val 0x00"
"I heard the sound of the Universe vibrating as one harmonious force."
User avatar
Michael Z Freeman
 
Posts: 94
Joined: Thu Sep 15, 2011 10:02 pm

Re: Rane Twelve Mapping for Mixxx

Postby Michael Z Freeman » Sun May 03, 2020 12:01 pm

I just confirmed that the Script is not decoding the MIDI output from the Rane wheel properly. There is a remote chance that it's a broken motor on my Rane 12 but it seems unlikely as it's an almost new unit. I should be able to confirm that tomorrow when hardware is delivered that will unlock Serato DJ Lite for me.

Here is a pristine Sine wave as generated in Audacity @ 440hz ...

Audacity Sine Wave 440 - Unaltered.jpg
Audacity Sine Wave 440 - Unaltered.jpg (249.64 KiB) Viewed 1195 times


Now here is that sine wave as played in Mixxx by the Rane Twelve script (actually a copy of the Numark V7 script) ...

Audacity Sine Wave 440 - Rane 12 Script.jpg
Audacity Sine Wave 440 - Rane 12 Script.jpg (489.95 KiB) Viewed 1195 times


As you can see the script is not decoding the output from the wheel properly or there could be something else going on as this is just copied and pasted from the Numark script.
"I heard the sound of the Universe vibrating as one harmonious force."
User avatar
Michael Z Freeman
 
Posts: 94
Joined: Thu Sep 15, 2011 10:02 pm

Re: Rane Twelve Mapping for Mixxx

Postby JosepMa » Mon May 04, 2020 6:15 pm

Possibly, you are expecting midi script response to be very stable. Possibly you need to provide some quantization to value changes or at least a variance higher than some percentage to accept it as a variance.
JosepMa
 
Posts: 888
Joined: Sat Oct 10, 2015 7:02 pm

Re: Rane Twelve Mapping for Mixxx

Postby Michael Z Freeman » Thu May 21, 2020 2:07 pm

JosepMa wrote:Possibly, you are expecting midi script response to be very stable. Possibly you need to provide some quantization to value changes or at least a variance higher than some percentage to accept it as a variance.


OK, thanks.

I, or someone, needs to use something like this: https://github.com/dsacre/mididings to analyse the Rane MIDI output from the platter better.
"I heard the sound of the Universe vibrating as one harmonious force."
User avatar
Michael Z Freeman
 
Posts: 94
Joined: Thu Sep 15, 2011 10:02 pm

Re: Rane Twelve Mapping for Mixxx

Postby Be. » Thu May 21, 2020 4:39 pm

I think the distortion of the sine wave is a matter of the poor design of Mixxx's controller system. MIDI timestamps are not taken into account at all and it seems to be anyone's guess what the timing is between scratch messages being processed by the controller thread then getting to the audio thread. So I don't think you'll get great results until we completely reimplement scratching in the new controller system.

I could be wrong though.
Mixxx is free because it's yours!

I heard FLAC and I haven't gone back.
Protect your hearing with earplugs!

Hear my mixes
User avatar
Be.
Mixxx Developer
 
Posts: 2573
Joined: Tue Jan 06, 2015 1:00 am
Location: Chicago, USA


Return to Controller presets/mappings

Who is online

Users browsing this forum: No registered users and 9 guests