Old 10-31-2013, 10:33 PM   #1
Kite
Human being with feelings
 
Join Date: Apr 2010
Location: Portland OR
Posts: 217
Default ReaJS is blocking sysexes generated inside it

Here's my test program, sends a simple sysex on every note-on:

Code:
// MIDI-only effect
in_pin:none
out_pin:none

@init
Sysex = 0;		// starting adress of the array
Sysex [0] = $x7E | 0;	// Universal Non-RealTime Sysex header
Sysex [1] = $x7F | 0;	// device number, 7F = all devices
Sysex [2] = $x06 | 0;	// #61 means device ID request
Sysex [3] = $x01 | 0;

@block

while (midirecv (blockOffset, status, databytes) ? (
   msgNum = status & 240;             			// message # portion of status, times 16
   channelNum = status & 15;				// channels 1-16 are really 0-15
   note = databytes & 127;  		
   velocity = (databytes / 256) | 0;	
   isNoteOnMsg = (msgNum == 9*16) && (velocity > 0);	// 9 = note on
   isNoteOnMsg ? midisyx (blockOffset, Sysex, 4);	// Device ID request
   thisIsWrong = 2 + 2 == 5;
   midisend (blockOffset | 0, (msgNum + channelNum) | 0, databytes | 0);
   1;  // Force while() to loop as long as midirecv() is true
));
The explanation for ThisIsWrong can be found here:
http://forum.cockos.com/showthread.php?t=126776

But that's not the problem. That bug is OS X only, and this bug is with ReaJS, so PC-only. The program works fine if I run it normally. ReaControlMIDI confirms that the sysex is being sent. The problem happens when I run FL Studio and put the test program inside ReaJS. ReaControlMIDI from ReaPlugs is after it to confirm the output. Every sysex is converted to a note-off on channel 1 for note 4 with velocity of 0.

I've also used a real sysex that actually does something and confirmed that what it's supposed to do isn't happening. So the problem isn't ReaControlMIDI.

This problem also happens when I run ReaJS inside Reaper. I realize there's not much point to running ReaJS inside Reaper, but this is an easy way for people to test the bug. In Reaper, if I run the test program normally and put ReaJS after it with something loaded in it, and then put ReaControlMIDI after that, there's no problem. So ReaJS seems to only screw up sysexes that originate inside it. It seems to pass through sysexes from outside it fine.

I wrote another test program that just sends a sysex whenever a slider is moved. Same result, ReaJS converts each sysex to a note-off on channel 1. The note number of the note-off corresponds exactly to the sysex length:

Code:
// MIDI-only effect
in_pin:none
out_pin:none

slider1: 1 <1, 512, 1> sysex length
slider2: 1 <1, 512, 1> sysex location

@init
sendSysex = 0;
Sysex = 0;		// starting adress of the array
Sysex [0] = $x7E | 0;	// Universal Non-RealTime Sysex header
Sysex [1] = $x7F | 0;	// device number, 7F = all devices
Sysex [2] = $x06 | 0;	// #61 means device ID request
Sysex [3] = $x01 | 0;

@slider
sendSysex = 1;

@block
sendSysex ? (
   sendSysex = 0;
   midisyx (0, slider2, slider1);
   thisIsWrong = 2 + 2 == 5;
);
Moving slider2 doesn't change anything. Moving slider1 increases the note number clear up to 255, then wraps around to zero and bumps the note-off velocity up to 1, etc.

This bug is a MAJOR bummer for me! Can anyone confirm it or suggest fixes? I'm using FL Studio 11.0.3 demo version and Reaper 4.54 on a windows 7 laptop.
Kite is offline   Reply With Quote
Old 10-31-2013, 11:29 PM   #2
Kite
Human being with feelings
 
Join Date: Apr 2010
Location: Portland OR
Posts: 217
Default

I just remembered, FL Studio doesn't handle sysexes very well. It will send them out from VSTs but any VSTs it hosts won't receive them. That could explain why ReaControlMIDI doesn't see the sysex. But it doesn't explain the weird note-off messages or the way ReaJS acts in Reaper.

I don't have any other DAWS on my windows machine to test this with except Abelton Live. That one is worse for sysexes, just strips them out completely. I ran both test programs in Live and got neither sysexes nor weird note-offs.

Does anyone have a sysex-friendly DAW on their PC to test this with?

It seems that ReaJS converts midisys(a,b,c) to midisend(a,$x80,c)
Kite is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 09:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.