Old 11-15-2017, 07:30 PM   #41
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by Veto View Post
I could be wrong but you seem to have no connection to MIDIIN3 and MIDIOUT3.
Everything's fine. Oscii-bot was launched while the controller was turned off, but, as you can see in the log, oscii-bot can reopen ports after the controller is discovered.
fundorin is offline   Reply With Quote
Old 11-15-2017, 10:45 PM   #42
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Quote:
Originally Posted by Veto View Post
If you want to printf the sysex you need to escape "" by another "". Thats how it works in C at least.
As Sysex is binary you would need to manually do a binary -> hex conversion to print an arbitrary Sysex string in the log.

-Michael
mschnell is online now   Reply With Quote
Old 11-15-2017, 10:48 PM   #43
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

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
mschnell is online now   Reply With Quote
Old 11-15-2017, 11:33 PM   #44
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by mschnell View Post
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
This one isn't enough for you?
https://forum.cockos.com/forumdisplay.php?f=50
fundorin is offline   Reply With Quote
Old 11-16-2017, 05:05 AM   #45
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

Quote:
Originally Posted by fundorin View Post
Nope. No changes on the LCD. At least, random LEDs stopped to light up.
Sending the same sysex via midi-ox still working.
What does midi-ox report when you send the sysex string, in the form "\xF0...", via osciibot?
schwa is offline   Reply With Quote
Old 11-16-2017, 05:36 AM   #46
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
What does midi-ox report when you send the sysex string, in the form "\xF0...", via osciibot?


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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 06:00 AM   #47
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

I think you might just have midi-ox configured to display decimal at the moment? options/data display/hex
schwa is offline   Reply With Quote
Old 11-16-2017, 06:14 AM   #48
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
I think you might just have midi-ox configured to display decimal at the moment? options/data display/hex
Set it to hex. Now shows right, but nothing is happening on LCD of the controller. Will try experimenting further.


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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 06:29 AM   #49
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

MIDI-OX:



oscii-bot:

I don't get it.
fundorin is offline   Reply With Quote
Old 11-16-2017, 06:34 AM   #50
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

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?
schwa is offline   Reply With Quote
Old 11-16-2017, 06:50 AM   #51
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
Looks like the sysex is being sent properly.
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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 06:58 AM   #52
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

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?
schwa is offline   Reply With Quote
Old 11-16-2017, 07:19 AM   #53
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
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?
This is the code of the button that I'm using to initiate the sysex command. 0x29 and 41 are the same CC message. It's just some CC at MIDI channel 16 wuth no special purpose. Channel 16 is used exclusively with midi port 3 of the controller.
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);
    )
  );
);
This is my test script:
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");
          );
      );
oscii-bot log:


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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 08:26 AM   #54
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Quote:
Originally Posted by fundorin View Post
This one isn't enough for you?
https://forum.cockos.com/forumdisplay.php?f=50
Of course I already did use it, but preferably the (EEL) scripting could be discussed in a single location, and IMHO, OSC scripting should not be so far-off. (See the Feature request I just posted.)

-Michael

Last edited by mschnell; 11-16-2017 at 08:31 AM.
mschnell is online now   Reply With Quote
Old 11-16-2017, 08:36 AM   #55
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 08:39 AM   #56
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

Do me a favor, try sending a shorter sysex message, of say 32 bytes, just to see if that works?
schwa is offline   Reply With Quote
Old 11-16-2017, 09:06 AM   #57
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
Do me a favor, try sending a shorter sysex message, of say 32 bytes, just to see if that works?
Message - "\xF0\x00\x20\x29\x03\x03\x12\x00\x02\x00\x02\x02\ x04\xF7"

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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 09:11 AM   #58
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

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"
Here is a 49-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\x02\xF7"
schwa is offline   Reply With Quote
Old 11-16-2017, 09:27 AM   #59
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

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);
  		);
  	);
If output in oscii-bot is set to loopmidi, sysex messages, generated by oscii-bot, could be seen in midi-ox anytime.
fundorin is offline   Reply With Quote
Old 11-16-2017, 09:30 AM   #60
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

So those messages send, but your 59-byte message doesn't?
schwa is offline   Reply With Quote
Old 11-16-2017, 09:34 AM   #61
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
So those messages send, but your 59-byte message doesn't?
Not exactly. If output in oscii-bot is set to loopmidi, midi-ox displays that message too:


But, the very moment I switch output of the oscii-bot to the physical midi port, nothing is shown in midi-ox.
fundorin is offline   Reply With Quote
Old 11-16-2017, 09:38 AM   #62
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

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?
schwa is offline   Reply With Quote
Old 11-16-2017, 09:48 AM   #63
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
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?
Not exactly. When the same message is sent via midi-ox, the controller is responding properly by clearing the screen or by displaying data, depending on which message was sent to it.

