SOLVED midi command 254 0 0 fe 00 00

Post Reply New Topic
RELATED
PRODUCTS

Post

HI can anyone please help me figure out why my script is doing this?
----
Is there something wrong with my script?

Code: Select all

loadAPI(2);
host.setShouldFailOnDeprecatedUse(true);

host.defineController("Yamaha", "Montage", "1.0", "035d4fe0-1a0f-11ea-aaef-0800200c9a66");
host.defineMidiPorts(1, 1);
host.setShouldFailOnDeprecatedUse(true);

var LOWEST_CC = 1;
var HIGHEST_CC = 119;

var DEVICE_START_CC = 20;
var DEVICE_END_CC = 27;

function init()
{
  midiIn = host.getMidiInPort(0);
  midiIn.setMidiCallback(onMidi);
  midiIn.setSysexCallback(onSysex);
  allChannels = midiIn.createNoteInput("All Channels", "??????");
  allChannels.setShouldConsumeEvents(false);

  for (var i = 0; i < 16; i++)
  {
      midiIn.createNoteInput("Channel " + (i + 1), "?" + i.toString(16) + "????");
  }

  transport = host.createTransport();

                // Map CC 20 - 28 to device parameters

                cursorTrack = host.createCursorTrack(3, 0);
                cursorDevice = cursorTrack.createCursorDevice();
                remoteControls = cursorDevice.createCursorRemoteControlsPage(8);

                for ( var i = 0; i < 8; i++)
                {
                                var p = remoteControls.getParameter(i).getAmount();
                                p.setIndication(true);
                                p.setLabel("P" + (i + 1));
                }

                // Make the rest freely mappable
                userControls = host.createUserControls(HIGHEST_CC - LOWEST_CC + 1 - 8);

                for ( var i = LOWEST_CC; i < HIGHEST_CC; i++)
                {
                                if (!isInDeviceParametersRange(i))
                                {
                                                var index = userIndexFromCC(i);
                                                userControls.getControl(index).setLabel("CC" + i);
                                }
                }
}

function isInDeviceParametersRange(cc)
{
                return cc >= DEVICE_START_CC && cc <= DEVICE_END_CC;
}

function userIndexFromCC(cc)
{
                if (cc > DEVICE_END_CC)
                {
                                return cc - LOWEST_CC - 8;
                }

                return cc - LOWEST_CC;
}

function onMidi(status, data1, data2)
{
                if (isChannelController(status))
                {
                                if (isInDeviceParametersRange(data1))
                                {
                                                var index = data1 - DEVICE_START_CC;
                                                remoteControls.getParameter(index).getAmount().value().set(data2, 128);
                                }
                                else if (data1 >= LOWEST_CC && data1 <= HIGHEST_CC)
                                {
                                                var index = userIndexFromCC(data1);
                                                userControls.getControl(index).value().set(data2, 128);
                                }
                }
                printMidi(status, data1, data2);
}

function onSysex(data) {
   // MMC Transport Controls:
   switch (data) {
      case "f07f7f0605f7":
         transport.rewind();
         break;
      case "f07f7f0604f7":
         transport.fastForward();
         break;
      case "f07f7f0601f7":
         transport.stop();
         break;
      case "f07f7f0602f7":
         transport.play();
         break;
      case "f07f7f0606f7":
         transport.record();
         break;
   }
}


function exit()
{
}
Last edited by xtreme sounds on Mon May 10, 2021 5:11 pm, edited 2 times in total.

Post

Code: Select all

loadAPI(2);
host.setShouldFailOnDeprecatedUse(true);

host.defineController("Yamaha", "Montage", "1.0", "035d4fe0-1a0f-11ea-aaef-0800200c9a66");
host.defineMidiPorts(1, 1);
host.setShouldFailOnDeprecatedUse(true);

var LOWEST_CC = 1;
var HIGHEST_CC = 119;

var DEVICE_START_CC = 20;
var DEVICE_END_CC = 27;

function init()
{
  midiIn = host.getMidiInPort(0);
  midiIn.setMidiCallback(onMidi);
  midiIn.setSysexCallback(onSysex);
  allChannels = midiIn.createNoteInput("All Channels", "??????");
  allChannels.setShouldConsumeEvents(false);

  for (var i = 0; i < 16; i++)
  {
      midiIn.createNoteInput("Channel " + (i + 1), "?" + i.toString(16) + "????");
  }

  transport = host.createTransport();

                // Map CC 20 - 28 to device parameters

                cursorTrack = host.createCursorTrack(3, 0);
                cursorDevice = cursorTrack.createCursorDevice();
                remoteControls = cursorDevice.createCursorRemoteControlsPage(8);

                for ( var i = 0; i < 8; i++)
                {
                                var p = remoteControls.getParameter(i).getAmount();
                                p.setIndication(true);
                                p.setLabel("P" + (i + 1));
                }

                // Make the rest freely mappable
                userControls = host.createUserControls(HIGHEST_CC - LOWEST_CC + 1 -8);

                for ( var i = LOWEST_CC; i < HIGHEST_CC; i++)
                {
                                if (!isInDeviceParametersRange(i))
                                {
                                                var index = userIndexFromCC(i);
                                                userControls.getControl(index).setLabel("CC" + i);
                                }
                }
}

function isInDeviceParametersRange(cc)
{
                return cc >= DEVICE_START_CC && cc <= DEVICE_END_CC;
}

function userIndexFromCC(cc)
{
                if (cc > DEVICE_END_CC)
                {
                                return cc - LOWEST_CC - 8;
                }

                return cc - LOWEST_CC;
}

function onMidi(status, data1, data2)
{
                if (isChannelController(status))
                {
                                if (isInDeviceParametersRange(data1))
                                {
                                                var index = data1 - DEVICE_START_CC;
                                                remoteControls.getParameter(index).getAmount().value().set(data2, 128);
                                }
                                else if (data1 >= LOWEST_CC && data1 <= HIGHEST_CC)
                                {
                                                var index = userIndexFromCC(data1);
                                                userControls.getControl(index).value().set(data2, 128);
                                }
                }
                printMidi(status, data1, data2);
}

function onSysex(data) {
   // MMC Transport Controls:
   switch (data) {
      case "f07f7f0605f7":
         transport.rewind();
         break;
      case "f07f7f0604f7":
         transport.fastForward();
         break;
      case "f07f7f0601f7":
         transport.stop();
         break;
      case "f07f7f0602f7":
         transport.play();
         break;
      case "f07f7f0606f7":
         transport.record();
         break;
   }
}

function exit()
{
}
Bitwig 5.1.6 + Akai MIDIMix + Launchpad X + MuLab 9.3.18
Roli Lumi Keyboard x 2 + Universal Audio Apollo Twin X
Mac Mini M1 16GB/4TB + macOS 14.4 Sonoma

Post

anyone have any idea? Heres the message in the controller script debugger. It just keeps repeating it no matter what project I load.
You do not have the required permissions to view the files attached to this post.

Post

0xFE status byte is active sense. This is almost certainly coming from your MIDI device. You can read up on it in the MIDI spec or just search online.

Post

Thanks I looked in the manual and nothing is there about a 254 value

Post

melodyz wrote: Sat May 08, 2021 12:48 am Thanks I looked in the manual and nothing is there about a 254 value
https://www.midi.org/specifications

Post

My experience
This is common with premium Yamaha keyboard (mo8 here)
Most DAW ignore (but for monitor display)
On PC I use Midi Ox and virtual ports to filter from sight.

Post

Yamaha told me it is sysex message for active sensing that is always on as well.

Post Reply

Return to “Controller Scripting”