Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

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

Moderators: garth, User Customization Moderators

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby mevsme » Thu Apr 20, 2017 2:20 pm

Anyone?
User avatar
mevsme
 
Posts: 118
Joined: Sat Aug 25, 2012 11:29 pm
Location: Ironyland, Toxic city

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby Be. » Thu Apr 27, 2017 2:30 am

According to the MIDI Crash Course wiki page, MIDI pitch bend messages use the second byte as a least significant byte and the third byte as a most significant byte. So, to use the full value in JS:
Code: Select all
CMDPL.rate = function (channel, control, value, status, group) {
    var fullValue = (value << 7) + control;
    engine.setParameter(group, 'rate', fullValue / 16383);
}
I heard FLAC and I haven't gone back.
Protect your hearing with earplugs!
User avatar
Be.
 
Posts: 1702
Joined: Tue Jan 06, 2015 1:00 am
Location: Chicago, USA

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby JosepMa » Thu Apr 27, 2017 7:56 pm

From Mixxxcontrols page ( https://mixxx.org/wiki/doku.php/mixxxcontrols )
rate -1.0..1.0 Speed control Speed slider

In other words, you should be getting a floating value that represents the speed factor that is applied to the audio rate when playing. And instead you get "26". I can only assume that you are setting that 26 somewhere else, which you are not showing it here.

If your controller uses more than 7bits for the rate slider, that necessarily means that it sends it using MSB and LSB.
This means that when you read the value, you have to read two values, not just one.
Edit: As Be said below, MSB/LSB only apply to controls mapped with CC (control change, 0xB0). Those mapped with MIDI Pitch (0xE0) have a single message with the full value, but stored separately as shown in the script.midiPitch() example.

You will find more information about using MSB/LSB on the midi scripting page ( https://mixxx.org/wiki/doku.php/midi_scripting )
(This is a nicer way to write what Be said)
Code: Select all
engine.setValue("[Channel"+deck+"]","rate",script.midiPitch(control, value, status));



I'm not sure if the above is new or old, but I haven't used the "control" parameter for that. My controller sends two different messages:
Code: Select all
                <key>Hercules4Mx.deckRateLsb</key>
                <description>Right Pitch (14bits LSB).</description>
                <status>0xB0</status>
                <midino>0x2B</midino>
-------
                <key>Hercules4Mx.deckRateMsb</key>
                <description>Right Pitch (MSB)</description>
                <status>0xB0</status>
                <midino>0x1D</midino>
--------
//Assume 14bit mode is disabled by default, and enable it on the first lsb detected.
Hercules4Mx.pitch14bitMode = false;
//Array for the MSB bits of pitch change
Hercules4Mx.pitchMsbValue = [0x40, 0x40, 0x40, 0x40];

// Pitch slider rate change, MSB (Most significant bits in 14bit mode, or directly the value in 7bit)
Hercules4Mx.deckRateMsb = function(midichan, control, value, status, group) {
        //Calculating this always, or else the first time will not work
        //(which is precisely when the controller reports the initial positions)
        Hercules4Mx.pitchMsbValue[deck - 1] = value;
        if (Hercules4Mx.pitch14bitMode === false) {
            engine.setValue(group, "rate", script.midiPitch(0,value, 0xE0));
        }
};
// Pitch slider rate change, LSB (Least significant bits in 14bit mode, not called in 7bit)
Hercules4Mx.deckRateLsb = function(midichan, control, value, status, group) {
        var deck = script.deckFromGroup(group);
        var msbval = Hercules4Mx.pitchMsbValue[deck - 1];
        Hercules4Mx.pitch14bitMode = true;
        engine.setValue(group, "rate", script.midiPitch(value,msbval,0xE0));
};



If you don't need to do it with javascript, you can also map it in the XML mapping with fourteen-bit-lsb and fourteen-bit-msb. This is explained in the XML mapping section ( https://mixxx.org/wiki/doku.php/midi_co ... ile_format )
Code: Select all
<options>
    <fourteen-bit-lsb/>
</options>

fourteen-bit-lsb/fourteen-bit-msb: 14-bit (high resolution) MIDI least/most significant byte. Some controls, most often pitch faders, send two MIDI messages so their values can be combined to form 127^2 (16,384) possible values rather than 127 for more precise control. New in 1.12
Last edited by JosepMa on Thu Apr 27, 2017 8:14 pm, edited 3 times in total.
JosepMa
 
Posts: 380
Joined: Sat Oct 10, 2015 7:02 pm

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby Be. » Thu Apr 27, 2017 8:08 pm

MIDI pitch bend messages send both the LSB and MSB in the same MIDI message, unlike 14 bit control change messages that send one message with an LSB as the third byte and another with the MSB as the third byte. So only one input should be needed in the XML file.
I heard FLAC and I haven't gone back.
Protect your hearing with earplugs!
User avatar
Be.
 
Posts: 1702
Joined: Tue Jan 06, 2015 1:00 am
Location: Chicago, USA

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby mevsme » Sat May 06, 2017 6:18 pm

Thanks for replies, I've got the idea.

Can someone explain me the magic in this example expression from the WIKI
Code: Select all
if ((status & 0xF0) === 0x90) {    // If button down
User avatar
mevsme
 
Posts: 118
Joined: Sat Aug 25, 2012 11:29 pm
Location: Ironyland, Toxic city

Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby mevsme » Sun May 07, 2017 9:11 am

I have noticed, that if you map Outputs for a Decks, the volume slider doesn't work. But EQ and Gain works. Is it for purpose? Kinda you need mix and control that with an external mixer, right?

Image
User avatar
mevsme
 
Posts: 118
Joined: Sat Aug 25, 2012 11:29 pm
Location: Ironyland, Toxic city

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby mevsme » Sun May 07, 2017 12:32 pm

After "few years passed" I have been making my mapping, after inventing of few wheels, today I have noticed "Components js", where I discovered a lot of interesting information. I think the link for that should be near the information about common-scripts.js. Maybe I am blind, but it's a feedback from a noob, that tries do something in a first time and didn't know where everything is. Should we move that info? It is not in the right place now. I think it will sit better near helper functions info.
User avatar
mevsme
 
Posts: 118
Joined: Sat Aug 25, 2012 11:29 pm
Location: Ironyland, Toxic city

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby Be. » Sun May 07, 2017 3:17 pm

mevsme wrote:I have noticed, that if you map Outputs for a Decks, the volume slider doesn't work. But EQ and Gain works. Is it for purpose? Kinda you need mix and control that with an external mixer, right?


I don't really understand why the EQs work in that case, because that would be handled by an external mixer. But it makes sense that the deck gain still works because the earlier the gain is set, the better.

mevsme wrote:After "few years passed" I have been making my mapping, after inventing of few wheels, today I have noticed "Components js", where I discovered a lot of interesting information. I think the link for that should be near the information about common-scripts.js. Maybe I am blind, but it's a feedback from a noob, that tries do something in a first time and didn't know where everything is. Should we move that info? It is not in the right place now. I think it will sit better near helper functions info.


Thanks for the feedback. I didn't make the link too obvious yet on purpose because it isn't compatible with Mixxx 2.0. When we finally start 2.1 beta releases I'll think about rearranging the wiki to make it more prominent.
I heard FLAC and I haven't gone back.
Protect your hearing with earplugs!
User avatar
Be.
 
Posts: 1702
Joined: Tue Jan 06, 2015 1:00 am
Location: Chicago, USA

Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby mevsme » Fri May 26, 2017 7:12 am

Hello again :)

One more question: is there any way to change tempo by BPM, e.g. I click "+" button and get 96 > 97 (not 96.86) and change BPM with slider from N.00 to N.99.

I have created an algorythm that relatively changing the tempo with slider button for perfect matching. I know "sync" is perfect for my purposes, but still, if I want to do it manually, I found it very difficult to get round numbers (96, 103, 128) with all that percents (%) in the settings.

Did I miss something about it?

Image
User avatar
mevsme
 
Posts: 118
Joined: Sat Aug 25, 2012 11:29 pm
Location: Ironyland, Toxic city

Re: Behringer CMD Series: PL-1 MM-1 DV-1 DC-1

Postby Be. » Fri May 26, 2017 8:05 am

What's the use of having round numbers for BPMs? 100.2 BPM sounds no better or worse than 100.0 BPM.
I heard FLAC and I haven't gone back.
Protect your hearing with earplugs!
User avatar
Be.
 
Posts: 1702
Joined: Tue Jan 06, 2015 1:00 am
Location: Chicago, USA

PreviousNext

Return to Controller presets/mappings

Who is online

Users browsing this forum: No registered users and 1 guest