Old 12-15-2019, 04:26 AM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default ExeProcess send command line

I have a folder in the scripts folder "sendmidi" with sendmidi.exe in it.
I just need to send the command line with reaper.ExeProcess

Code:
    cmdline =  [["]] .. script_path .. [[sendmidi\sendmidi.exe dev "Microsoft GS Wavetable Synth" pc 17 channel 1 on 60 90 clock 80"]]
    
    reaper.ExecProcess(cmdline,-2)
this works in the cmd window
sendmidi.exe dev "Microsoft GS Wavetable Synth" pc 17 channel 1 on 60 90 clock 80

If this works I'll have to do one for Mac and Linux also.
https://github.com/gbevin/SendMIDI/releases
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob is offline   Reply With Quote
Old 12-15-2019, 10:31 PM   #2
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

This sends ok
Code:
reaper.ExecProcess("cmd /c c: & cd C:/Users/Band In A Box/AppData/Roaming/REAPER/Scripts/ReaTrak/sendmidi & start /min sendmidi.exe dev MIDI Mapper pc 17 channel 1 on 64 90 clock 80 ",-1)
but when I start cmd it's in another folder so I have to change to root "c:" as it won't "cd" from there then change directory "cd" to the script location.
I need to start the cmd minimized start /min but could not work that out I could only add it for sendmidi.exe so there is still a quick flash of the command window. EDIT: -2 switch gives me minimized

I want to be able to use the script_path
Quote:
local info = debug.getinfo(1,'S');
script_path = info.source:match[[^@?(.*[\/])[^\/]-$]]
maybe there's a better way to send the command line, or natively in Lua ????
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak

Last edited by MusoBob; 12-16-2019 at 03:53 AM.
MusoBob is offline   Reply With Quote
Old 12-16-2019, 03:46 AM   #3
-_~
Human being with feelings
 
Join Date: Oct 2019
Location: Location: Location: Location: ###Fatal error: Interface RecursiveLocation cannot implement itself###
Posts: 40
Default

I think you have the quotes in the wrong places:
Code:
[["]] .. script_path .. [[sendmidi\sendmidi.exe" dev "Microsoft GS Wavetable Synth" pc 17 channel 1 on 60 90 clock 80]]
-_~ is offline   Reply With Quote
Old 12-16-2019, 04:01 AM   #4
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 2,643
Default

Heaven ! thanks again, I put a -2 switch on the end and it's minimized. I will try it on the Mac now.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
STASH Downloads https://stash.reaper.fm/u/ReaTrak
MusoBob 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 02:36 PM.


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