For example:
fundorin is offline   Reply With Quote
Old 11-16-2017, 10:03 AM   #64
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,733
Default

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.
schwa is offline   Reply With Quote
Old 11-16-2017, 10:21 AM   #65
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by schwa View Post
So I think the problem is outside of oscii-bot.
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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 02:22 PM   #66
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

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.
fundorin is offline   Reply With Quote
Old 11-16-2017, 04:12 PM   #67
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Is it possible to use timers for detecting momentary and toggle presses of the single button? Couldn't find anything realted in the manual.
fundorin is offline   Reply With Quote
Old 11-16-2017, 10:27 PM   #68
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Quote:
Originally Posted by fundorin View Post
Is it possible to use timers for detecting momentary and toggle presses of the single button? Couldn't find anything realted in the manual.
The "@timer" event service routine is called 100 times a second. Here you can count time.

set a counter to a timeout constant to start the timer and do

Code:
@timer
counter ? (
  counter -= 1;
  !counter ? (
    //do some action 
  );
);
I used such for detecting long vs short button pressing in JSFX. Here instead of @timer, @block is to be used.

-Michael
mschnell is online now   Reply With Quote
Old 11-17-2017, 06:25 AM   #69
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by mschnell View Post
set a counter to a timeout constant to start the timer and do
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.
fundorin is offline   Reply With Quote
Old 11-17-2017, 06:52 AM   #70
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

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
mschnell is online now   Reply With Quote
Old 11-17-2017, 06:54 AM   #71
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Do we have switch/break function analog in EEL2?
No mention in the manual about it either.

P.S. I miss Lua. 😢
fundorin is offline   Reply With Quote
Old 11-17-2017, 01:34 PM   #72
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,716
Default

Quote:
Originally Posted by fundorin View Post
Do we have switch/break function analog in EEL2?
No mention in the manual about it either.

P.S. I miss Lua. ��
There is no switch equivalent in EEL2...

Feel free to port OSCII-bot to Lua, you have the code!
Justin is offline   Reply With Quote
Old 11-17-2017, 01:36 PM   #73
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,716
Default

Quote:
Originally Posted by fundorin View Post
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.
If you're going to the log, you can use printf() to format, which functions mostly like the C version. e.g.
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);
Justin is offline   Reply With Quote
Old 11-17-2017, 01:37 PM   #74
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

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?
fundorin is offline   Reply With Quote
Old 11-17-2017, 02:46 PM   #75
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Quote:
Originally Posted by fundorin View Post
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.
Of course you can create your program appropriately: read the current value from the target and only move the output value after the input passes by that value.

-Michael
mschnell is online now   Reply With Quote
Old 11-17-2017, 02:53 PM   #76
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Quote:
Originally Posted by Justin View Post
There is no switch equivalent in EEL2...
IMHO no problem at all. Doing

Code:
a==1 ? (
  ...
 ) : a == 2 ? (
  ...
 ) : a == 3 ? (
  ...
 ) : a == 4 ? (
  ...
 ) : a == 5 ? (
  ...
);
is neither that much more writing nor worse readable than a switch construct.

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.
mschnell is online now   Reply With Quote
Old 11-17-2017, 02:55 PM   #77
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

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.
goldenarpharazon is offline   Reply With Quote
Old 11-17-2017, 11:32 PM   #78
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,636
Default

Just for my info: What you describe, is this enabled by a feature of Reapers' or of the MIDIMIX ?

-Michael
mschnell is online now   Reply With Quote
Old 11-18-2017, 05:41 AM   #79
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by mschnell View Post
Just for my info: What you describe, is this enabled by a feature of Reapers' or of the MIDIMIX ?
He uses wildcard for the following reaper action for tracks 1-99. For tracks >99, - standard osc command will be used, without soft pickup.


Last edited by fundorin; 11-18-2017 at 07:02 AM.
fundorin is offline   Reply With Quote
Old 11-18-2017, 08:28 AM   #80
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

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);
    );
With arrays it's possible to use cycle with slSlider[i].

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:
You may use brackets to index into memory that is local to your script. Your script has approximately 8 million (8,388,608) slots of memory and you may access them either with fixed offsets (i.e. 16811[0]) or with variables (myBuffer[5]). The sum of the value to the left of the brackets and the value within the brackets is used to index memory. If a value in the brackets is omitted then only the value to the left of the brackets is used.
my code:
Code:
    slSlider[1] = 16;
    msg2 == slSlider[1] ? (
        send_soft_fader(1);
    );
It's working only if variable is declared in the same block of code, but not when it's declared in the @init section. The name of the declared variable doesn't matter. It can be anything[1], as long as numbers inside brackets are matching. For example, foo[1] is equal to bar[1]. Weird.

Last edited by fundorin; 11-18-2017 at 09:48 AM.
fundorin 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 01:42 AM.


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