[Advanced] MIDI Scripting

Everything about FutureDecks Pro. (wish list, community skins, skindesigner)

Re: [Advanced] MIDI Scripting

Postby Xenobase » Mon May 21, 2012 8:23 am

Hmm, most likely your controller does not support SysEx or something else is wrong. Either way you could do a quick workaround: In FutureDecks Dj Pro, go to the settings menu (cogwheel or "cfg" button). Go to the "Audio & Midi" tab.
Under "Select Midi IN devices" you will see the name of your controller. Use that name in the getSupportedMidiDeviceNameForInput(osId) function. (return "controllername"; // spaces are allowed).
This will load the script when FutureDecks detects the controller :)
User avatar
Xenobase
Volunteer Moderator
 
Posts: 570
Joined: Tue Jun 17, 2008 1:07 pm
Location: The Netherlands

Re: [Advanced] MIDI Scripting

Postby momogtone » Tue May 22, 2012 3:20 am

hello, my script is almost ready, I would like to know if any notification to leave the LED on if this synchronized tracks, and if they are not, it flashes the LED, for which I now hold the notice "onbeat" but only shows the VELOCITY of the beat.
and any action to use a button like the "enter" key on the keyboard
thank you very much for the support!

PS: At the end I'll upload the script so that it can use to create another, or modify!
User avatar
momogtone
 
Posts: 13
Joined: Tue Dec 21, 2010 7:18 am

Re: [Advanced] MIDI Scripting

Postby Xenobase » Thu May 24, 2012 8:10 am

There is no way to see if two tracks are out of sync (other then visually comparing the onbeat LEDs).
When you hit sync it is only a matter of seconds for two tracks to get out of sync. What you could do:
If the sync button is pressed, turn on the specific LED. Then you could try using the timerTick function to increase a variable with 1 each time timerTick(see other midi scripts) is called. If the variable reaches a certain point you switch to onbeat or you turn the specific LED on/off manually.

As far as I know there isn't an "enter" button which you can midi script. What should the "enter" button do?
User avatar
Xenobase
Volunteer Moderator
 
Posts: 570
Joined: Tue Jun 17, 2008 1:07 pm
Location: The Netherlands

Re: [Advanced] MIDI Scripting

Postby momogtone » Wed Aug 01, 2012 12:51 am

Hello, I was away from here for college and stuff, but I leave my script here for DN-HC1000S
Code: Select all
//-------------------------
//-------- by M0M0 --------
//-------------------------
// for MIDI controller 'Denon HC1000S'
//------------------------------------
function getLanguageVersion()
{
   return 1;
}
function getFileVersion()
{
   return 1;
}
function getControllerUserFriendlyName()
{
   return "DN-HC1000S";
}
function getControllerType()
{
   return 'midi';
}
function getSupportedMidiSysExIdString(osId)
{
   return false;
}
function getSupportedMidiDeviceNameForInput(osId)
{
   return "DN-HC1000S";
}
function getSupportedMidiDeviceNameForOutput(osId)
{
   return false;
}
function getSupportedHidDeviceVID(osId)
{
   return false;
}
function getSupportedHidDevicePID(osId)
{
   return false;
}
function getSupportedHidDeviceName(osId)
{
   return false;
}
function controllerInit(uniqueId)
{
   debug('controllerInit DN-HC1000S ['+uniqueId+']');
}
//-----------------------------------------------------------------------------

function controllerDeinit(uniqueId)
{
   debug('controllerDeinit DN-HC1000S ['+uniqueId+']');
}   

