From the original SynthMaker forum (2004–2014), with its members’ names and dates.
rl ·
Played with the new Shell Execute. Some comments:
The best use for me would be to open help or documentation. So I would like to connect something like "index.html" or "manual.pdf" or "help/manual.chm" to the path input.
If Shell Execute would start searching in the plugin-folder (where the DLL is installed) and start the associated program with the document denoted by the path string, everything would be perfect. If path string is an executable, Shell Execute should just call the executable (using PATH for search in addition to the current behaviour, where the executable is only searched in the SM folder or the VST-host installation folder.
jorge ·
rl, I'm not sure what you mean, it would be great if you explain it again.
Here is an example using shell execute to create a PovRay animated knob:
[old link]
This example assumes you have PovRay v3.6 installed in it's default folder.
Basically the schematic generates a PovRay file for each frame of the animation, it then calls PovRay passing certain parameters like resolution etc. PovRay renders the frame which is then loaded back into an array of bitmaps. You could easily stitch the bitmaps into an animated strip and save to a png.
It doesnt yet take care of background transparency but that wasnt the point of this example.
rl ·
jorge wrote: rl, I'm not sure what you mean, it would be great if you explain it again.
ok, trying again:
I was thinking about a more general use of ShellExecute.
ShellExecute is for running external programs, right?
Assume, that I'm building a VSTi, there will be a button. When clicked it should display a html file in a browser.
Other people install the VSTi on their computers. I cannot make any assumptions on the environment on other computers.
I could connect a string to Path ("C:\Programm Files\mozilla\bin\mozilla.exe") and Args ("C:\VSTplugins\MyPlugin\index.html") of ShellExecute. That will work on my computer, but definitely not on others,. They maybe have mozilla installed in a different folder, the prefer firefox over mozilla, they have the VSTi installed at a different location,......
The same goes with your example (very cool stuff, btw.). It will work on your computer, but not on my computer.
So I was suggesting that ShellExecute tries to find programs/files beginning in the installation folder of the plugin (e.g. GetModuleFileName). This could be helpful for calling companion tools that are also installed in the VSTi installation folder.
The other suggestion was, if Path is not a program but a document (eg. "manual.pdf"), ShellExecute could find it's associated program in the registry and call the program (adobe reader) with the document.
Does this makes sense?
jorge ·
Yeah, it makes a lot of sense, thanks for explaining it again.
Maybe the next step would be some low level registry components like for example accepting a string wth a file extension and having as result another string with the path to the associate application.
Nu Audio Science ·
Just wondering if this could be used to send a sample from your synth to an audio editor ?
jorge ·
Nu Audio Science wrote: Just wondering if this could be used to send a sample from your synth to an audio editor ?
At the moment you can only save text files. With a wave file save component you'd be able to do it if the audio editor accepts command prompt arguments.
rl ·
yes I think so:
- save sample to temp file (needs a wave file saving component)
- ShellExecute audio editor with temp file
- when done-trigger fires, reload sample from temp file
That brings another suggestion to my mind:
supply macros or variables for Paths in all components that deal with file I/O
$TEMP - Windows Temp folder
$PROGRAM - Program Files folder
$WINDIR - windows installation folder
$CURRENTDIR - folder where VSTi runs (or SM)
...
so it would be possible to save audio data to $TEMP\MySample.wav
EDIT: jorge answered faster, but nevertheless...
beno ·
Good ideas RL.
This is really cool stuff.
Ben
Tom7777 ·
So is it actually possible to link to a url at the moment? if not there should be a module to do so i think and that way people could link to the SM website on there plugins or link to there homepage ect.
NothanUmber ·
Hm, something like that could work...
Greetings,
NothanUmber
Tom7777 ·
hmm, well im not sure if thats the greatest way to do it, for example if they didn't have mozilla or used some not so well known browser or they installed under a different path, i think SE has the option to load website but im not sure how it does it. Thanks for the example though.
NothanUmber ·
Yepp that's right, hardcoding the path is not a good idea. Perhaps SM should support at least systen variables then one could write something like
%ProgramFiles%\Internet Explorer\iexplore.exe
what should work on at least 98% of all Windows computers. (Well, my notebook would be one of the missing 2% as I use an invalid configuration for the IE so that it doesn't even try to do dumb things when I'm not at home...)
Greetings,
NothanUmber
P.S.: Perhaps even better then system variables would be mime type support so that you can get the registered application for a certain type. (In some cases that could mean that one has to provide the parameter string in different formats for the most common applications but e.g. most web browsers I know accept a plain url and display that as expected.)
NothanUmber ·
Something like that would be cool:
Greetings,
NothanUmber
Nu Audio Science ·
Why not just do it like SE, Execute the webpage and windows will automatically find the default browser ?
Tom7777 ·
Yes i think that would be the best method for doing it also NAS, Malc and Jorge can we have a url module with a string in and a trigger in using this method please 🙂
whyterabbyt ·
If you want to run the user's default browser then try executing the START command, with the data file as argument. It should launch whichever program has been set to open that file's data type.
eg START readme.txt
would launch the default text file reader.
Much easier than trying to second-guess paths.
Nu Audio Science ·
Nice one Rabbyt
NothanUmber ·
Hi whyterabbyt,
good idea!
Is "start" also available as a separate program? That would be even better, otherwise one could use something like that:
Path: "cmd.exe"
Args: "/c start [old link]"
(But that always starts the cmd.exe before loading the browser - the user won't recogize that though except he has a firewall that warns if one program is started by another one and that has a "allow" rule for the default browser but not for cmd.exe)
Greetings,
NothanUmber
whyterabbyt ·
I think it depends on how they're actually executing commands within SynthMaker, to be honest... you should be able to launch a command shell in a hidden state, so if thats not already done, it might be worthwhile requesting it...
Tom7777 ·
I think a url module would be best, that way in the modules code (devs) could set it so it detects what brower the user has as the current default browser. 1 String in, 1 trigger in,
Wrote something here? To have a post removed or your name hidden, write to [email protected].