|
|
|
05-19-2018, 07:41 AM
|
#1
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Problem withMain_OnCommandEx
Hello,
I try to send a command via this very simple LUA script :
reaper.Main_OnCommandEx(25, 0, 0)
ID #25 : Toggle record arm for track O1
No action at all !
The same with 22 for mute
I tested the ID to close the project. It works fine.
Any idea ?
Alain
Last edited by Alain78; 05-19-2018 at 07:42 AM.
Reason: No title
|
|
|
05-19-2018, 07:49 AM
|
#2
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
It works here...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
05-19-2018, 08:05 AM
|
#3
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
reaper.Main_OnCommandEx(25, 0, 0)
|
It works here as well.
Some things to check in general:
- When creating a new ReaScript file, double-check that the file is saved with the correct file extension (.lua)
- Into which Section (selection box at the top right) in the Acton List did you add the Script?
- How/where are you triggering the Action, exactly?
|
|
|
05-19-2018, 08:42 AM
|
#4
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
- the script is created with lua extension
- the script is created in the Main section
- the script has to be triggered via a midi message BUT even when i trigger it via the Run button : the result is the same : No Effect !
Hope this clarify the situation...
Alain
|
|
|
05-19-2018, 09:03 AM
|
#5
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
trigger it via the Run button : the result is the same : No Effect !
|
Very strange. From the screenshot I can't really see anything out of the ordinary (assuming Track 1 is visible and not locked somehow).
Have you already tried if using IDs for other Tracks (than Track #1) are working - like, for instance ID 30 (Track: Toggle mute for track 02) or ID 33 (Track: Toggle record arm for track 02)?
Otherwise also try if restarting Reaper makes any difference, just in case ...
Last edited by solger; 05-19-2018 at 09:08 AM.
|
|
|
05-19-2018, 09:46 AM
|
#6
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Here's the full view.
I never tried to lock the track... and don't know how to do it as a beginner in Reaper...
Yes, i tried other tasks with the formula rec_toggle_comm_id = 8*track_num +14
(and with the real figures..)
I tried also with ID 22 to mute/unmute the first track
In fact, my goal is to have separate commands for arm and for unarm the tracks.
You have seen that my starting point was the code from AkeW
It looked so simple...
|
|
|
05-19-2018, 09:56 AM
|
#7
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
... and i restarted Reaper.
|
|
|
05-19-2018, 10:05 AM
|
#8
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
A shot in the dark, but are you trying to run it (from the action list) while Reaper's script IDE window is open with the script by chance ?
This doesn't work. Use Ctrl+S instead while IDE window is in focus (or the 'Start' button in the IDE).
Or close IDE window first and then try running again from action list (or via MIDI, don't know if same applies here).
Similar behaviour with toolbar buttons as I found the hard way.
https://forum.cockos.com/showthread.php?t=183929
Last edited by nofish; 05-19-2018 at 10:13 AM.
|
|
|
05-19-2018, 10:40 AM
|
#9
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
... BUT even when i trigger it via the Run button : the result is the same : No Effect !
|
Quote:
Originally Posted by Alain78
... Here's the full view ...
|
Yeah. As nofish mentioned above, trying to [Run] the Script via the Action List while having the Script open in the IDE Editor window at the same time is mostly likely the issue here.
Last edited by solger; 05-19-2018 at 10:52 AM.
Reason: typo
|
|
|
05-19-2018, 10:54 AM
|
#10
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Thank's to nofish & solger for this good idea.. but it looks i tried all the ways to run the script
- editor closed : Button Run of the Actions window
- editor open: Button Start
- Ctrl+S with editor open
|
|
|
05-19-2018, 10:57 AM
|
#11
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Of course : Same result...
|
|
|
05-19-2018, 11:01 AM
|
#12
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
Thank's to nofish & solger for this good idea.. but it looks i tried all the ways to run the script
- editor closed : Button Run of the Actions window
- editor open: Button Start
- Ctrl+S with editor open
|
Just to rule out that it might perhaps be a file/folder permission problem (when trying to access the .lua file in the .. Appdata/Roaming/.. folder):
Does it make any difference when launching Reaper as admin (via Right-Click > Administrator)?
But on second thought you posted that using some other IDs is working fine:
Quote:
I tested the ID to close the project. It works fine.
|
At this point I would suggest to make a portable Reaper install to a separate folder (side by side to your existing install): http://lacinato.com/cm/blog/25-reaperportable
Just to check if the problem is the same there ...
|
|
|
05-19-2018, 02:02 PM
|
#13
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
I just checked the option od running REaper as administrator : No change.
How did you know that i'm not running as admin ???
OK. Tomorrow (Paris time) I'll chek the portable install.
Thank you for your help.
Alain
|
|
|
05-20-2018, 02:40 AM
|
#14
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
I installed Reaper in portable mode and the the simple test show on the attached file... Unfortunately the result is the same : No action at all !
I imagine that as often with difficult problems to solve, the solution is simple ... but where to look now ?
The good news is that I discovered the interest of the portable mode that allows a simple backup with all the files at one place and the easy distibution of the solution to other PCs that I'll need.
|
|
|
05-20-2018, 10:00 AM
|
#15
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
I installed Reaper in portable mode and the the simple test show on the attached file... Unfortunately the result is the same : No action at all
|
That's very strange.
Have you already tried running the script in a New Project (to rule out that the issue might be somehow related to the project shown in your screenshots)?
And just to double-check (since you posted that some other IDs are working):
When changing the ID number 25 in the script in your screenshot to a different ID - as example to 40853 (Track: Toggle show/hide in TCP) or to 9 (Toggle record arm for selected Tracks), is running the Script Action working then?
|
|
|
05-20-2018, 10:08 AM
|
#16
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
New project - Insert new track - run the script : No action for ID 25
Same project with 1 track - ID 40853 - The track toggles from visible to hidden.
Same project with 1 track - ID 9 - No action
I've already seen that action with big number work... But nothing more to say...
|
|
|
05-20-2018, 10:39 AM
|
#17
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
New project - Insert new track - run the script : No action for ID 25
Same project with 1 track - ID 40853 - The track toggles from visible to hidden.
Same project with 1 track - ID 9 - No action
I've already seen that action with big number work... But nothing more to say...
|
OK, I've got another idea:
Install the SWS Extensions: http://www.sws-extension.org/
Then restart Reaper and check if it's working now.
|
|
|
05-20-2018, 10:53 AM
|
#18
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
The ID 25 command is working !!!
The same for 33. The same for 22 (mute)
But i've no idea why!
|
|
|
05-20-2018, 11:05 AM
|
#19
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
The ID 25 command is working !!!
The same for 33. The same for 22 (mute)
|
Great to hear that it's working now
Yeah, I don't know either why using lower command IDs in a lua script doesn't seem to be working without the SWS Extensions installed
|
|
|
05-20-2018, 11:10 AM
|
#20
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
OK let's consider that the problem is solved...
Tomorrow, i'll return to my original script.
A very big thank you for your help.
Without you, I had to give up.
Alain
|
|
|
05-20-2018, 11:26 AM
|
#21
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by solger
I don't know either why using lower command IDs in a lua script doesn't seem to be working without the SWS Extensions installed
|
Confirmed here too, without the SWS extension they don't work. "Weird".
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
05-20-2018, 12:47 PM
|
#22
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
|
Quote:
Originally Posted by solger
|
How did you come up with this idea ?
I'd never have thought to try this.
|
|
|
05-21-2018, 01:02 AM
|
#23
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by nofish
How did you come up with this idea ?
I'd never have thought to try this.
|
At some point I noticed that there was no Extensions menu in Alain78's screenshots (hence no SWS Extensions and/or ReaPack installed).
So I checked this again in a fresh portable install without the SWS Extensions installed (which I didn't do before ) and had the same issue running the LUA script.
Having the SWS Extensions installed fixes the issue (for whatever reason)
Last edited by solger; 05-21-2018 at 01:33 AM.
|
|
|
05-21-2018, 08:45 AM
|
#24
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Me again ! My story is not quite over.
I have to explain that my goal is to drive Reaper as a black box from an external program using midi messages and as little as possible with the help of AutoIt.
I take advantage of the contact with "real experts" to explain my "last" problem.
I switched to portable mode with reinstallation of SWS.
Everything is fine with the scripts. Thanks again.
I run Reaper with this command:
"G:\MaConsole - V4\Exe\Reaper_DAW\Reaper.exe" "G:\MaConsole - V4\Exe\Enregistrements\000007000000599\00000700000 0599.rpp"
When I send the midi message corresponding to the script discussed yesterday nothing happens. The same with midi messages associated with Record, Play, Stop, ... No action is executed. Messages are of course visible with midi-ox.
Then I close the project and reload it with File, Open project, Enter ... and then all the midi commands are effective.
My level of knowledge does not allow me to go further. Any idea ?
|
|
|
05-21-2018, 10:13 AM
|
#25
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
I run Reaper with this command:
"G:\MaConsole - V4\Exe\Reaper_DAW\Reaper.exe" "G:\MaConsole - V4\Exe\Enregistrements\000007000000599\00000700000 0599.rpp"
When I send the midi message corresponding to the script discussed yesterday nothing happens. The same with midi messages associated with Record, Play, Stop, ... No action is executed. Messages are of course visible with midi-ox.
Then I close the project and reload it with File, Open project, Enter ... and then all the midi commands are effective.
|
Just to clarify:
- What's the MIDI device or virtual MIDI cable used as MIDI input in Reaper?
- And where is it set up in the Preferences: under Audio > MIDI Devices or under Control/OSC/web?
|
|
|
05-21-2018, 10:55 AM
|
#26
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Virtuel MIDi is CopperLan
Midi input is setup under Audio > MIDI Devices withe the attribute Enabled+Control
What's strange is that up to now, the solution was working...
|
|
|
05-21-2018, 11:12 AM
|
#27
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
Virtuel MIDi is CopperLan
Midi input is setup under Audio > MIDI Devices withe the attribute Enabled+Control
What's strange is that up to now, the solution was working...
|
Is Reaper launched last?
Otherwise maybe try if this makes any difference:
1) In the Action List, there's an Action called Reset all MIDI devices - ID: 41175.
2) Set this one via the Extensions > Startup actions menu as Global or Project Startup Action.
Last edited by solger; 05-21-2018 at 11:33 AM.
Reason: typo
|
|
|
05-21-2018, 11:26 AM
|
#28
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Yes Reaper is lauched last after a lot of midi messages were sended thru the CopperLan network.
I put ID 41175 as Global Project Startup Action. I close Reaper when i close a project in the external program.
Sadly : no result
|
|
|
05-21-2018, 11:58 AM
|
#29
|
Human being with feelings
Join Date: Mar 2013
Posts: 5,844
|
Quote:
Originally Posted by Alain78
Yes Reaper is lauched last after a lot of midi messages were sended thru the CopperLan network.
I put ID 41175 as Global Project Startup Action. I close Reaper when i close a project in the external program.
Sadly : no result
|
OK. Doing a quick test with a different virtual MIDI cable (loopMIDI) seems to work here - although loopMIDI is a local and not a network based one like CopperLan.
I'll have to take a look at CopperLan (probably tomorrow) or will report back if something else comes into mind.
|
|
|
05-22-2018, 12:00 AM
|
#30
|
Human being with feelings
Join Date: Mar 2018
Posts: 19
|
Ah ! Ah!
I've to add that i use MTC to allow my external program to get time code messages.
https://forum.cockos.com/showthread.php?t=43606
I knew that to get these messages, the track dedicated to vVIMTC should be armed for recording.
I discovered this morning that if the track is not armed for recording then all commands driven by MIDI messages will be not effective. Understand who can!
Thank you again for your help. I continue my initiatory journey in the driving of Reaper.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 04:00 AM.
|