function messageReceived(uniqueId,status,channel,data1,data2)
{
   var messageNotProcessed=false;
   switch(status)
   {
   
   
   case 0xB0:
      switch(data1)
      {
      // global
      case 0x54: call('lbMoveCursor', data2==0x7F ? -1:1); break; //library curser up down      

      case 0x5A: call('setDeckCutoff', data2==0x7F); break; //filter

      default: messageNotProcessed = true;
      }
      break;
      
      
   case 0x80:
   case 0x90:
      if(status==0x90) data2 = 0x40;
      if(status==0x80) data2 = 0;
      switch(channel)
      {
         // program 1
         case 0:
         
         
         
         switch(data1)
         {
         
         //global
         
         case 0x30: call('lbToggleSelect', 0, data2); break;
      
   
         // deck A
         case 0x45: call('deckCue', 0, data2); break;
         case 0x1D: call('deckPlayPause', 0, data2); break;
         case 0x37: call('deckLoopInEnd', 0, data2); break;
         case 0x07: call('deckSync', 0, data2); break;
         case 0x39: call('deckLoopExit', 0, data2); break;
         case 0x0D: call('deckLoopPrev', 0, data2); break;
         case 0x0C: call('deckLoopNext', 0, data2); break;
         case 0x17: call('deckCuePos1', 0, data2); break;
          case 0x18: call('deckCuePos2', 0, data2); break;
          case 0x19: call('deckCuePos3', 0, data2); break;
         case 0x20: call('deckCuePos4', 0, data2); break;
         case 0x21: call('deckCuePos5', 0, data2); break;
          case 0x11: call('deckBendDown', 0, data2); break;
          case 0x10: call('deckBendUp', 0, data2); break;
         case 0x40: call('deckLoopMore', 0, data2); break;
         case 0x62: call('deckLoadNext', 0, data2); break;
         case 0x64: call('deckAnalogIn', 0, data2); break;
         case 0x65: call('deckTimecodeIn', 0, data2); break;
         
         case 0x61: call('deckEqLowKill', 0, data2); break;
         case 0x06: call('deckKeyLock', 0, data2); break;
         
         
         // deck B
         case 0x7E: call('deckCue', 1, data2); break;
         case 0x7A: call('deckPlayPause', 1, data2); break;
         case 0x5F: call('deckSync', 1, data2); break;
         case 0x7B: call('deckLoopInEnd', 1, data2); break;
         case 0x7C: call('deckLoopExit', 1, data2); break;
         case 0x71: call('deckLoopPrev', 1, data2); break;
         case 0x70: call('deckLoopNext', 1, data2); break;
         case 0x75: call('deckCuePos1', 1, data2); break;
          case 0x76: call('deckCuePos2', 1, data2); break;
          case 0x77: call('deckCuePos3', 1, data2); break;
            case 0x78: call('deckCuePos4', 1, data2); break;
            case 0x79: call('deckCuePos5', 1, data2); break;         
          case 0x73: call('deckBendDown', 1, data2); break;
          case 0x72: call('deckBendUp', 1, data2); break;
         case 0x7D: call('deckLoopMore', 1, data2); break;
         case 0x63: call('deckLoadNext', 1, data2); break;
         case 0x66: call('deckAnalogIn', 1, data2); break;
         case 0x67: call('deckTimecodeIn', 1, data2); break;
         
         
         case 0x7F: call('deckEqLowKill', 1, data2); break;
         case 0x5E: call('deckKeyLock', 1, data2); break;
         
                        
         default: messageNotProcessed = true;
         }
         break;
         
         
      }
   //-----------------------------------------------
   default: messageNotProcessed = true;
   }
   if(messageNotProcessed) debug('messageReceived ['+uniqueId+'] - status:'+status+' channel:'+channel+' data1:'+data1+' data2:'+data2);
   return !messageNotProcessed;
}
//-----------------------------------------------------------------------------
// this is called by the software whenever something important changes (eg. play status, song changed, etc)
// depending on the notification type it may refer to a global event (deck is -1) or a specific deck (deck >= 0)
// and can contain any/all of the parameters: param 1 is an integer, param 2 is a float, param 3 is a string
function notificationReceived(uniqueId,name,deck,param1,param2,param3)
{
   
   //Deck a
   
      if(name=='play')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x2B);
      if(name=='onbeat')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x09);
      if(name=='cuepos1')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x11);
      if(name=='cuepos2')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x13);
      if(name=='cuepos3')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x15);
      if(name=='cuepos4')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x17);
      if(name=='cuepos5')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x19);
      if(name=='loopIn')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x24);
      if(name=='looping')         sendMidi(uniqueId,0xB0,deck==1,(param1 ? 0x4A : 0x4B), 0x40);
      
   //Decb b
   
      if(name=='play')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x6F);
      if(name=='onbeat')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x60);
      if(name=='cuepos1')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x61);
      if(name=='cuepos2')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x63);
      if(name=='cuepos3')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x65);
      if(name=='cuepos4')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x67);
      if(name=='cuepos5')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x69);
      if(name=='loopIn')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x6B);
      if(name=='looping')         sendMidi(uniqueId,0xB0,deck==0,(param1 ? 0x4A : 0x4B), 0x6D);
      

}
function timerTick(uniqueId)
{
//for(var i=0; i<2; i++)
   //debug('timerTick ['+uniqueId+']');
}


