Old 11-20-2017, 07:25 AM   #121
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

First one isn't a bug. It's, actually, a very handy behaviour.
There is tons of software which minimizes to tray via [x] close button.
fundorin is offline   Reply With Quote
Old 11-20-2017, 08:10 AM   #122
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,789
Default

Quote:
Originally Posted by goldenarpharazon View Post
There are a couple of outstanding reliability bugs in OSCII-bot itself too if they could be dealt with as well? Thanks
See
1. https://forum.cockos.com/showthread.php?t=189074 (duplicate of https://forum.cockos.com/showthread.php?t=172325 )
and
2. https://forum.cockos.com/showthread.php?t=172324
Yeah #1 is a feature, and #2 is now fixed in git. Edit: #2 also now fixed in v0.6.

Last edited by Justin; 11-20-2017 at 08:31 AM.
Justin is online now   Reply With Quote
Old 11-20-2017, 08:34 AM   #123
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,789
Default

Quote:
Originally Posted by fundorin View Post
Is there a way to run some code on midi port reopen?
In v0.6, just released:
Code:
(tmp = get_device_open_time(dev)) > dev_last_time ? (
  dev_last_time = tmp;
  printf("reinitializing dev\n"); // executes on initial open and any subsequent re-opens
  // ... midisend(dev);
);
Justin is online now   Reply With Quote
Old 11-20-2017, 08:43 AM   #124
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Quote:
Originally Posted by fundorin View Post
First one isn't a bug. It's, actually, a very handy behaviour.
It would be nice if minimizing could be triggered in an unattended system, e.g. via a command line parameter or a line in a script.

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 11-20-2017, 08:53 AM   #125
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

In which section of the script should I put this code?
I want slStartup() function to run on midi port reopen.
When placed in to @init section, code run just once, on start of the oscii-bot, or when "script reload" is pressed.
Am I wrong, thinking that "dev" variable is an alias for device name? Tried leaving it as dev and renaming to my midi device in alias.

Code:
(tmp = get_device_open_time(midi_in)) > dev_last_time ? (
  dev_last_time = tmp;
  printf("reinitializing dev\n"); // executes on initial open and any subsequent re-opens
  slStartup();
  // ... midisend(dev);
);
fundorin is offline   Reply With Quote
Old 11-20-2017, 08:55 AM   #126
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,789
Default

Quote:
Originally Posted by fundorin View Post
In which section of the script should I put this code?
I want slStartup() function to run on midi port reopen.
When placed in to @init section, code run just once, on start of the oscii-bot, or when "script reload" is pressed.
Am I wrong, thinking that "dev" variable is an alias for device name? Tried leaving it as dev and renaming to my midi device in alias.

Code:
(tmp = get_device_open_time(midi_in)) > dev_last_time ? (
  dev_last_time = tmp;
  printf("reinitializing dev\n"); // executes on initial open and any subsequent re-opens
  slStartup();
  // ... midisend(dev);
);
@timer preferably
Justin is online now   Reply With Quote
Old 11-20-2017, 10:00 AM   #127
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

-del-
fundorin is offline   Reply With Quote
Old 11-20-2017, 11:42 AM   #128
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 104
Default

Quote:
Originally Posted by mschnell View Post
It would be nice if minimizing could be triggered in an unattended system, e.g. via a command line parameter or a line in a script.

-Michael
Verrei has already given a command line solution to this at
https://forum.cockos.com/showpost.ph...40&postcount=3
One could imagine doing the same with other "windows automation" type tools.
goldenarpharazon is offline   Reply With Quote
Old 11-20-2017, 02:50 PM   #129
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

I'm running nircmd from oscii-bot's folder with "oscii-bot minimized.cmd".
This is what's inside it:
"nircmd.exe exec hide OSCII-bot.exe"
Pretty simple trick.
fundorin is offline   Reply With Quote
Old 11-23-2017, 12:03 PM   #130
zacki
Human being with feelings
 
zacki's Avatar
 
Join Date: Feb 2013
Location: TBB - Germany
Posts: 106
Thumbs up

