No internet connection
  1. Home
  2. How to

Run Soundflow CLI with additional parameter

By Sascha Prangen @Sascha_Prangen
    2021-02-04 09:46:18.195Z

    Hi,
    is it possible to add a parameter to the soundflow run command and retrieve the value of this in a soundlfow macro?
    Something like "soundflow run user:-LHdSqVWNHteMMKcJ3BE:cjlhc4jpx0000eo10ggwrdrfn ‘addittionalParameter'"
    Background: i would like to pass timecode values from a python script to a soundflow macro.
    By the way, thank you for this great app!

    • 8 replies
    1. Hi Sascha,

      That sounds like a really interesting use case! What's the timecode info you're getting in a Python script / what are you integrating with here?

      The answer to your question is yes :)

      Make this script:

      log(event.arguments.arg1);
      

      Then call it like this from Terminal/Python/wherever:

      soundflow run user:ckgnn2emt0002dx109l0uopqr:ckimmgdb20000yh10z0t280w7 '{ "arg1": 12345 }'
      

      The argument after the command ID is expected to be a json object that will be passed into the event.arguments object.

      1. SSascha Prangen @Sascha_Prangen
          2021-02-16 21:33:58.727Z

          Hi Christian,

          sorry for the late reply.
          thank you so much. I tried it and its working great.

          I do lots of VoiceOver recordings for Documentaries and TV Series and get the scripts mostly in word (docx) file format. You have to jump through protools session by entering timecodes the whole day. To make that easier i am trying to automate the process of manual timecode entering.
          For that i put together a python script/flask app that converts these docx-files to html, converts timecode to "links" and makes the generated files accessable via a browser in the local network. I can now browse these files with my ipad and touch a "timecode link" and protools jumps to the TC location. That makes me happy :)

          Now i would like to move this flask app to a docker container for compatibility reasons. In this szenario the "soundflow run" command wont work. Is it possible to assign a web trigger to my soundflow macro and then trigger it from the container?
          I tried already something like http://ip-address:1780/command/t:ckkvr5srf00008x102irqovvc
          but that is not working (Unauthorized Web Triggers are not supported).
          Maybe you can help me again?
          Thank you!

          1. Hi Sascha,

            I'm not sure that this would work being run from Docker, since Unauthorized Web Triggers, even when turned on, can only be run from 127.0.0.1. I'm not sure if Docker's networking configures it as localhost - I think it usually comes up as a separate IP, so SF would reject that (we don't allow remote control through port 1780 as that would be a security issue).

            You could consider instead using OSC triggers, or use ssh from your Docker container into the host.

            1. Ahh, but of course, if the links were straight to 1780 on localhost, and not to the Flask app inside the Docker container, so that they'd be opened by your browser on the host Mac, then you could definitely enable them.

              To enable unauthorized web triggers from localhost, add this property:

              "enableUnauthorizedWebTriggers": true,
              

              to your appSettings.json file in: ~/Library/Application Support/SoundFlow/v2/appSettings.json

              1. SSascha Prangen @Sascha_Prangen
                  2021-02-17 22:44:34.839Z

                  Hi Christian,

                  i understand that allowing remote control through port 1780 would be a security issue.
                  OSC seems to be a good option. Tried it. I am able trigger my soundflow macro from the docker container with OSC but i am not able to pass a value/argument to soundflow. I need to pass a timecode string to the soundflow macro.
                  Can you give me a hint on how to do it?

                  Thanks again!

                  1. Hi Sascha,

                    My apologies - I can see that we don't currently properly forward the OSC arguments to the scripts, so you have no way currently of reading those.

                    I think your best bet would then be ssh.

                    1. Of course another way entirely would be to build it all in a single SoundFlow script, but you wouldn't have an HTTP server though.

                      Did you consider making the HTTP links that are served links that just go straight to 127.0.0.1:1780? That should work.

                      It also occurs to me that you would be a great candidate for our SoundFlow Developer Program. In that you'd learn how to make dynamic surfaces and decks, so that all of this, instead of being displayed on a web page, could be displayed as a proper app - all contained within SF.
                      If you're interested in hearing more about it, please be in touch at christian@soundflow.org

                      1. In reply tochrscheuer⬆:
                        SSascha Prangen @Sascha_Prangen
                          2021-02-23 20:34:24.093Z

                          Hi Christian,

                          ok, thank you, i go for ssh now. Its seems to be working fine in my tests.