It's everything I need, just be on the list, I cant select the track to be the next to play, do not know if that option exists, it would be very helpful Greetings!
only option is that as a shortcut, and being on the track, just a matter of pressing "enter" to be set a next song.


Thanks!
User avatar
momogtone
 
Posts: 13
Joined: Tue Dec 21, 2010 7:18 am

Re: [Advanced] MIDI Scripting

Postby Chris » Mon Aug 06, 2012 6:06 pm

Thanks for the script, momogtone :D.

Unfortunately, we can't test it properly as we don't have the Denon HC-1000s here. However, the software seems to recognize the script, so that's good.

We really appreciate this.

Also, it would be nice if you could send us, in your own spare time, some feedback as to how the controller works with FDDJ pro.
(a video would be much easier).

In any case, thanks again and have a nice day, momo.
User avatar
Chris
Developer
 
Posts: 120
Joined: Thu Nov 11, 2010 5:14 pm

Re: [Advanced] MIDI Scripting

Postby DJ MaMo » Fri Nov 02, 2012 10:30 pm

Hello to all,

sorry for my bad english i am from germany. I need help! I bought a Gemini CNTRL-2 and tried it on my best friends software. He has yours in PRO edition. But when i put it in so the controller make a short test like in the Virtual DJ LE software which is included.

But then the controller stays still and no function works. The LEDs are lighning with no sense order. My friend means we need a MIDI-Mapping for it. Also we tried the LEARN function but it didnt work.

I need your help. I am a newbie and try to begin with lower equipment.

Greetings from germany.
DJ MaMo
 
Posts: 1
Joined: Fri Nov 02, 2012 9:56 pm

Re: [Advanced] MIDI Scripting

Postby Chris » Tue Nov 06, 2012 4:47 pm

Hello DJ MaMo,

Great to hear from you.

Yes, your friend is correct. You need a MIDI script for your Gemini CNTRL-2 controller. Unfortunately, we haven't had any controllers from Gemini so far...so we don't have a script to send you.

We spoke to the guys from Gemini and they should be sending us some of their controllers in the early start of 2013. For now, we can't give you any other solution other than using the Learn function of FutureDecks DJ pro to assign any button/knob/slider of your Gemini controller to the interface of our software.

I'll be sending you a message if we can think of any other solution. However, until we get our hands on the actual controller, we can't promise anything.

Hope this helps. Have a great day.
User avatar
Chris
Developer
 
Posts: 120
Joined: Thu Nov 11, 2010 5:14 pm

Re: [Advanced] MIDI Scripting

Postby vim » Fri May 31, 2013 10:03 am

You can find ALL the actions/notifications/values in the wiki:
http://xylio.com/wiki/index.php?title=Scripting_actions_and_notifications_(list)

The wiki will be the only place that will be up-to-date.
User avatar
vim
Developer
 
Posts: 796
Joined: Tue Aug 02, 2005 8:30 pm

Previous

Return to FutureDecks DJ pro

Who is online

Users browsing this forum: No registered users and 6 guests

cron