11-15-2017, 07:30 PM | #41 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
|
11-15-2017, 10:45 PM | #42 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Quote:
-Michael |
|
11-15-2017, 10:48 PM | #43 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
As you see we need to open up the scripting Forum ("JSFX and ReaScript") for OSCiibot scripting issues by changing its Title appropriately ("JSFX, ReaScript and OSCIIbot-Script Discussion")!
-Michael |
11-15-2017, 11:33 PM | #44 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
https://forum.cockos.com/forumdisplay.php?f=50 |
|
11-16-2017, 05:05 AM | #45 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
|
11-16-2017, 05:36 AM | #46 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
CC messages are from the button that I've used to initiate sysex message. The original string is "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\ x04\x01\x09\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x3 2\x00\x01\x09\x03\x04\x20\x20\x20\x31\x00\x01\x12\ x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x33\x00\x01\x1 2\x03\x04\x20\x20\x20\x4F\x4E\x00\xF7" Seems like oscii-bot converts string into DEC format. |
|
11-16-2017, 06:00 AM | #47 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
I think you might just have midi-ox configured to display decimal at the moment? options/data display/hex
|
11-16-2017, 06:14 AM | #48 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
UPD. LCD flickers for a fraction of the second when sysex is sent for the first time, but the info stays the same "Automap is offline". The controller might be waiting for some "online" message", but the thing is that the very same message changes the text on the LCD when sent via midi-ox. |
|
11-16-2017, 06:29 AM | #49 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
MIDI-OX:
oscii-bot: I don't get it. |
11-16-2017, 06:34 AM | #50 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Looks like the sysex is being sent properly. I can't say why the controller isn't responding to it. Perhaps because it's being sent multiple times?
|
11-16-2017, 06:50 AM | #51 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
No, it's not. The last screenshot is from oscii-bot. Nothing is sent. Only the button is pressed and unpressed.
I've tested it again, a couple of times. Only sysex from midi-ox changes text on the controller and outputs sysex to monitor. I must've done something wrong when taking screenshots and posted midi-ox output results as oscii-bot's, while changing output from dec to hex. |
11-16-2017, 06:58 AM | #52 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
I can confirm that oscii-bot sysex send works properly here. I assume you have confirmed that you can send a regular 3-byte MIDI message fro oscii-bot in response to the same input?
Actually, your input test is a odd both in its structure and that it's mixing hex and decimal. "msg1 == 0xbf ? (msg2 == 40 && msg3 == 0)" is equivalent to "msg1 == 0xbf && msg2 == 0x28 && msg3 == 00)", which would be a balance LSB message on channel 15. Did you perhaps mean 0x40, sustain pedal? And do you really mean channel 15? |
11-16-2017, 07:19 AM | #53 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
This button, if it's important: oscii-bot can use both hex and dec values. I've seen it in many scripts, including sample_script.txt that comes with oscii-bot: Code:
msg1 == 0x90 ? ( msg2 == 0x5b ? oscsend(destdevice, "b/rewind", msg3>64); msg2 == 0x5c ? oscsend(destdevice, "b/forward", msg3>64); msg3>64 ? ( fmt0 = (msg2&7) + 1; msg2 < 8 ? oscsend(destdevice, "t/track/%.0f/recarm/toggle", 0) : msg2 < 16 ? oscsend(destdevice, "t/track/%.0f/solo/toggle", 0) : msg2 < 24 ? oscsend(destdevice, "t/track/%.0f/mute/toggle", 0) : ( msg2 == 0x5e ? oscsend(destdevice, "b/play", 1); msg2 == 0x5d ? oscsend(destdevice, "b/stop", 1); msg2 == 0x5f ? oscsend(destdevice, "b/record", 1); ) ); ); Code:
@input midi_in MIDI "MIDIIN3 (SL MkII)" // @output midi_out MIDI "loopMIDI Port" @output midi_out MIDI "MIDIOUT3 (SL MkII)" @init @timer @oscmsg @midimsg msg1 == 0xBF ? ( sysexMsg = "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\x04\x01\x09\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x32\x00\x01\x09\x03\x04\x20\x20\x20\x31\x00\x01\x12\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x33\x00\x01\x12\x03\x04\x20\x20\x20\x4F\x4E\x00\xF7"; msg2 == 0x29 && msg3 > 0x00 ? ( midisend_str(midi_out, sysexMsg); printf("Button was pressed \n"); ); ); midi-ox window: P.S. Tested. Yes, I can send regular 3-byte messages with the same code. Tested it with LED light of one button. UPD. What if midisend_str sends sysex to channel 1(0) by default, while I need it to be at channel 16(15)? But, as far as I know, sysex doesn't need midi channel. Last edited by fundorin; 11-16-2017 at 07:41 AM. |
|
11-16-2017, 08:26 AM | #54 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Quote:
-Michael Last edited by mschnell; 11-16-2017 at 08:31 AM. |
|
11-16-2017, 08:36 AM | #55 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
There's been only 17 threads in oscii-bot forum for the last 4 years. No need to diffuse it across the whole reaper forum.
|
11-16-2017, 08:39 AM | #56 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
Do me a favor, try sending a shorter sysex message, of say 32 bytes, just to see if that works?
|
11-16-2017, 09:06 AM | #57 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
oscii-bot is sending sysex (input/output in both midi-ox and oscii-bot are set to Novation) nothing midi-ox is sending sysex (input/output in both midi-ox and oscii-bot are set to Novation) Then, I've changed oscii-bot output to loopmidi. Midi input in midi-ox also to loopmidi. osciibot: input - Novation. output - loopmidi. midi-ox: input - loopmidi. output - loopmidi. |
|
11-16-2017, 09:11 AM | #58 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
So, to be clear, the 14-byte message generated by oscii-bot is being received by midi-ox?
If so, can you then try a 48-byte message, then a 49-byte message? Just for avoidance of doubt, please don't put any zeros in the message (no "\x00"). Here is a 48-byte message: Code:
"\xF0\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\xF7" Code:
"\xF0\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\xF7" |
11-16-2017, 09:27 AM | #59 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Just as before, oscii-bot output is set to loopmidi. midi-ox in/out is also loopmidi.
48: 49: switching all in/outs in both oscii-bot to Novation and midi-ox leads to empty monitor windows, except that CC 29 message, generated by pressing physical button on the controller. Code:
@input midi_in MIDI "MIDIIN3 (SL MkII)" // @output midi_out MIDI "loopMIDI Port" @output midi_out MIDI "MIDIOUT3 (SL MkII)" @init @timer @oscmsg @midimsg msg1 == 0xBF ? ( // sysexMsg = "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\x04\x01\x09\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x32\x00\x01\x09\x03\x04\x20\x20\x20\x31\x00\x01\x12\x01\x04\x42\x75\x74\x74\x6F\x6E\x20\x33\x00\x01\x12\x03\x04\x20\x20\x20\x4F\x4E\x00\xF7"; // sysexMsg = "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\x04\xF7"; // sysexMsg ="\xF0\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\xF7"; sysexMsg = "\xF0\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x01\x02\xF7"; msg2 == 0x29 && msg3 > 0x00 ? ( midisend_str(midi_out, sysexMsg); printf("Button was pressed \n"); // msg1=0xbf; msg2=0x30; msg3=0x01; midisend(midi_out); // msg1=0xbf; msg2=0x30; msg3=0x00; midisend(midi_out); ); ); |
11-16-2017, 09:30 AM | #60 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
So those messages send, but your 59-byte message doesn't?
|
11-16-2017, 09:34 AM | #61 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
|
11-16-2017, 09:38 AM | #62 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
OK! Se we can confirm oscii-bot is properly sending a 59-byte MIDI message to the world. For some reason your physical MIDI device is not responding to that message the way you expect it to, but I think we can rule out an oscii-bot bug, right?
|
11-16-2017, 09:48 AM | #63 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
For example: |
|
11-16-2017, 10:03 AM | #64 |
Administrator
Join Date: Mar 2007
Location: NY
Posts: 15,821
|
You know oscii-bot can send a sysex message to an external output (loopbe, in this case). From oscii-bot's perspective, there is no difference between external outputs, the interface is the same regardless of the destination. So I think the problem is outside of oscii-bot.
|
11-16-2017, 10:21 AM | #65 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
I had some progress, so, I think, you might be right. Thanks for your help.
Sending sysex from oscii-bot is working when the command is placed into @init section of the script. Tried with "automap online" command and "schwa rules!" text, sent one by another. If the same commands were initiated by physical button of the controller, nothing happens. I suspect that's because the controller thinks that Automap software if offline and doesn't display the text. So, the trouble was with physical input. I'm pretty sure that the command would be displayed properly if initiated by an osc message from Reaper, for example. Also found out, that this happens only when faders or top row of the buttons were pressed at the right side of the controller. Everything is fine when using any control from the left side. Makes me feel that this is somehow connected with the fact that SL MkII has only one LCD on the left side, while older models had two LCDs, for each side. Last edited by fundorin; 11-16-2017 at 10:47 AM. |
11-16-2017, 02:22 PM | #66 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
I was sitting and thinking, why I'm always getting that "Automap is offline" message. Mostly, when touching controls on the right side of the surface.
Then it hit me! Because previous versions had two LCDs and MkII has only one, info that should be displayed on different screens, displayed at that single one, according two which control is touched by user. When I've displayed "schwa rules!" on, let's say, "virtual" left screen, "virtual" right screen left intact and it had that "Automap is offline" text on it. It was just a text. So, I just changed the initial sysex message from "clear entire left LCD" to "clear both LCDs" and, voila, one "virtual" screen now have text and the other one is blank. Now I can write some useful info on LCDs, depending on which half of the surface that info is related to or just duplicate everything on both "virtual" screens. Finally! �� Last edited by fundorin; 11-16-2017 at 02:27 PM. |
11-16-2017, 04:12 PM | #67 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Is it possible to use timers for detecting momentary and toggle presses of the single button? Couldn't find anything realted in the manual.
|
11-16-2017, 10:27 PM | #68 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Quote:
set a counter to a timeout constant to start the timer and do Code:
@timer counter ? ( counter -= 1; !counter ? ( //do some action ); ); -Michael |
|
11-17-2017, 06:25 AM | #69 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
I did the same timing tricks when programming Arduino. Thought that EEL2 allowed more interesting methods.
Seems like the best way would be to adapt those Arduino tricks to EEL2 timer function for my needs. Thanks. Another noob question: how to convert variables into strings to be able to print them to the log? In short, any type of data into one another. I found sprintf function but without small examples in the manual it's hard for me to understand how to use it. Last edited by fundorin; 11-17-2017 at 06:40 AM. |
11-17-2017, 06:52 AM | #70 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
EEL only has two types of data: Floating point ans string.
to print a string variable in printf you would use %s, real variable are formatted according to the format specifier such a %i or %f. -Michael |
11-17-2017, 06:54 AM | #71 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Do we have switch/break function analog in EEL2?
No mention in the manual about it either. P.S. I miss Lua. 😢 |
11-17-2017, 01:34 PM | #72 |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
|
11-17-2017, 01:36 PM | #73 | |
Administrator
Join Date: Jan 2005
Location: NYC
Posts: 15,746
|
Quote:
Code:
strcpy(#somestring,"hello world"); printf("This is an integer: %d\nThis is a float: %f\n"This is a string: %s or %s\n", 1, 1.5, "some literal string", #somestring); |
|
11-17-2017, 01:37 PM | #74 |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
I kinda repeating the same process of discoveries, while writing script again.
And, again, I have the same question: is it possible to set volume/pan control to soft pickup? It's important to have such option when the surface doesn't have motorized faders. What I did earlier is used actions, like "Track: Set volume for track 01 (MIDI CC/OSC only)" instead of .reaperOSC command "TRACK_VOLUME n/track/@/volume" I wonder if it's possible to set specific osc commands to act like soft pickup? |
11-17-2017, 02:46 PM | #75 | |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Quote:
-Michael |
|
11-17-2017, 02:53 PM | #76 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
IMHO no problem at all. Doing
Code:
a==1 ? ( ... ) : a == 2 ? ( ... ) : a == 3 ? ( ... ) : a == 4 ? ( ... ) : a == 5 ? ( ... ); If "a" contains an integer, the "switch" code could be optimized to use a calculated jump. But if "a" is a string (and the compare would us match() ) this would not be possible, either. -Michael Last edited by mschnell; 11-17-2017 at 11:36 PM. |
11-17-2017, 02:55 PM | #77 |
Human being with feelings
Join Date: Feb 2016
Posts: 189
|
Michael's soft takeover solution (post #88) is not really needed, but it could be made to work. But it adds to the complexity by adding state into the control surface
Instead look at the latest version of the Akai MIDIMIX control surface for what is possible with soft takeover, where Reaper does it for you. It includes use of - those actions in reaper like track volume and pan that have a soft takeover variant and - "generic OSC string" named knobs that can be mapped to any Reaper value by the user using Reaper learning again with soft takeover Last edited by goldenarpharazon; 11-17-2017 at 03:04 PM. |
11-17-2017, 11:32 PM | #78 |
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
Just for my info: What you describe, is this enabled by a feature of Reapers' or of the MIDIMIX ?
-Michael |
11-18-2017, 05:41 AM | #79 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
Quote:
Last edited by fundorin; 11-18-2017 at 07:02 AM. |
|
11-18-2017, 08:28 AM | #80 | |
Banned
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
|
I have another question:
This is the code that controls tracks volume with faders (adapted from midimix script): Code:
msg1 == $xBF ? // Control Change - so must be a knob or a slider (fader) moving ( // VOLUME SLIDERS msg2 == slSlider1 ? ( send_soft_fader(1); ); msg2 == slSlider2 ? ( send_soft_fader(2); ); msg2 == slSlider3 ? ( send_soft_fader(3); ); msg2 == slSlider4 ? ( send_soft_fader(4); ); msg2 == slSlider5 ? ( send_soft_fader(5); ); msg2 == slSlider6 ? ( send_soft_fader(6); ); msg2 == slSlider7 ? ( send_soft_fader(7); ); msg2 == slSlider8 ? ( send_soft_fader(8); ); Is it possible to do something similar in oscii-bot, using some kind of concatenation and iteration, like fader_variable_name = ("slSlider" + i);? UPD. Tried using the following method from the manual for declaring variables. Didn't work for me: Quote:
Code:
slSlider[1] = 16; msg2 == slSlider[1] ? ( send_soft_fader(1); ); Last edited by fundorin; 11-18-2017 at 09:48 AM. |
|
Thread Tools | |
Display Modes | |
|
|