Quote:
Originally Posted by Justin View Post
Receiving SysEx: @midimsg, msg1/msg2/msg3 will be 0, oscstr will be set to the SysEx data (oscstr will be -1 if it's not a sysex)

Sending SysEx: use midisend_str(device,#sysexdata_as_string);
Thank you sooo much for implementing SysEx into OSCII-bot! I’ve been looking for so long on a way of building a gateway between a Yamaha 01V96 and an OSC-Device. So far my first tests with a script were very pleasing. Just for fun and for learning to better coding. Keep up the good work

__________________
Some of my favourite posts: 1 2 3 --- to be continued...

Last edited by zacki; 11-23-2017 at 12:28 PM. Reason: added gif
zacki is offline   Reply With Quote
Old 12-05-2017, 07:50 AM   #131
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Great !
The "OSC Dialogue" feature works perfectly for me, too.

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-06-2017, 01:20 AM   #132
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

How can one map ranges in EEL2?

My encoder sends values 1-24, when rotated clockwise and values 64-80 for counter clockwise.
I need the script to convert 1-24 range to 0.1-1 and 64-80 to minus 0.1-1, so that it would be possible to use acceleration of the encoder.

UPD. Solved with a straightforward method: take away 63 from the number in range 64-80, divide the result by 24 and change the sign to minus.
Anyway, r/scrub action doesn't support acceleration, and "Transport: Scrub/jog (MIDI CC relative/absolute only)" action isn't reacting properly, though I'm sending the values right. Does this action support values, other than 1?

UPD2. The following settings solved my issue with r/scrub action sensitivity. Though the jog function is absent, I can now simply divide value by greater numbers to get the needed sensitivity for the jog mode of the encoder.
https://i.imgur.com/XiZ7Uxa.png

UPD3. Aaaand it doesn't work like it should. I don't understand the behavior. It seems like faster rotation of the encoder gives more precise scrubbing/jogging. According to Reaper's log, lower values move cursor faster.
I'm going to read the manual about scrub/jog settings, cause this logic doesn't seem right to me.

UPD4. Seems like this scrub issue is more than three years old - https://forum.cockos.com/showthread.php?t=139051
Another issue from 2012 (post #33) - https://forum.cockos.com/showthread.php?t=98673

Last edited by fundorin; 12-06-2017 at 01:55 PM.
fundorin is offline   Reply With Quote
Old 12-07-2017, 05:49 AM   #133
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 104
Default

Anything to be learnt from Banned's Peavey StudioMix script or its users?

Banned tries a scrub approach in EEL2 code that maybe wasn't functionally what was wanted (perhaps the issues you are finding or similar?) then "avoiding the scrubbing function altogether, using a set of REAPER actions to move the playback cursor"
goldenarpharazon is offline   Reply With Quote
Old 12-07-2017, 05:54 AM   #134
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Tried to solve acceleration issue with the following workaround:
1. Get value from encoder (1+ clockwise, 65+ counter clockwise, depending on rotation speed).
2. Check the direction and store it, so CCW will give -1 argument to /r/scroll and CW will give positive argument.
3. Divide 64 out of CCW value, so that both directions would give 1+ values.
4. Check if the value is higher that 12, cause, otherwise, the cursor would jump across the project like crazy.
5. Run loop for osc action /r/scroll with positive or negative argument, based on direction of rotation. Do it as many times as the CC "times", but not more than 12 times.
6. Done.

The problem is that it's not working. According to Reaper's log, osc command is sent only once per encoder's click.

Here's the code (pic and text):
https://i.imgur.com/fG7f319.png
http://pastebin.ru/rwGkCCbD

oscii-bot log shows that printing in loop works both when "times" argument is set as an integer or taken from CC value:
https://i.imgur.com/2JsEAqV.png
Is it some kind of oscsend protection that doesn't allow multiple similar osc messages to be generated?

Last edited by fundorin; 12-07-2017 at 06:05 AM.
fundorin is offline   Reply With Quote
Old 12-07-2017, 05:56 AM   #135
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by goldenarpharazon View Post
Anything to be learnt from Banned's Peavey StudioMix script or its users?

Banned tries a scrub approach in EEL2 code that maybe wasn't functionally what was wanted (perhaps the issues you are finding or similar?) then "avoiding the scrubbing function altogether, using a set of REAPER actions to move the playback cursor"
I've seen that he failed with acceleration and that part of the code is commented in the script. See my previous message for a workaround that should work, once I'll figure out, what's wrong with my code.

Last edited by fundorin; 12-07-2017 at 06:14 AM.
fundorin is offline   Reply With Quote
Old 12-08-2017, 02:04 AM   #136
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default Solved

Code:



Video: https://i.imgur.com/POE5uBj.gifv
fundorin is offline   Reply With Quote
Old 12-08-2017, 06:30 AM   #137
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

What is the purpose of posting the code and the video ?

Do you want to donate it or do you suggest there are errors ?

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-08-2017, 09:26 AM   #138
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by mschnell View Post
Do you want to donate it or do you suggest there are errors ?
What?

I had an issue (see my previous messages), while trying to accelerate jog movement of the cursor via encoder on the console in my script.
I've failed in achieving the goal yesterday, as well as Banned with his MIDIMIX script, but then I found a way to make cursor faster, depending on the encoder's rotation speed. The video shows the result and the code shows how it was done. I thought that it would be nice to share, in case if someone else would want to have similar functionality in their code.
fundorin is offline   Reply With Quote
Old 12-08-2017, 09:56 AM   #139
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Great !
Thanks !
Please pardon my ignorance.
-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-13-2017, 07:54 AM   #140
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by fundorin View Post
What is the name of this command in .reaperOSC?
I've tried TRACK_MONITOR, but that's not it.

Even added toggle method to my custom .reaperOSC.
Neither toggle or boolean worked.

Code:
TRACK_MONITOR b/track/monitor b/track/@/monitor 
TRACK_MONITOR t/track/monitor t/track/@/monitor
P.S. Forgot to mention that I'm interested in a command for tracks in banks, not for selected track.
Got to this moment again. Any thoughts yet?
fundorin is offline   Reply With Quote
Old 12-18-2017, 07:06 PM   #141
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 10,789
Default

Hmm, /track/1/monitor works, but it only acts as a 3-way cycle (you can't force a particular setting). Fixing that!

Last edited by Justin; 12-18-2017 at 07:45 PM.
Justin is online now   Reply With Quote
Old 12-19-2017, 05:21 AM   #142
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by Justin View Post
Hmm, /track/1/monitor works, but it only acts as a 3-way cycle (you can't force a particular setting). Fixing that!
Yeah? What were your settings?
For me, "b/track/1/monitor" with argument 1 enables monitoring. Then, arg 0 switches it to auto and the next command with arg 0 turns it off.
Tried adding "t/track/1/monitor" to the config. Doesn't work.
Quite the contrary, I would like to toggle 3-way cycle with a single button. Just like it works in your case.
And, maybe, two-way cycle, with only on/off, excluding "auto" mode.

P.S. While we are on the subject, could you, please, fix this OSC learn assignment bug? https://forum.cockos.com/showthread.php?t=200551
P.P.S. Also, please, add "Mixer view scroll horizontally to the track bank, when selected from the device", when DEVICE_TRACK_BANK_FOLLOWS DEVICE. For now, MCP only scrolls when DEVICE_TRACK_BANK_FOLLOWS MIXER, but with this option, banks move from 1-8, 9-16 to other values and that isn't what I want. Thanks in advance.

Last edited by fundorin; 12-19-2017 at 06:26 AM.
fundorin is offline   Reply With Quote
Old 12-19-2017, 07:57 AM   #143
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Quote:
Originally Posted by fundorin View Post
I would like to toggle 3-way cycle with a single button.
To me cycling (and toggling) settings seems rather inappropriate for a protocol, as dedicated values can easily used in a cyclic way, but auto-cycling values can hardly be used in a deterministic way.

If the user wished to have cyclic "single button" handling, it should be implemented at the user interface or intermediate site.

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-19-2017, 10:45 AM   #144
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Cycle and direct selection should exist along each other. Otherwise, some of the existing setups might break.
The more options, the better. Not every osc device is able to compute some extensive script logic. Apart from scripts and software, many hardware devices exist, that can only send a single command with an argument upon the button press.
fundorin is offline   Reply With Quote
Old 12-21-2017, 02:57 PM   #145
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default LCD text request

I'm requesting current info from the LCD, so in response, the surface will text from the LCD in sysex format. The thing is that partial data request wasn't implemented by Novation devs, so the surface always sends all text from both LCDs at once. it looks like this:
The thing is that the data is too big to fit in one message, so it's split in two:


Using the example that Justin's or John's example, I'm trying to print the incoming message to the console with the following code.

The data is requested with this code and it works, as can be seen from above:

Code:
lcdRequest = "\xF0\x00\x20\x29\x03\x05\x10\x05\x00\x00\x66\x04\x00\x00\x20\xF7";
    msg1 == chan && msg2 == slAu[2] && msg3 == 65 ? (
        midisend_str(midi_out, lcdRequest); // data request
        printf("LCD: %s\n",hex2str(oscstr)); // should print the same as midi-ox does
        );
I'm getting nothing in the oscii-bot's log:


I feel like this might happen for some other reason, apart from the data is split in two sysex messages, and I wonder, why is this happening and how to store the whole data, so that I could resend it back to the surface later?
fundorin is offline   Reply With Quote
Old 12-22-2017, 01:29 AM   #146
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

I don't seem to understand your code.

Do you really do

midisend_str(midi_out, lcdRequest); // data request

and in the next instruction expect the answer of the request to be in oscstr by

printf("LCD: %s\n",hex2str(oscstr));

This can't work, as the program needs to wait for the answer to appear in a "@midimsg" event (and - AFAIK - check the msg byte if they are as expected) before OSC can be assumed to contain the sysex message.

(I suppose the splitting in two blocks is just a fake introduced by MidiOX.)

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-22-2017, 02:49 AM   #147
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Sysex incoming messages appear in oscstr.
It was Justin's decision to do so.


I'm using the same construction to compare incoming sysex message from the surface at startup:



As you can see from midi-ox screenshot, requesting sysex from the script is working.
as you can see from this code, displaying incoming sysex message in log also works:

Last edited by fundorin; 12-22-2017 at 02:55 AM.
fundorin is offline   Reply With Quote
Old 12-22-2017, 04:28 AM   #148
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Quote:
Originally Posted by fundorin View Post
Sysex incoming messages appear in oscstr.
Yep, but of course only after they in fact did arrive.

The receive-variables (msgX and oscstr) only feature defined values in the appropriate @... event handlers: msgX in @midimsg, and oscstr in @oscmsg. Additionally oscstr in @midimsg in case the msg1 indicates that a SysEx message has been received.

In any case, OSCII-Bot is an event-driven software system and does not wait on anything, anytime. Hence after sending out a midi message which needs to travel to the recipient and the answer needs to travel back, OSCII-Bot has long been gone to sleep before the answer is in sight. So a new @midimsg event will be fired not before the answer completely has been received and stored to msgX and (in case of SysEx) to oscstr.

-Michael
__________________
www.boa-sorte.de
mschnell is offline   Reply With Quote
Old 12-22-2017, 06:32 AM   #149
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

I don't understand what you're trying to tell me. Those are basic things that you've written.
If you'd check my quoted code, you'd see that I'm requesting LCD data with a button on the surface (CC message) in @midimsg section.

Again, 1470 - 1474 - already working code, that displays oscstr in the log.
1477-1480 is my lcd request, that doesn't display anything.
fundorin is offline   Reply With Quote
Old 12-22-2017, 01:05 PM   #150
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Sorry.

Seemingly English derived from Russian is than much different from English derived from German, that we are not able to communicate (I did have this impression already before). So maybe a native English speake might chime in and translate.

Anyway I'll give it another try:

>> midisend_str(midi_out, lcdRequest); // data request
>> printf("LCD: %s\n",hex2str(oscstr)); // should print the same as midi-ox does

This will not work.

After sending OSCII-Bot will not wait for a reply, and hence oscstr is evaluate before any data is attached to it.

You should go (untested):


in @midimsg, @timer or @oscmsg :

...
midisend_str(midi_out, lcdRequest); // data request
...


in @midimsg:

...
(msg1 & $xF0) == $xF0 ? ( // this is a SysEx
test_if_an_LCD_message_is_expected ? (
printf("LCD: %s\n",hex2str(oscstr)); // should print the same as midi-ox does
);
...
);
...




-Michael
__________________
www.boa-sorte.de

Last edited by mschnell; 12-22-2017 at 01:10 PM.
mschnell is offline   Reply With Quote
Old 12-22-2017, 05:09 PM   #151
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Do you mean I should just separate send and receive functions?
I might try. But, I would need to partially match compare all the incoming sysex messages to store only LCD data related ones. Seems logical.
fundorin is offline   Reply With Quote
Old 12-22-2017, 11:17 PM   #152
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 4,630
Default

Quote:
Originally Posted by fundorin View Post
Do you mean I should just separate send and receive functions? ... Seems logical.
Yep. In an event driven system this is perfectly necessary.

Other Systems might provide "blocking Read" functions that internally wait (potentially forever) for something to happen (e.g a message comes in from some sender). This is problematic, as while waiting, the system can't react on other stuff happening (e.g. a timer is scheduled, ...). So it is just fine that OSCII-Bot does not feature any blocking functions (but "sleep()", that should be use with great care), and works just "event driven".

-Michael
__________________
www.boa-sorte.de
mschnell 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 05:51 PM.


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